Eu tenho board com CP2105. É uma ponte usb-to-serial com duas interfaces uart em uma porta usb. Eu li alguns guias e documentação de UDEV, mas estou preso na criação de links simbólicos para eles. Eu quero que eles tenham um ID serial no nome. O problema é que ele não funciona, mesmo com regras simples.
Minha regra, isso deve fazer o que eu quero:
ACTION=="add", SUBSYSTEM=="tty", \
ATTR{idVendor}=="10c4", ATTR{idProduct}=="ea70",
ENV{ID_MODEL}=="CP2105_Dual_USB_to_UART_Bridge_Controller", \
SYMLINK+="CP2105$env{ID_USB_INTERFACE_NUM}-$env{ID_SERIAL_SHORT}"
Tentativa mais simples, que deve adicionar dois links simbólicos com números diferentes no final:
ACTION=="add", SUBSYSTEM=="tty", ATTR{idVendor}=="10c4", ATTR{idProduct}=="ea70", SYMLINK+="CP2105%n"
Eu também tenho uma regra, que funciona, mas faz outra coisa (impede que algum outro driver grave no dispositivo):
SUBSYSTEM=="usb", ATTR{idVendor}=="10c4", ATTR{idProduct}=="ea70", ENV{ID_MM_DEVICE_IGNORE}="1"
Minha saída de informações do udevadm para o primeiro dispositivo:
udevadm info -q all /dev/ttyUSB0
P: /devices/pci0000:00/0000:00:14.0/usb3/3-5/3-5.3/3-5.3:1.0/ttyUSB0/tty/ttyUSB0
N: ttyUSB0
S: serial/by-id/usb-Silicon_Labs_CP2105_Dual_USB_to_UART_Bridge_Controller_0087144E-if00-port0
S: serial/by-path/pci-0000:00:14.0-usb-0:5.3:1.0-port0
E: DEVLINKS=/dev/serial/by-path/pci-0000:00:14.0-usb-0:5.3:1.0-port0 /dev/serial/by-id/usb-Silicon_Labs_CP2105_Dual_USB_to_UART_Bridge_Controller_0087144E-if00-port0
E: DEVNAME=/dev/ttyUSB0
E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb3/3-5/3-5.3/3-5.3:1.0/ttyUSB0/tty/ttyUSB0
E: ID_BUS=usb
E: ID_MM_CANDIDATE=1
E: ID_MODEL=CP2105_Dual_USB_to_UART_Bridge_Controller
E: ID_MODEL_ENC=CP2105\x20Dual\x20USB\x20to\x20UART\x20Bridge\x20Controller
E: ID_MODEL_FROM_DATABASE=CP210x UART Bridge
E: ID_MODEL_ID=ea70
E: ID_PATH=pci-0000:00:14.0-usb-0:5.3:1.0
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_5_3_1_0
E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
E: ID_PCI_INTERFACE_FROM_DATABASE=XHCI
E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller
E: ID_REVISION=0100
E: ID_SERIAL=Silicon_Labs_CP2105_Dual_USB_to_UART_Bridge_Controller_0087144E
E: ID_SERIAL_SHORT=0087144E
E: ID_TYPE=generic
E: ID_USB_DRIVER=cp210x
E: ID_USB_INTERFACES=:ff0000:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=Silicon_Labs
E: ID_VENDOR_ENC=Silicon\x20Labs
E: ID_VENDOR_FROM_DATABASE=Cygnal Integrated Products, Inc.
E: ID_VENDOR_ID=10c4
E: MAJOR=188
E: MINOR=0
E: SUBSYSTEM=tty
E: TAGS=:systemd:
E: USEC_INITIALIZED=5571337818
E o segundo:
udevadm info -q all /dev/ttyUSB1
P: /devices/pci0000:00/0000:00:14.0/usb3/3-5/3-5.3/3-5.3:1.1/ttyUSB1/tty/ttyUSB1
N: ttyUSB1
S: serial/by-id/usb-Silicon_Labs_CP2105_Dual_USB_to_UART_Bridge_Controller_0087144E-if01-port0
S: serial/by-path/pci-0000:00:14.0-usb-0:5.3:1.1-port0
E: DEVLINKS=/dev/serial/by-path/pci-0000:00:14.0-usb-0:5.3:1.1-port0 /dev/serial/by-id/usb-Silicon_Labs_CP2105_Dual_USB_to_UART_Bridge_Controller_0087144E-if01-port0
E: DEVNAME=/dev/ttyUSB1
E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb3/3-5/3-5.3/3-5.3:1.1/ttyUSB1/tty/ttyUSB1
E: ID_BUS=usb
E: ID_MM_CANDIDATE=1
E: ID_MODEL=CP2105_Dual_USB_to_UART_Bridge_Controller
E: ID_MODEL_ENC=CP2105\x20Dual\x20USB\x20to\x20UART\x20Bridge\x20Controller
E: ID_MODEL_FROM_DATABASE=CP210x UART Bridge
E: ID_MODEL_ID=ea70
E: ID_PATH=pci-0000:00:14.0-usb-0:5.3:1.1
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_5_3_1_1
E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
E: ID_PCI_INTERFACE_FROM_DATABASE=XHCI
E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller
E: ID_REVISION=0100
E: ID_SERIAL=Silicon_Labs_CP2105_Dual_USB_to_UART_Bridge_Controller_0087144E
E: ID_SERIAL_SHORT=0087144E
E: ID_TYPE=generic
E: ID_USB_DRIVER=cp210x
E: ID_USB_INTERFACES=:ff0000:
E: ID_USB_INTERFACE_NUM=01
E: ID_VENDOR=Silicon_Labs
E: ID_VENDOR_ENC=Silicon\x20Labs
E: ID_VENDOR_FROM_DATABASE=Cygnal Integrated Products, Inc.
E: ID_VENDOR_ID=10c4
E: MAJOR=188
E: MINOR=1
E: SUBSYSTEM=tty
E: TAGS=:systemd:
E: USEC_INITIALIZED=5570324399
Alguém pode ajudar?