5

On Linux, if you have more than one USB TTY device, the USB port name (/dev/ttyUSBx) changes every time one is plugged in, and there's no easy way to know the new name without going and looking through dmesg. It's trivial to set up a udev rule that creates a custom symlink so that my Arduino's FTDI can always be accessed through e.g., /dev/ttyArduino, and this is the standard procedure for persistent access to USB devices.

However, I can't make the IDE accept anything other than the /dev/ttyUSBx names. Even directly editing preferences.txt is ignored.

Is there any way to instruct the IDE to use custom port names in order to access the Arduino through a symlink or other persistent name?

2

Consider using a device name of form ttyUSBnn, where nn is fairly large. For example, in /dev you could say

sudo ln -s ttyUSB1 ttyUSB77

Then, ttyUSB77 shows up in the IDE's ports list and can be selected.

(I don't know how to set up that link using the udev system, but imagine it can be done.)

  • Excellent hack, and it does work. Thanks. If nobody answers with an IDE configuration answer in a few days I'll accept this. – DS Justice Mar 26 '16 at 5:03
  • This is also very dynamic and will not do what you've asked for – ansi_lumen Mar 30 '16 at 14:47
  • Obviously this is a one-off hack and doesn't work on the next plug-in, but doing it from udev appears to work fine. – DS Justice Mar 29 '17 at 17:08
2

Think the other way.

If your device has a port name, that is not supported by the IDE, you can create an additional (static) symlink /dev/USBx that you can identify and select in the arduino IDE.

And yes, it is quite easy to make all of your arduinos unique to udev.

  • Thanks! Your link on how to flash a new serial number to an FTDI chip is very cool. Unfortunately, there's nothing similar for the (all-too-common) CH340 and PL2303 chips -- they have no onboard storage. – DS Justice Mar 29 '17 at 17:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.