Complete.Org: Mailing Lists: Archives: discussion: February 1999:
[aclug-L] need serial port (RS232) info
Home

[aclug-L] need serial port (RS232) info

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: aclug-L@xxxxxxxxxxxx
Subject: [aclug-L] need serial port (RS232) info
From: Dale W Hodge <dwh@xxxxxxxx>
Date: Thu, 18 Feb 1999 16:40:49 -0600 (EST)
Reply-to: aclug-L@xxxxxxxxxxxx

I have a little project in mind that I need some help with.  

Let me preface this with the fact that other than some shell scripting, I
haven't programmed anything in years. So commented examples are a must!

Okay here's the project: I want to use the serial port to trigger a relay
to control a device.  Simple enough. I've found code snippets that show
how to raise DTR. The question is how to best to toggle the on/off state.
The code I have keeps the DTR on as long as the program is running. But
how would I go about killing it to drop DTR? I'm wanting to run this as a
cron job, so I need to either find a way to track the PID or a way to use
a pipe to toggle the running state.

Part two of the question: How much current can the serial port directly
handle? Should I be switching the relay via a transistor rather than
directly?  What kind of voltage signal is DTR high? Is there a better way
to handle this?

If you are wondering what I'm up to with this, I want to build a device to
switch my modem from one phone line to another.  At certain times of the
day I have a fax line free, and at others a voice line free.  Right now I
have two modems on two diferent ports, but only one is 56k. A cron job
switches which answers and which dials out.  I want to make sure that the
56k modem is always used to dial out, and the voice modem is always
answering the phone.  Complicated, I know, but I don't want to shell out
the $$$ for another phone line.   


 Dale W Hodge  dwh@xxxxxxxx, dwh@xxxxxxxxxxxx  
 Web Page: www.sktc.net/~dwh, www.dnd.ddns.org
   __   _
  / /  (_)__  __ ____  __
 / /__/ / _ \/ // /\ \/ /  . . .  t h e   c h o i c e   o f   a
/____/_/_//_/\_,_/ /_/\_\              G N U   g e n e r a t i o n . . .


---
This is the Air Capital Linux Users Group discussion list.  If you
want to unsubscribe, send the word "unsubscribe" to
aclug-L-request@xxxxxxxxxxxx.  If you want to post to the list, send your
message to aclug-L@xxxxxxxxxxxx.



[Prev in Thread] Current Thread [Next in Thread]
  • [aclug-L] need serial port (RS232) info, Dale W Hodge <=