I have a RaberryPI 4B that is using USB to com to connect to several different devices.
In the module I set the device path to /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AR4V29H7-if00-port0
[09/24/2021 11:54:54] IoT Hub module client initialized.
Unhandled exception. System.AggregateException: One or more errors occurred. (Access to the port '/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AR4V29H7-if00-port0' is denied.)
If I list the serials by id on the PI:
ls -all /dev/serial/by-id/
total 0
drwxr-xr-x 2 root root 80 Sep 24 09:51 .
drwxr-xr-x 4 root root 80 Sep 22 11:18 ..
lrwxrwxrwx 1 root root 13 Sep 22 11:18 usb-FTDI_FT232R_USB_UART_A10KNILF-if00-port0 -> ../../ttyUSB1
lrwxrwxrwx 1 root root 13 Sep 24 09:51 usb-FTDI_FT232R_USB_UART_AR4V29H7-if00-port0 -> ../../ttyUSB0
when I change the path in the Module configration to /dev/ttyUSB0 the module works fine
I have made a list of all USB ports in use
dmesg | grep ttyUSB
[ 5.040679] usb 1-1.3: FTDI USB Serial Device converter now attached to ttyUSB0
[ 5.052120] usb 1-1.4: FTDI USB Serial Device converter now attached to ttyUSB1
[ 2323.926913] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[ 2326.687215] usb 1-1.1: FTDI USB Serial Device converter now attached to ttyUSB0
looking up the ttyusb in the /dev/ directory i find
crw-rw-rw- 1 root dialout 188, 0 Sep 24 09:51 /dev/ttyUSB0
crw-rw-rw- 1 root dialout 188, 1 Sep 22 11:18 /dev/ttyUSB1
I noticed the the ttyUSB* belong to an other group then the serial ports found in /dev/serial/by-id.
I don’t understand why the code in module can not access the /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AR4V29H7-if00-port0.
Is there a setting of container create option to give the docker or the docker container access to /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AR4V29H7-if00-port0?
Regards
Michiel van Buuren