My device (connected to USB-A port on a laptop):
/dev/ttyACM0
more info about device (it’s a self build drone for a hobby project):
udevadm info -a -n /dev/serial/by-id/usb-ArduPilot_FlywooF745_220026000851323232393431-if00
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/tty/ttyACM0':
KERNEL=="ttyACM0"
SUBSYSTEM=="tty"
DRIVER==""
ATTR{power/control}=="auto"
ATTR{power/runtime_active_time}=="0"
ATTR{power/runtime_status}=="unsupported"
ATTR{power/runtime_suspended_time}=="0"
looking at parent device '/devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0':
(etc)
I followed this recommendation to create a udev rule, to allow access to the device via a Toolbox container:
/etc/udev/rules.d/50-usb-serial.rules
:
SUBSYSTEM=="ttyACM0", SUBSYSTEMS=="tty", OWNER="${USER}"
EOF
On the host, the device user/group now looks like:
ls -l /dev/ttyACM0
:
crw-rw----. 1 root dialout 166, 0 5 aug 16:16 /dev/ttyACM0
Inside the container:
crw-rw----. 1 nobody nobody 166, 0 Aug 5 16:16 /dev/ttyACM0
Still I do not seem to have access.
In the guide, instead of nobody/nobody, it shows nobody/dialout for the container. The guide may be outdated.
This post says you have to do one more thing. But that first command to get the ID from within the container, does not work for me.
sg dialout -c 'sleep 1000'
Password:
sg: failed to crypt password with previous salt: Invalid argument
I feel like I am really close… (as a bit of a noob) but just not there yet… Any help would be greatly appreciated!