itsmepetrov / homebridge-zigbee

ZigBee Platform plugin for HomeBridge
https://itsmepetrov.github.io/homebridge-zigbee/
MIT License
106 stars 36 forks source link

homebridge-zigbee in Docker = stuck on platform initialization #34

Closed mrdc closed 4 years ago

mrdc commented 5 years ago

Hello,

The plugin works fine but it fails to work in Docker: in logs the plugin is stuck at platform initialization. Docker container is started with the following arguments: "docker run -t -i -d --device=/dev/ttyACM0 --restart=always --net=host" I see ttyACM0 in /dev in container (port is in homebridge-zigbee settings), so it should be accessible to homebridge-zigbee. When I make auto port discovery homebridge-zigbee fails to access serial port.

Without Docker: [2019-5-11 15:56:34] [ZigBee] Initializing ZigBeePlatform platform... [2019-5-11 15:56:34] [ZigBee] ZigBee platform initialization [2019-5-11 15:56:45] [ZigBee] Retrying connect to hardware [2019-5-11 22:58:34] [ZigBee] Retrying connect to hardware [2019-5-11 22:58:41] [ZigBee] Retrying connect to hardware [2019-5-11 22:58:48] [ZigBee] Retrying connect to hardware [2019-5-11 22:58:56] [ZigBee] Retrying connect to hardwaree [2019-5-11 22:59:02] [ZigBee] ZigBee platform initialized, info: [2019-5-11 22:59:02] [ZigBee] ------------------------------------ [2019-5-11 22:59:02] [ZigBee] channel: 11 [2019-5-11 22:59:02] [ZigBee] pan id: 0x19d2 [2019-5-11 22:59:02] [ZigBee] extended pan id: 0xdddddddddddddddd [2019-5-11 22:59:02] [ZigBee] ieee address: 0x0xxxxxxxxxxxxxxx [2019-5-11 22:59:02] [ZigBee] nwk address: 0 [2019-5-11 22:59:02] [ZigBee] firmware version: 2.6.3 [2019-5-11 22:59:02] [ZigBee] firmware revision: 2018090201 [2019-5-11 22:59:02] [ZigBee] ------------------------------------

In Docker: [2019-5-11 16:23:01] [ZigBee] Initializing ZigBeePlatform platform... [2019-5-11 16:23:01] [ZigBee] ZigBee platform initialization and it stays like this forever.

mrdc commented 5 years ago

Problem is caused by LibreELEC: a user (root) which runs Docker, has no access to dialout group and it's not possible to add root to dialout :/

xiwenc commented 4 years ago

See a workaround at https://github.com/itsmepetrov/homebridge-zigbee/issues/26#issuecomment-518745735

Tom41234 commented 4 years ago

Did you ever fix the issue? It seems I have the same problem...

mrdc commented 4 years ago

See a workaround at #26 (comment)

So, you've managed to use homebridge-zigbee in Docker on LibreELEC?

mrdc commented 4 years ago

Did you ever fix the issue? It seems I have the same problem...

Haven't tried after a lot of time was spent to solve the issue.

mrdc commented 4 years ago

Did you ever fix the issue? It seems I have the same problem...

@Tom41234

User which runs Docker in LibreELEC should be added to dialoutin /etc/group. The tricky part is that LibreELEC is on squashfs, so files on it can't be easily edited, but it's not hard.

itsmepetrov commented 4 years ago

@mrdc @Tom41234 @xiwenc you can try my own instruction: https://gist.github.com/itsmepetrov/59fbff4a975b990fd1b0dcc445ca9542

mrdc commented 4 years ago

Thanks! It fixes the issue.