Ubuntu and USB Serial Devices

So I had to reboot the Linux server today, and I ran into the problem of it randomly assigning /dev/ttyUSB? devices to my two USB serial cables. With randomly assigned devices my CAN and SMS interface serial port names happened to get reversed – grrr.

So the task is to get Linux to assign the same name when rebooting.

First find out the device serial numbers, use this command and serach for the devices. Luckily in my situation the two cables I have are both FTDI cables with different serial numbers. Here is one

Next is to create or edit /etc/udev/rules.d/50-serial-devices.rules, and add a line for each device using the serial number, and in this case create a symlink to ttynasco0/1.

Restart udev, (reload?,  and trigger?) and magically the new files /dev/ttynasco0 and /dev/ttynasco1 will get created and assigned to whatever /dev/ttyUSB? file the kernel assigns.

Lastly I changed my config.ini file to point to the new nasco tty files.

Done!

Update 26/12/2014 – I replaced a cable and needed to update the configuration – It didn’t seem to take effect until I rebooted the machine for some reason.

 

Leave a Reply