LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-07-2008, 10:04 AM   #1
baddah
Member
 
Registered: Feb 2006
Location: Cape Town,South Africa
Distribution: Fedora Core 8
Posts: 188

Rep: Reputation: 30
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
 
Old 05-07-2008, 10:09 AM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,340

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Make sure that the cable is a crossover cable. You might try communicating with minicom.

--------------------
Steve Stites
 
Old 05-07-2008, 10:23 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,744

Rep: Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924
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.
 
Old 05-08-2008, 12:56 PM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
minicom@rs232 kingraja84 Programming 7 03-10-2012 09:05 AM
Turning several rs232 connections into a network using terminal servers? klauswunderlich Linux - Networking 2 01-16-2008 11:07 PM
USB>RS232 versus PCMCIA>RS232 jayhel Linux - Laptop and Netbook 2 08-04-2005 06:09 PM
Use linux box as an RS232 terminal? (n00b question) PsychosisNode Linux - General 3 07-26-2005 07:32 AM
using rs232 with linux ams Linux - Networking 1 02-26-2005 05:58 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration