2

I have a couple of USB radios (one ZigBee, one Z-wave) that are currently located at /dev/ttyACM0 and /dev/ttyACM1, respectively.

When I reboot, they are randomly assigned, rendering my home automation systems non-functional (until I manually change the designations in the config files).

I've set up a few USB storage in /etc/fstab using their UUID, is there a way to do something similar for the USB radios? From a bit of googling, and looking through this forum, I found their unique identifier (ls -la /dev/serial/by-id/), but I'm not sure what to do with it.

I'm using Ubuntu Server 18.04 LTS.

2
  • Great thanks! I've gone the first route (the /dev/serial/by-id/long_id way), it seemed simplest, given my setup. I just had to add that in my docker-compose, and in one "master-file" that is references by all other files needing that info. @mosvy, if you make it an answer, I'll accept it, it might be easier for other people googling through this page?
    – Aephir
    Commented Oct 6, 2019 at 10:54
  • I've turned my comments into an answer -- this Q is probably a duplicate, but I'm too lazy and quite inept at googling ;-)
    – user313992
    Commented Oct 6, 2019 at 18:53

1 Answer 1

4

You can use the /dev/serial/by-id/long-garbage directly instead of /dev/ttyACM0; it's a symlink to the corresponding device.

You can also make your a symlink with your preferred name by adding a udev rule in one of the files inside /etc/udev/rules.d; eg.

SUBSYSTEM=="tty", ... other conditions ..., SYMLINK+="ttyZigBee"

for a /dev/ttyZigBee symlink. (notice the difference between == and =).

You can check with udevadm info -a /dev/ttyACM0 what attributes you can match on.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .