Ubuntu: How do I know if my serial adapter card is working?



Question:

I just installed a 2 port serial adapter in my Ubuntu 10.10 system, then I tried following this tutorial that I used on my old system to connect to a cisco router (my old system had an onboard serial adapter, and the tutorial worked just fine). I can't get my system to connect to the cisco router, so I'm wondering if the card even works in Ubuntu. How can I tell if the card actually works with Ubuntu?

#dmesg | grep tty  [    0.000000] console [tty0] enabled  [    0.358667] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A  [    0.358994] 00:0c: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A  [    0.359128] ttyS1: detected caps 00000700 should be 00000100  [    0.359132] 0000:03:00.0: ttyS1 at MMIO 0xfeafd000 (irq = 16) is a 16C950/954  [    0.359191] ttyS2: detected caps 00000700 should be 00000100  [    0.359195] 0000:03:00.0: ttyS2 at MMIO 0xfeafd200 (irq = 16) is a 16C950/954  


Solution:1

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.


Solution:2

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.


Solution:3

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*


Solution:4

Is the card connected via PCI? If so, just run lspci in terminal and see if it shows up.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »