wiringpi-opi-dht22
Dependencies
Description
NodeJS module to read data from a DHT 22/DHT 11 temperature and humidity sensor on boards that supports WiringPi library to access GPIO ports. Can be used in Alpine Linux versions.
Tested on OrangePi Zero Plus H2 / H5
Installation
1) build & install WiringOP or WiringPi
pi@orangepi ~ $ git clone https://gitlab.com/appealweb-libraries/wiringop-zero-alpinelinux
...
pi@orangepi ~ $ cd wiringop-zero-alpinelinux
pi@orangepi ~/wiringop-zero-alpinelinux $ sudo su
...
pi@orangepi ~/wiringop-zero-alpinelinux $ ./build
2) install node module
npm install wiringpi-opi-dht22
3) use node module
var d = require('wiringpi-opi-dht22');
var t = d.reader({pin: 8, delay: 1000});
t.on('data', function (data) {
console.log(+' farenheit: '+data.farenheit + ' celsius: '+data.celsius+' humidity: '+data.humidity);
});