I was trying to solve my problem looking at other threads such as Why My USB port fixing udev rules are not working and udev rules doesn't work with small number among other several posts regarding udev rules but none of the posts I've checked is helping me to find out why I'm experiencing this issue.
udev rule with bInterfaceNumber doesn't work is a very very similar problem to the one I have, essentially the same, but it doesn't have an answer since 2013 and I think is forgotten by now.
I have the following rules that work perfectly:
SUBSYSTEM=="tty", SUBSYSTEMS=="usb-serial", DRIVERS=="mos7840", ATTRS{port_number}=="0", SYMLINK+="USB-RS232-0", MODE="0777"
SUBSYSTEM=="tty", SUBSYSTEMS=="usb-serial", DRIVERS=="mos7840", ATTRS{port_number}=="1", SYMLINK+="USB-RS232-1", MODE="0777"
SUBSYSTEM=="tty", SUBSYSTEMS=="usb-serial", DRIVERS=="ftdi_sio", ATTRS{port_number}=="0", SYMLINK+="USB-TTL-0", MODE="0777"
The problem is that I have 2 devices that are the same and the only difference between the attributes of the two is the serial number, they even have the same VID/PID, therefore I need to add ATTRS{serial} to the rules to end up having:
SUBSYSTEM=="tty", SUBSYSTEMS=="usb-serial", DRIVERS=="mos7840", ATTRS{port_number}=="0", SYMLINK+="USB-RS232-0", MODE="0777"
SUBSYSTEM=="tty", SUBSYSTEMS=="usb-serial", DRIVERS=="mos7840", ATTRS{port_number}=="1", SYMLINK+="USB-RS232-1", MODE="0777"
SUBSYSTEM=="tty", SUBSYSTEMS=="usb-serial", DRIVERS=="ftdi_sio", ATTRS{port_number}=="0", ATTRS{serial}=="AFYS1HLQ", SYMLINK+="USB-TTL-0", MODE="0777"
SUBSYSTEM=="tty", SUBSYSTEMS=="usb-serial", DRIVERS=="ftdi_sio", ATTRS{port_number}=="0", ATTRS{serial}=="FTV8IUSR", SYMLINK+="USB-TTL-1", MODE="0777"
So after adding ATTRS{serial} to the two last rules then both stop working.
Why is this?
Thanks!!