Zigbee2mqtt: Socat in Docker

Created on 14 Feb 2019  路  9Comments  路  Source: Koenkk/zigbee2mqtt

Hi Koenkk,

Would it be possible to add Socat to the zigbee2mqtt container? I tried passing the virtual USB port into the container but zigbee2mqtt wasn't able to access it.

Followed the instructions from this how-to: https://www.zigbee2mqtt.io/how_tos/how_to_esp8266_with_cc2530.html

Thanks.

stale

Most helpful comment

I would rather prefer to have this Dockerfile in the zigbee2mqtt repo. In this way it can be updated automatically.

All 9 comments

You might want to check out my docker image which I'm using for exactly this:

https://hub.docker.com/r/forepe/zigbee2mqtt-socat

Thank you! I'll give it a try.

@peterforeman can you do a pull request to add your image link to docs?
Btw headline says zigbee2mqtt with socat for remote zwave
Can you change it to zigbee

I would rather prefer to have this Dockerfile in the zigbee2mqtt repo. In this way it can be updated automatically.

Thanks @peterforeman for sharing your docker image. I was able to get it up and running pretty easily. I was a little stuck on where to set the Socat options, but a little digging around, I found that it is meant to be set in the environmental variables.

@JLFN - My cc2530 is plugged into an old Rpi2 running ser2net which acts as the USB host. Zigbee2mqtt/Socat is running in a docker container on top of Ubuntu 18 in a VM.

I agree with @Koenkk also. Would prefer to have socat added to the zigbee2mqtt repo for easy maintainability.

Well, adding it should not really be a problem. The real "problem" lies in that docker, by nature, is only meant to run 1 process. So you need to run a sort-of supervisor script which monitors socat as well as zigbee2mqtt. My container does this, but this is very much different from a clean and simple docker container as the current zigbee2mqtt container is, which simply runs 1 process. I'm not really charmed by how it's solved now, although I do not know how to do this any other way.

Do you have any ideas how to implement this more cleanly? I would love to implement it!

And: zigbee2mqtt does not exist when a failure happens, for example:

 zigbee2mqtt:error 2019-2-17 10:45:02 Failed to start
    {"message":"request timeout","stack":"Error: request timeout\n    at CcZnp.<anonymous> (/app/node_modules/cc-znp/lib/ccznp.js:255:22)\n    at Object.onceWrapper (events.js:315:30)\n    at emitOne (events.js:116:13)\n    at CcZnp.emit (events.js:211:7)\n    at Timeout.<anonymous> (/app/node_modules/cc-znp/lib/ccznp.js:234:18)\n    at ontimeout (timers.js:498:11)\n    at tryOnTimeout (timers.js:323:5)\n    at Timer.listOnTimeout (timers.js:290:5)"}

This prevents a proper restart of the container as well. But this is a separate issue.

Would it be possible to run the socat in a separate container?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Did this get anywhere?

I'm quite interested in having this run under my HASS.io instead of on my machine natively...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sylarevan picture sylarevan  路  5Comments

tb-killa picture tb-killa  路  3Comments

jeroenterheerdt picture jeroenterheerdt  路  3Comments

LCerebo picture LCerebo  路  3Comments

andreasbrett picture andreasbrett  路  3Comments