UDEV rules for zigbee controller

Hi all,

Maybe this can be usefull for someone (or even can be added to docs).

If you do not want to rely on the device names assignment by Linux kernel this is a way how make it stable forever. It will survive also USB port switching.

Based on Raspbian running at RPI4.

You need to create new file for UDEV daemon, eg. /etc/udev/rules.d/99-usb-serial.rules
And inside put following rules. I have them for CC2531 and CC1352P:

# TI CC2531 Stick (Zigbee)
KERNEL=="ttyACM*", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="16a8", MODE="0666", SYMLINK+="usbzigbee"
# TI CC1353R Devboard (Zigbee)
KERNEL=="ttyACM*", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="bef3", ENV{ID_USB_INTERFACE_NUM}=="00", MODE="0666", SYMLINK+="usbzigbee3"

The ENV part on last line is important as the CC1352P is visible as two serial devices and we are interested just in the first one :slight_smile:
By MODE set to 0666 you make it a bit dangerous and available for every RPI user but on the other hand there are no longer any issues with privileges.

Then restart is needed !
You can play with udev reload etc. but restart is sure and easy way.

And how it looks then in /dev then:

crw-rw-rw-  1 root dialout 166,   0 Feb  2 11:09 ttyACM0
crw-rw-rw-  1 root dialout 166,   1 Feb  2 11:01 ttyACM1
crw-rw----  1 root dialout 166,   2 Feb  2 11:01 ttyACM2
crw-rw-rw-  1 root dialout 166,   3 Feb 10 14:54 ttyACM3
crw-rw----  1 root dialout 204,  64 Feb  2 10:05 ttyAMA0
crw-------  1 root root      5,   3 Feb  2 10:05 ttyprintk
crw-rw----  1 root dialout   4,  64 Feb  2 10:05 ttyS0
crw-------  1 root root     10, 239 Feb  2 10:05 uhid
crw-------  1 root root     10, 223 Feb  2 10:05 uinput
crw-rw-rw-  1 root root      1,   9 Feb  2 10:05 urandom
drwxr-xr-x  2 root root          80 Feb  2 11:09 usb
lrwxrwxrwx  1 root root           7 Feb  2 11:09 usbzigbee -> ttyACM0
lrwxrwxrwx  1 root root           7 Feb  2 11:01 usbzigbee3 -> ttyACM1
lrwxrwxrwx  1 root root           7 Feb  2 11:01 usbzwave -> ttyACM3