I am using a usb device (zigbee stick) and want OpenHAB (smart Home system) to have access to it.
It uses the serial port (ttyACM0) and I am not sure how to forward the port. I can forward the usb device, but this seems to be something else.
I tried to forward the usb by lxc config device add iobroker CC2531 usb vendorid=0451
but as mentioned, this is not the same. It did not forward the serial port. I have the usb devices (lsusb) in the container, but not the serial port (sudo ls -la /dev/ttyACM* does not show the device).
Though for most of my own setups, I’ve just used unix-char and set the source to a /dev/serial/… path (one based on the device name to avoid issues with mutliple devices and ordering).
So I’m using the /dev/serial/by-id as the source path on the host to avoid potential renumbering and then give it a nice short descriptive name inside of the container.
I suppose the part “Zigbee_2531” or in your case “zigbee-modem” can be freely chosen.
Edit: I get an error here:
$ lxc config device add OpenHAB usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B000BE5ADB1-if00 unix-char mode=0666 gid=20 path=/dev/serial/Zigbee_2531
Error: Failed to start device "usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B000BE5ADB1-if00": The required device path doesn't exist and the major and minor settings are not specified
$ ls -lh /dev/serial/by-id
total 0
lrwxrwxrwx 1 root root 13 Dez 23 21:03 usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B000BE5ADB1-if00 -> ../../ttyACM0