Nick4
(Nick)
June 29, 2021, 5:09pm
1
The title says it pretty much: I am struggling to get this working.
I have (I think) succeeded in the pass-through of the USB port (first time I do/need this) to the container since I can see the same device/port as well in the hypervisor as in the container.
Strange thing though: the device number keeps changing.
Any help is greatly appreciated!
tteck
(π©π©πππ π¨π©ππ§)
July 11, 2021, 11:16pm
3
Map it by id
/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE*****-if00
1 Like
Nick4
(Nick)
July 12, 2021, 8:18am
4
Hi @tteck , thanks for helping!
Does a USB device automatically show as serial?
tteck
(π©π©πππ π¨π©ππ§)
July 12, 2021, 12:42pm
5
Depends on the device.
Zigbee coordinators have a USB-to-Serial/UART chip on board.
What are you using USB pass-through for? zigbee2mqtt? or something else?
Nick4
(Nick)
July 12, 2021, 10:53pm
7
Donβt know if this is normal: I donβt have a /dev/serial folder.
With lsusb I can see the device and the ID in proxmox but have not found on how to go from there to map the device by ID.
tteck
(π©π©πππ π¨π©ππ§)
July 12, 2021, 11:02pm
8
Run this in the Proxmox shell to open ports in the lxc. Be sure to change the lxc id
bash -c β$(wget -qLO - https://github.com/tteck/proxmox_z2m_lxc/raw/master/open_port.sh )β -s 102
(change 102 to your lxc id)
edit: reboot the lxc after running the script
1 Like
tteck
(π©π©πππ π¨π©ππ§)
July 12, 2021, 11:06pm
9
Then run
ls -l /dev/serial/by-id
In the lxc console after a reboot
1 Like
Nick4
(Nick)
July 13, 2021, 9:34am
10
Thanks again for your help @tteck !
I had the stick in a RPi until now.
It was autodetected in Proxmox, visible by device and ID.
Executed your script, inserted the stick and rebooted.
ls -l /dev/serial/
ls: cannot access '/dev/serial/': No such file or directory
Can this be related that I disabled things I donβt use in the BIOS?
Nick4
(Nick)
July 13, 2021, 4:45pm
11
@tteck : the serial ports were disabled, I have turned them on and in the Proxmox shell I have now the USB stick as a serial device
lrwxrwxrwx 1 root root 13 Jul 13 18:39 usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2437849-if00 β β¦/β¦/ttyACM0
but not in the HA lxc
Nick4
(Nick)
July 15, 2021, 6:59pm
12
Anyone who can give me some pointers for this?
I have searched here, the Proxmox forum and the web but maybe Iβm searching with the wrong keywords.
Thanks in advance!
tteck
(π©π©πππ π¨π©ππ§)
July 15, 2021, 7:12pm
13
In the Proxmox shell run cat /etc/pve/lxc/104.conf
Where 104
is replace with your lxc id
post your findings here, so we can find a solution
1 Like
Nick4
(Nick)
July 15, 2021, 7:22pm
14
cat /etc/pve/lxc/116.conf
#172.16.0.5
#- HA
arch: amd64
cores: 2
hostname: v-hass
memory: 512
nameserver: 172.16.0.3
net0: name=eth0,bridge=vmbr0,firewall=1,gw=172.16.0.1,hwaddr=7A:3B:51:A7:D2:4F,ip=172.16.0.5/24,type=veth
onboot: 1
ostype: debian
parent: OK_2021_6bis
rootfs: local-zfs:subvol-116-disk-0,size=5G
swap: 512
unprivileged: 1
lxc.cgroup.devices.allow: c 189:1 rwm
lxc.mount.entry: /dev/bus/usb/001/004 dev/bus/usb/001/004 none bind,optional,create=file
Thanks @tteck !
tteck
(π©π©πππ π¨π©ππ§)
July 15, 2021, 7:28pm
15
Replace the last three lines with
lxc.cgroup.devices.allow: c 188:* rwm
lxc.mount.entry: /dev/serial/by-id dev/serial/by-id none bind,optional,create=dir
lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file
Reboot the lxc and see if you can see the device.
1 Like
Nick4
(Nick)
July 15, 2021, 7:34pm
16
Can it be βthe last 2 linesβ?
tteck
(π©π©πππ π¨π©ππ§)
July 15, 2021, 7:35pm
17
I donβ know if it needs to be privileged or not. Try it unprivileged and see.
Nick4
(Nick)
July 15, 2021, 7:55pm
18
YESSS!
Only (donβt know if this matters) is owned by nobody/nogroup.
So now I was looking to add the deCONZ integration and it still seems that I can only select a remote gateway.
tteck
(π©π©πππ π¨π©ππ§)
July 15, 2021, 7:59pm
19
I know nothing about deCONZ. Sorry
Nick4
(Nick)
July 15, 2021, 8:02pm
20
No problem, you got me a lot further!
Just to be sure, is this the right output?
ls -l /dev/serial/by-id/
total 0
lrwxrwxrwx 1 nobody nogroup 13 Jul 15 21:37 usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DExxxxxxx-if00 -> ../../ttyACM0