Go Down

Topic: How the device name (/dev/ttyS0 or /dev/ttyUSB0) is decided exactly? (Read 1 time) previous topic - next topic

AlphaZeta

I guess this question has more to do with Linux than Arduino itself. But I am very curious to see how the actual device name is determined. The Arduino on my Linux PC (Ubuntu 10.04) had always showed up as /dev/ttyS0 till a few days ago. I don't remember installed anything unusual, but all of a sudden it changed to /dev/ttyUSB0.

Everything works just fine, but I am just curious as to why. Anyone?

awe_cz

This is decided by udev daemon and its rules - my bet is that your system got updated, they changed a lot in udev subsystem a lot during last couple of years. Anyway - you might create a permanent rule and have Arduino on /dev/arduino, for instance...

AlphaZeta

Thanks awe_cz, it makes sense. I have looked at the udev rule folder under both /etc and /usr but couldn't seem to find anything specific for Arduino though...

Aeturnalus

There won't be anything specific, since Arduino uses a generic USB to Serial Modem driver on *nix; however, you can add your own rule based on how the device identifies itself.

I wrote a post on how to do this a while back, though it's titled for FTDI, the method should work for any USB device: http://aeturnalus.com/robotics/mapping-ftdi-to-files-with-udev/

AlphaZeta


Go Up