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

Wont start #3

Closed iChUdY closed 6 years ago

iChUdY commented 6 years ago

Hello,

i try this bridge and get this log on start:

Linux raspberrypi 4.9.80-v7+ #1098 SMP Fri Mar 9 19:11:42 GMT 2018 armv7l

The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Sun Apr 15 18:07:45 2018 from 192.168.0.80

pi@raspberrypi:~ $ xm [18:26:46] INFO Start xiaomi-mqtt, version 0.3.3 [18:26:46] INFO clientId = xiaomi-mqtt_befd42f4 [18:26:46] ERROR msg - Unable to send data, stack - Error [ERR_SOCKET_CANNOT_SEND]: Unable to send data at Socket.onListenError (dgram.js:362:22) at Object.onceWrapper (events.js:315:30) at emitOne (events.js:121:20) at Socket.emit (events.js:211:7) at _handle.lookup (dgram.js:267:14) 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:686:11) at startup (bootstrap_node.js:187:16) at bootstrap_node.js:608:3 [18:26:46] ERROR msg - bind EADDRINUSE 0.0.0.0:9898, stack - Error: bind EADDRINUSE 0.0.0.0:9898 at Object._errnoException (util.js:1022:11) at _exceptionWithHostPort (util.js:1044:20) at _handle.lookup (dgram.js:266:18) 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:686:11) at startup (bootstrap_node.js:187:16) at bootstrap_node.js:608:3 dgram.js:637 throw new errors.Error('ERR_SOCKET_DGRAM_NOT_RUNNING'); ^

Error [ERR_SOCKET_DGRAM_NOT_RUNNING]: Not running at Socket._healthCheck (dgram.js:637:11) at Socket.close (dgram.js:515:8) at Socket. (/usr/local/lib/node_modules/xiaomi-mqtt/index.js:135:10) at emitOne (events.js:121:20) at Socket.emit (events.js:211:7) at _handle.lookup (dgram.js:267:14) 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:686:11) at startup (bootstrap_node.js:187:16) pi@raspberrypi:~ $

cflurin commented 6 years ago

It seems port 9898 is already used.

ERROR msg - bind EADDRINUSE 0.0.0.0:9898, stack - Error: bind EADDRINUSE 0.0.0.0:9898
cflurin commented 6 years ago

I've improved the error-handling. Install the latest version 0.3.4

iChUdY commented 6 years ago

Ok thx.

I use homebridge-mi-aqara and this is probably a problem 😒

cflurin commented 6 years ago

Yes, it's the same port 9898. Which xiaomi devices are you using?

iChUdY commented 6 years ago

I use 5xTemperature, 5xMotion Sensor, 5xWall Switch single fire, 2x door sensor, 1xSmart Wireless Switch, some Sonoff and Homekit device. Very specific setup in homekit trigger and condition. Depend family presence, time,.. Family house.

I woule like NodeRed dashboard for temp graph, virtual PIN Blynk iOS App, LED strip controller and Node-red as such. Maybe for future thermostat node-red-contrib-ramp-thermostat πŸ‘πŸ»

cflurin commented 6 years ago

One approach is to use node-red for all your automation tasks. Just connect all your devices (xiaomi, sonoff etc.) using mqtt/xiaomi-mqtt or other nodes. The data exchange with HomeKit can be achieved using homebridge and homebridge-mqtt (https://github.com/cflurin/homebridge-mqtt).

iChUdY commented 6 years ago

I known.. but iam use some Eve HomeKit device. And.. i love HomeKit apps to easy configure β€œon way” and geolocation condition.

HomeKit plugin for Node Red is buggy on Redeploy, electric off, ... thats main problem 😒

iChUdY commented 6 years ago

Ok. I total rewrite my project to xiaomi-mqtt <-> homebridge-mqtt. Works fine πŸ‘πŸ»