zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

Zigbee2mqtt on Proxmox (LXC)

Open Ramshield opened this issue 5 years ago • 9 comments

What happened

Hi,

Last week I messed up my server and have to rebuild all my LXC containers. So I decided to try this on Proxmox in stead of plain Debian.

After some trouble getting the passthrough to LXC to work I got Zigbee2mqtt running. However when trying to (re-)pair a device, nothing happens. Messed around with it for couple more days, and I tried it on a Virtualbox VM, on my Windows PC, which works instantly. So I tried running Zigbee2mqtt on the Proxmox server itself. Nothing happens again... So nothing is wrong with the USB, or Zigbee2mqtt, because I do everything exactly the same according to the guide. The issue seems to be in Proxmox...

I did a tail -f * in /var/log but nothing from apparmor or any other kernel message happen.

Has anyone have Zigbee2mqtt working on Proxmox or in a Proxmox LXC container?

Thank you!

Logs: https://pastebin.com/vzjqcgDy Zigbee-herdsman and log_level: debug logs: https://pastebin.com/F11VEy3M

Debug info

Zigbee2MQTT version: 1.18.3 (commit #f2e39af1) Adapter hardware: CC2652R Adapter firmware version: CC2652R_coordinator_20210120 Proxmox 6.4-4

Ramshield avatar May 07 '21 17:05 Ramshield

Try this:

https://www.martinellis.me/posts/2020/03/zig-a-zig-ah/

juslex avatar May 09 '21 03:05 juslex

Has anyone have Zigbee2mqtt working on Proxmox or in a Proxmox LXC container?

Runs fine as a unprivileged Proxmox LXC container with Conbee II Zigbee stick connected to Proxmox host here.

  1. Debian 10 inside unprivileged LXC
  2. Proxmox host: /etc/udev/rules.d/99-ttyACM-rw.rules Purpose: make persistant device name /dev/ttyACMZigbee and make sure its writable (mode=0666).
# ID 1cf1:0030 Dresden Elektronik ConBee II
# make Z-Wave stick RW for others, so that container can access it
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1cf1", ATTRS{idProduct}=="0030", SYMLINK+="ttyACMZigbee", MODE="0666"
  1. Proxmox host: add to LXC config /etc/pve/nodes/pve1/lxc/111.conf
lxc.cgroup.devices.allow: c 189:* rwm
lxc.mount.entry: /dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2414690-if00 dev/ttyACMZigbee none bind,optional,create=file
  1. LXC container: Install Z2M as described here https://www.zigbee2mqtt.io/getting_started/running_zigbee2mqtt.html
  2. LXC container: Use /dev/ttyACMZigbee in Z2M config /opt/zigbee2mqtt/data/configuration.yaml
serial:
  adapter: deconz
  port: /dev/ttyACMZigbee

AlexKay88 avatar May 28 '21 08:05 AlexKay88

Thanks @AlexKay88 I figured out the problem. If I have ANY other USB device in it, it won't work. No clue why or how, but removing the devices and I can learn new devices again.

Ramshield avatar May 28 '21 11:05 Ramshield

If I have ANY other USB device in it, it won't work.

I have a Z-Wave USB stick connected and mapped to same LXC container without a problem.

AlexKay88 avatar May 28 '21 13:05 AlexKay88

If I have ANY other USB device in it, it won't work.

I have a Z-Wave USB stick connected and mapped to same LXC container without a problem.

I got 2 HDD's, a broadlink, RFlink and RIPE probe USB. This all on an Intel NUC. Worked before with the same devices though, and now all of the sudden it doesn't...

Ramshield avatar May 28 '21 14:05 Ramshield

@juslex @AlexKay88 so I found the actual problem. I recently bought a couple Philips Hue lights and was messing around. Then I plugged my external HDD's back in, and encountered this error: MAC channel access failure' (225)) I searched this and found this Github issue: https://github.com/Koenkk/Z-Stack-firmware/issues/240 So somehow external HDD's cause interference. I placed my Zigbee USB device on a USB external and moved the external HDD's back a bit, and it works again!

Ramshield avatar Jun 07 '21 21:06 Ramshield

Hello,

Which template is the best to use Zigbee2Mqtt in LXC container ? I try with Alpine but I can't install. It's OK with Ubuntu template

Regards

seb49 avatar Aug 18 '22 08:08 seb49

@seb49 I use Debian 11 for this. I don't have the specific template name, but latest Debian 11 should work.

Ramshield avatar Aug 18 '22 15:08 Ramshield

You can use this here

https://github.com/tteck/Proxmox

juslex avatar Aug 18 '22 15:08 juslex