Environment and settings
- Development OS: Linux
- IoT Edge device: An Raspberry running the raspOS
- Connection: USB device that can goes down or UP with frequency
The IoT Edge module uses the following CreateOptions configuration:
{
"HostConfig": {
"Privileged": true,
"Devices": [
{
"PathOnHost": "/dev/bus/usb",
"PathInContainer": "/dev/bus/usb",
"CgroupPermissions": "rwm"
}
]
}
}
Issue
The USB device binding is not persistent after device re-connections. While the
initial connection at startup works correctly, subsequent re-connections of the USB device
result in device path mismatches between the Rasoberry host and container.
Example
The container's lsusb shows the device as:
Bus 001 Device 052: ID 1fc9:012f NXP Semiconductors SE Blank 8QXP
Bus 001 Device 004: ID 0424:7800 Microchip Technology, Inc. (formerly SMSC)
Bus 001 Device 003: ID 0424:2514 Microchip Technology, Inc. (formerly SMSC) USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Microchip Technology, Inc. (formerly SMSC) USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Here, the Device is now 052
However, the container's /dev/bus/usb/001/
directory shows:
drwxr-xr-x 2 root root 140 Jul 18 08:09 .
drwxr-xr-x 3 root root 60 Jul 18 08:09 ..
crw-rw-r-- 1 root root 189, 0 Jul 18 08:09 001
crw-rw-r-- 1 root root 189, 1 Jul 18 08:09 002
crw-rw-r-- 1 root root 189, 2 Jul 18 08:09 003
crw-rw-r-- 1 root root 189, 3 Jul 18 08:09 004
crw-rw-r-- 1 root root 189, 41 Jul 18 08:09 042
Which was the original value when the container was started.
In tests where I directly deploy the container with privileged mode and volume binding everything goes well.
Has anyone encountered similar issue?