NorthernMan54 / homebridge-dht

Homebridge plugin for DHT22 Temperature / Humidity Sensors
73 stars 14 forks source link

Homebridge crashes when trying to initialize Dht #29

Closed melgu closed 5 years ago

melgu commented 5 years ago
May 14 19:05:59 raspberrypi2 homebridge[717]: [2019-5-14 19:05:59] [dht22] Initializing Dht accessory...
May 14 19:05:59 raspberrypi2 homebridge[717]: [2019-5-14 19:05:59] [dht22] Adding Accessory
May 14 19:06:00 raspberrypi2 homebridge[717]: [2019-5-14 19:06:00] [dht22] INIT: dht22
May 14 19:06:00 raspberrypi2 systemd[1]: homebridge.service: Main process exited, code=killed, status=11/SEGV
May 14 19:06:00 raspberrypi2 systemd[1]: homebridge.service: Unit entered failed state.
May 14 19:06:00 raspberrypi2 systemd[1]: homebridge.service: Failed with result 'signal'.

Config:

{
    "accessory": "Dht",
    "name": "dht22",
    "name_temperature": "Temperature",
    "name_humidity": "Humdity",
    "service": "dht22"
}

Everything works if I take out the plugin from the config.

NorthernMan54 commented 5 years ago

The log should have more details around why homebridge exited. If you could share we should be able to determine why homebridge exited.

rsuard commented 5 years ago

Hello there,

Thanks for your work !

I had a hombridge server working fine with ligthify, I tried to follow your steps, however, I have kind of the same problem, error is here :

Error: listen EADDRINUSE: address already in use :::51826 at Server.setupListenHandle [as _listen2] (net.js:1270:14) at listenInCluster (net.js:1318:12) at Server.listen (net.js:1405:7) at EventedHTTPServer.listen (/home/pi/.nvm/versions/node/v10.15.3/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/eventedhttp.js:60:19) at HAPServer.listen (/home/pi/.nvm/versions/node/v10.15.3/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:158:20) at Bridge.Accessory.publish (/home/pi/.nvm/versions/node/v10.15.3/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:616:16) at Server._publish (/home/pi/.nvm/versions/node/v10.15.3/lib/node_modules/homebridge/lib/server.js:132:16) at Server. (/home/pi/.nvm/versions/node/v10.15.3/lib/node_modules/homebridge/lib/server.js:421:14) at /home/pi/.nvm/versions/node/v10.15.3/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/once.js:16:19 at self.getDevices.then (/home/pi/.nvm/versions/node/v10.15.3/lib/node_modules/homebridge-lightify/index.js:81:7) [2019-5-24 15:24:55] Got SIGTERM, shutting down Homebridge... [2019-5-24 15:24:55] [PiTemp] Error: [Error: failed to read sensor]

I tried to unaccessorize the JSON. I have still the error, and the shutting down .... What do you think ?

Thanks a lot, ++

NorthernMan54 commented 5 years ago

This message indicates that two copies of homebridge are running, the second copy is likely started by autostart scripts.

On May 24, 2019, at 10:12 AM, Romain Suard notifications@github.com wrote:

Hello there,

Thanks for your work !

I had a hombridge server working fine with ligthify, I tried to follow your steps, however, I have kind of the same problem, error is here :

Error: listen EADDRINUSE: address already in use :::51826 at Server.setupListenHandle [as _listen2] (net.js:1270:14) at listenInCluster (net.js:1318:12) at Server.listen (net.js:1405:7) at EventedHTTPServer.listen (/home/pi/.nvm/versions/node/v10.15.3/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/eventedhttp.js:60:19) at HAPServer.listen (/home/pi/.nvm/versions/node/v10.15.3/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:158:20) at Bridge.Accessory.publish (/home/pi/.nvm/versions/node/v10.15.3/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:616:16) at Server._publish (/home/pi/.nvm/versions/node/v10.15.3/lib/node_modules/homebridge/lib/server.js:132:16) at Server. (/home/pi/.nvm/versions/node/v10.15.3/lib/node_modules/homebridge/lib/server.js:421:14) at /home/pi/.nvm/versions/node/v10.15.3/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/once.js:16:19 at self.getDevices.then (/home/pi/.nvm/versions/node/v10.15.3/lib/node_modules/homebridge-lightify/index.js:81:7) [2019-5-24 15:24:55] Got SIGTERM, shutting down Homebridge... [2019-5-24 15:24:55] [PiTemp] Error: [Error: failed to read sensor]

I tried to unaccessorize the JSON. I have still the error, and the shutting down .... What do you think ?

Thanks a lot, ++

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub, or mute the thread.

rsuard commented 5 years ago

Thanks fou your answer @NorthernMan54 Do you know the twist to kill them all ? Or at list get the status, or the QRcode and slug ? because Homekit is completly lost... Poor thing

And why I have this at the end ? [2019-5-24 15:24:55] [PiTemp] Error: [Error: failed to read sensor]

Thanks a lot, Romain

rsuard commented 5 years ago

I have found how to kill them all : sudo killall homebridge, then I followed this to reinstilize Homebridge : https://github.com/nfarina/homebridge/wiki/Basic-Troubleshooting

However, I ve no idea why my sensor is not read. I ll continue digging, if you have any idea ?

NorthernMan54 commented 5 years ago

Did you do this? sudo adduser homebridge gpio

Sent from my iPad

On May 25, 2019, at 8:24 AM, Romain Suard notifications@github.com wrote:

I have found how to kill them all : sudo killall homebridge, then I followed this to reinstilize Homebridge : https://github.com/nfarina/homebridge/wiki/Basic-Troubleshooting

However, I ve no idea why my sensor is not read. I ll continue digging, if you have any idea ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

rsuard commented 5 years ago

Hello,

I tried, but I run Homebridge with my "pi" user wich is in the GPIO group. I have no user called "homebridge", so when I put "sudo adduser homebridge gpio", it answers "user Homebridge doesn't exist"

What am I missing ?

Thanks for your support, Could I test the Sensor without homebridge ?

Thx

NorthernMan54 commented 5 years ago

If your running as the user pi try

sudo adduser pi gpio

rsuard commented 5 years ago

Hello NoternMan54,

Thanks, I already tried it and got the answer : Pi is already in GPIO group

I m thinking about a hardware problem, is there a way to test it ? Thanks

toshibochan commented 5 years ago

I did new installation yesterday and not working to.

NorthernMan54 commented 5 years ago

@rsuard Under the covers I'm using this library 'node-dht-sensor' to read the temperature and the error is from it.

I was looking at their issues, and they had some very good troubleshooting in this issue

https://github.com/momenso/node-dht-sensor/issues/57

@toshibochan Please open a separate issue, and share a log file with an errors.