cflurin / xiaomi-mqtt

A Bridge between the Xiaomi Mi Smart Home Gateway and the Mqtt broker.
Apache License 2.0
50 stars 14 forks source link

Can you add a dockerfile support? #8

Open poldim opened 5 years ago

poldim commented 5 years ago

I tried to get this to run inside my NR docker container, unfortunately, no luck. I installed it via npm install -g xiaomi-mqtt, configured the config.json file in the correct location, and then when trying to start it get the following error

root@f721092fe948:/usr/src/node-red# xm
[16:14:12] INFO Start xiaomi-mqtt, version 0.4.0
[16:14:12] INFO clientId = xiaomi-mqtt_ec5e6391
[16:14:12] INFO Start a UDP server, listening on port 9898
dgram.js:615
    throw errnoException(err, 'addMembership');
    ^

Error: addMembership EINVAL
    at _errnoException (util.js:992:11)
    at Socket.addMembership (dgram.js:615:11)
    at Socket.<anonymous> (/usr/local/lib/node_modules/xiaomi-mqtt/index.js:55:10)
    at emitNone (events.js:111:20)
    at Socket.emit (events.js:208:7)
    at startListening (dgram.js:156:10)
    at _handle.lookup (dgram.js:273:7)
    at _combinedTickCallback (internal/process/next_tick.js:141:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:695:11)
mikeS7 commented 5 years ago

Use --network=host option on run container

maxi1134 commented 5 years ago

Hi there, I'm having the same issue running it on a non-docker machine. Nothing is using the port, And I've even tried with a 9897 instead. Any idea? I also disabled the firewall

cflurin commented 5 years ago

@maxi1134, Please open a new issue, this has nothing to do with docker. And post your log