How do I know if my serial adapter card is working?
The way you've got Ubuntu setup is correct, the serial port at /dev/ttyUSB0 is the right serial port. You can test the port by piping some data into it and if it doesn't return an error, then it's working as a serial port:
ls > /dev/ttyUSB0
Now to get it working you may have to find out what the right settings are. Or you may have to switch on serial port communication on your cisco router (it's not always switched on).
If you want you can use ttywatch
to do some serial port debugging. But it might be beyond your scope.
The easiest way to test a serial port is to loop back Tx to Rx. This is easy if you have a loopback plug. If not connect pin 2 to pin 3 (db9 or db25).
Then open the port with a terminal program like picocomm
. If the port is working you should see the characters you type. If not, the port is not working. You may have to configure picocomm
to ignore RTS/CTS signalling.
I find an RS-232 inline signal tester (a small block with LEDs for each signal) helpful. It will help find if you have your signal lines crossed. At slow speeds you can see the data passing on the Tx and Rx lines. If the lines are crossed you may need a null modem cable.
I believe that it important to use the cable that came with the router. If I am not mistaken it connects pins in the opposite order to what you get with a CAT-5 cable.
With the same setup, I found that I had to tweak the setserial baud_base
to get correct baud rates.
E.g.:
setserial /dev/ttyS1 baud_base 115200
setserial /dev/ttyS2 baud_base 115200
You can paste that in /etc/rc.local for example.
With another serial card, the baud base was 921600.
Check the serial status of your serial lines with setserial -gav /dev/ttyS*