PDA

View Full Version : [kubuntu] 11.04 and serial port renumbering



wd5gnr
April 29th, 2011, 05:02 PM
I've run Kubuntu for a long time and I make use of serial ports for lots of things (embedded system programming and debugging mostly). My current CPU doesn't have a serial port so I have a 2 serial port PCI board. In previous versions, since I don't have any "normal" serial ports, these have shown up as /dev/ttyS0 and /dev/ttyS1. I also have an 8 port Edgeport USB but that's not really related to this issue.

When I upgraded to 11.04 all my scripts quit working. /dev/ttyS0 was there but didn't seem to have real hardware behind it. A little investigation shows that now ttyS0-S3 are the "standard" serial ports even if you don't have them. That means my PCI card is not at /dev/ttyS4 and ttyS5.

Just changing scripts isn't enough though. By default, upstart keeps getty running on all these serial ports. I had made the change to ttyS0 a long time ago. But now I needed to do it for ttyS4 as well. So in /etc/init there is a tty4.conf file. I just put # signs in front of every line so it is effectively empty. Could just rename it or delete it.

Next you have to do: sudo initctl reload-configuration

Some documentation says it is initctl reload but that's incorrect! Finally kill the getty process hanging on ttyS4. If you don't care, just reboot instead of using initctl and kill.

That's all it took for me. I am not sure the real value to making this change. Some software has a few ports hardcoded into it and so making my first port at S4 could be bad. But with the USB ports around, maybe there isn't much software with ports hardcoded. I have noted that at some point (before 11.04) cutecom can no longer enumerate my available ports. Not sure why that is.

Anyway, though this might help someone searching for 11.04 Natty serial port issues.

Thinking a little harder, I realized you could also do:

sudo setserial /dev/ttyS4

Then note the port, uart, and IRQ. Mine was 16550A, 0xe800, and 20

then say

sudo setserial /dev/ttyS0 port 0xe800 irq 20 uart 16550a
sudo setserial /dev/ttyS4 uart none


Not sure if that survives a reboot or not though.