Raspberry Pi - Make serial USB ports persistent via symlinks

Intended behavior:

This is how it looks on my VM (Debian Buster)

ls -al /dev | grep tty
lrwxrwxrwx   1 root       root           7 Dez 24 10:57 CC2531 -> ttyACM0
crw-rw----   1 root       dialout 166,   0 Jan  2 11:45 ttyACM0
crw-rw----   1 root       dialout 166,   1 Jan  2 11:45 ttyACM1
lrwxrwxrwx   1 root       root           7 Dez 23 12:17 ZWAVEUZB -> ttyACM1

grafik

How come I cant see my symlinks in Habadmin? This has never worked for me :frowning:

Good question :grinning:

Maybe my udev rule does help?

#Zigbee Stick CC2531
SUBSYSTEM=="tty", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="16a8", ATTRS{serial}=="__0X00124B001949FDC4", SYMLINK+="CC2531"
#Zwave Stick UZB
SUBSYSTEM=="tty", ATTRS{idVendor}=="0658", ATTRS{idProduct}=="0200", ATTRS{serial}=="12345678-9012-3456-7890-123456789012", SYMLINK+="ZWAVEUZB"

To find the correct attributes you should use

udevadm info --name=/dev/ttyACM0 --attribute-walk

The only difference is, that you use the ATTRS{serial}, and I dont. The ATTRS{serial} option is only needed, when the idVendore and the idProduct is the same, (ie if you have two of the same idĀ“s).

This is my symlinks:

SUBSYSTEM=="tty", ATTRS{idVendor}=="0658", ATTRS{idProduct}=="0200", SYMLINK+="ttyUSB-ZStick", GROUP="dialout", MODE="0666"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="ttyUSB-RS485", GROUP="dialout", MODE="0666"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2838", SYMLINK+="ttyUSB-DVBT", GROUP="dialout", MODE="0666"

Notice all idĀ“s are different, which is why I dont need to set the ATTRS{serial}.
Also notice, I use Group ā€œdialoutā€ and Mode ā€œ0666ā€. IĀ“m not sure if these are actually required.

It does not help both of us if you tell me that my working config is wrong :sunglasses:

I dont (or I didnt mean to)ā€¦
What I meant is, that the differences between your config and my config, shouldnt do any harm, as far as I know. Both should workā€¦ Yours work. Thats the factā€¦ Mine doesnt. Thats another fact :frowning:

1 Like

I would try removing the dash after USB and remove the permission stuff.

1 Like

I will give it a shot later and play abit with itā€¦ But if this is really the cause, there are some threads in this forum which needs an update :slight_smile:

HMPRF!!
I did as you suggested, and now I have the symlinks available in PaperUIā€¦ And even more, it seems like itĀ“s working as well. I change the bridge setting of my RS845 USB dongle for my Nilan modbus serial connection. And it works as well, (after a new restart of openhab).
This is strangeā€¦

For Linux related topics (apart from the openHAB directly related commands) I donā€™t usually check this forum :sunglasses:

Good :grinning:
Make sure after a system restart it still works :heart_eyes:

Well I did search through Google for Linux (symlinks) topics as well. Thats there I found that the ATTRS{serial} is only required if the ids are equalā€¦ :slight_smile:

Yeah, thats what I didā€¦ First I changed the symlinks, then I rebooted. And my RS485 didnt workā€¦ Then I changed the things config of the RS485 to use the symlink and restarted OH. The RS485 went straight onlineā€¦

I appreciate this is an old thread but I have a question.

Iā€™ve set up the symlinks as very helpfully described above and it works - hooray! I now have a permanent USB port called /dev/ttyUSB-Enocean to attach my Encocean dongle to.

But I also get another Enocean dongle appearing in my inbox attached to /dev/ttyUSB0. If I delete it it reappears. I guess itā€™s not a problem if I ignore it but itā€™s untidy, which offends me and Iā€™m not sure itā€™s normal.

It doesnā€™t seem to happen with my Z-wave stick but that might be because Iā€™ve not added a z-wave device for a while.

Does anyone else have this issue?