LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   RS232 between two linux servers (https://www.linuxquestions.org/questions/programming-9/rs232-between-two-linux-servers-640542/)

baddah 05-07-2008 10:04 AM

RS232 between two linux servers
 
Hi,

I need to write a RS232 app to read and write to an analog PBX through a serial cable. I am looking to use perl with Device::SerialPort.

For starters,i'd just like to get the connection running between two linux servers as i do not have the specs on the pbx at the moment.

To set this connection up between two linux servers,what do i need?Is there any extra packages i need to install, or should it just work,i.e i have the cable connected to both com1 ports and if i do something like

Code:

echo "Hallo" > /dev/ttyS0
from one and

Code:

cat < /dev/ttyS0
from the other, should i expect some comms happening?I have tried this, and its not working, hence my question what i'll need to set up a rs232 connection between two linux servers.

Thanks for any help

jailbait 05-07-2008 10:09 AM

Make sure that the cable is a crossover cable. You might try communicating with minicom.

--------------------
Steve Stites

michaelk 05-07-2008 10:23 AM

To expand on jailbait's post the serial port on each computer must be configured the same i.e. baud rate, parity and stop bits.

theNbomr 05-08-2008 12:56 PM

Use minicom or C-Kermit to get communicating between the two hosts. Then, start writing your code on one host, but continue to use the terminal emulation package on the peer host. Read http://tldp.org/HOWTO/Serial-HOWTO.html, http://www.easysw.com/~mike/serial/serial.html and http://tldp.org/HOWTO/Serial-Program...WTO/index.html for a lot of good advice. Try to avail yourself of a RS-232 breakout box, or some way of modifying the pinouts on your serial port connectors to enable control of the modem control lines, and to create loopback configurations for testing.
Once you've got some basic functionality to your code, hook up to your target device, and ring out the cabling, again. Then finish the code.
A couple of utilities that will be your friends: stty & setserial. Read the man pages.

--- rod.


All times are GMT -5. The time now is 01:24 PM.