[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Serial port connection (null modem) not working



On 08/23/2007 08:37 AM, Fili Wiese wrote:

Hello,

I'm having trouble setting up a serial connection between two servers
using a null modem cable.
This link is needed as a redundant connection for Heartbeat.
Both machines are indentical (both hardware and software).

Some info:
-----------------------------------------------------------------

#uname -a
Linux galvatron 2.6.18-5-686  #1 SMP Sun Aug 12 21:57:02 UTC 2007 i686
GNU/Linux

#ls -al /dev/ttyS0
crw-rw-rw- 1 root dialout 4, 64 2007-08-23 14:56 /dev/ttyS0

#groups
dailout (among others)

#setserial /dev/ttyS0
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4

#cat /proc/interrupts
4:          4          1    IO-APIC-edge  serial

#cat /proc/ioports
03f8-03ff : serial

#cat /proc/tty/driver/serial
serinfo:1.0 driver revision:
0: uart:16550A port:000003F8 irq:4 tx:0 rx:2 brk:2 RTS|DTR|DSR
1: uart:unknown port:000002F8 irq:3
2: uart:unknown port:000003E8 irq:4
3: uart:unknown port:000002E8 irq:3

-----------------------------------------------------------------

In my humble view, everything seems to be set up perfectly.
However, an echo/cat test simply doesn't work:

server1: echo test >/dev/ttyS0
server2: cat </dev/ttyS0
(no output)

I'm really at a loss :S
Does anybody have a clue where to look next?

Maybe the (brand-new) null-modem cable is not wired properly but how do
I find that out?

Thanks in advance,

Fili




I never tried to use 'cat' to test null-modem connectivity, so I would not vouch for it. Use pppd instead.

There are a few things that must be done to the serial port before data can be sent or received, and pppd knows how to do these things.

I can't find the document that showed me how to set this up, but this is what I remember having to do:

1. Create an /etc/ppp/options.ttyS0 that configures the serial port for 115200 bps, pap authentication, specific IP addresses for the self and the peer, and 'silent' (wait for a connection).

2. Add the user and host names to /etc/ppp/pap-secrets.

3. Add a line to /etc/inittab to launch the pppd instance like so:
  pd:2345:respawn:/usr/sbin/pppd /dev/ttyS0 nodetach > /dev/null

Except for number three, both machines need these things done to them. The third item might be omitted for the machine to which you have continuous keyboard access.

Believe me when I say I wish I could find the "Null Modem FAQ" or whatever it was that showed me how to set this up, because it's quite complicated, and I couldn't do it again if I had to. Maybe you can search Yahoo.




Reply to: