Vuzi / raspi-sensors

Deprecated - Nodejs C++ plugin, allowing to easily read data from raspberryPi's sensors.
https://www.npmjs.com/package/raspi-sensors
Apache License 2.0
26 stars 3 forks source link

GPIO sensors DHT 11 and PIR shows steady 0 #11

Closed aleonnet closed 7 years ago

aleonnet commented 7 years ago

Hi @Vuzi great job! BMP180 works very well on my RPI3 with latest Raspbian, but DHT11 shows a steady zero (0) as PIR sensor. I've already checked the physical wiring of DHT 11. By the way I'm using wiringpi pin 21 and it works with node-red-contrib-dht-sensor, but I'd like to use raspi-sensors. What could be wrong? Would you help me pls? Thanks!

{ "type": "Humidity", "unit": "Percent", "unit_display": "%", "value": 0, "date": "2016-12-09T21:24:45.458Z", "timestamp": 1481318685458, "sensor_name": "humidity_sensor", "sensor_type": "DHT11", "_msgid": "fe0699cd.01f968" }

{ "type": "Temperature", "unit": "Degree Celsius", "unit_display": "°C", "value": 0, "date": "2016-12-09T21:24:45.458Z", "timestamp": 1481318685458, "sensor_name": "humidity_sensor", "sensor_type": "DHT11", "_msgid": "fe0699cd.01f968" }

aleonnet commented 7 years ago

The GPIO must use direct pin number input...not with 0X... Ex: pin : 0X7 is wrong. Use pin: 7

Vuzi commented 7 years ago

I've use the hexa notation of JavaScript (0x7 (or 0X7) is 7, but 0x10 is 8, etc.. but you can use plain old integers, it should not have any difference), plus I've used the Wiringpi numbering of the pins, which is not the same as the regular notation (http://wiringpi.com/pins/).

Hope it helps!