[TriLUG] Serial Ports

Jason Purdy jason at journalistic.com
Mon Sep 15 14:16:27 EDT 2003


Hi All,

In preparation for possible bad weather & power outages, I was trying to 
get an UPS unit to communicate with my (Debian) Linux server through its 
serial port and I was running into problems.  I actually figured out the 
problem halfway through writing this e-mail (when I got to the cable 
part), but I thought I'd still send this in, for future reference.

I first enabled the Serial Port in the BIOS and left the Memory & IRQ 
settings to their default values.  Then in the 'dmesg' output, I see 
this line:

# grep tty /var/log/kern.log
Sep 15 11:43:03 ruby kernel: ttyS00 at 0x03f8 (irq = 4) is a 16550A

Why is there two 0's at the end there?  I don't see a /dev/ttyS00 (I do 
see a /dev/ttyS0:

# ls -l /dev/ttyS*
crw-rw----    1 root     dialout    4,  64 Mar 14  2002 /dev/ttyS0
crw-rw----    1 root     dialout    4,  65 Mar 14  2002 /dev/ttyS1
crw-rw----    1 root     dialout    4,  66 Mar 14  2002 /dev/ttyS2
crw-rw----    1 root     dialout    4,  67 Mar 14  2002 /dev/ttyS3

So now I'm feeling good - it looks like the serial port is working on 
the Linux server, so I hook it up and the UPS vendor (CyberPower) refers 
to me powstatd:
http://dollar.biz.uiowa.edu/powstatd/

So I get that installed and it has a dandy powstatd.conf file that I've 
told it to watch all of those ttyS# options, all with the same result:

# powstatd -t
powstatd: online (standalone), watching /dev/ttyS0.
CTS DSR DCD RNG   DTR RTS   STATUS
  0   0   0   0     0   1    LOW
  0   0   0   0     0   1    LOW

I should see some 1's in there in the CTS, DSR, DCD or the RNG columns, 
especially when I unplug the UPS, but nothing.  So I figure something's 
up w/ the serial port on the UPS and/or the serial cable, but I've tried 
switching to different UPS'es.  So then I try a different cable (one 
that came w/ the unit {I was trying a different/longer one}) and voila! 
  It works!

# powstatd -t
powstatd: online (standalone), watching /dev/ttyS0.
CTS DSR DCD RNG   DTR RTS   STATUS
  1   0   1   0     0   1    OK
  1   0   1   0     0   1    OK

So I'm off to finish up the configuration!  I hope someone finds this 
useful, too, though I'm sure you would probably initially attempt to use 
the actual cable that came w/ the vendor. ;)

Cheers,

Jason

PS: Thanks Jon & Ben for helping me w/ my network routing ... I was able 
to fix the problem by doing a "route -del" on the eth1 card for 0.0.0.0.




More information about the TriLUG mailing list