Comments (5)
I've tried this lib, an example off node-rpio, and the adafruit dht lib, and I am not able to get a reading off of this sensor, I think that it may just be broken.
from node-rpio.
I got another sensor and tried it, the example as it exist in the rep provides all NaNs, I changed a bit and I got:
Read failed:
chk = 0, chksum = NaN\
humidity: 27.6 temperature:80.NaN (0 = NaN)
Where the numbers fluctuate quite wildly, but the temperature dec value is usually NaN.
Here are the significant changes I made:
rpio.open(pin, rpio.OUTPUT);
rpio.write(pin, rpio.HIGH);
rpio.msleep(500);
rpio.write(pin, rpio.LOW);
/*
* The datasheet says 18us, but we need to account for the JavaScript function
* call overhead. Trial and error suggests this is a working value.
*/
rpio.msleep(20);
rpio.write(pin, rpio.HIGH);
rpio.usleep(80);
rpio.write(pin, rpio.LOW);
rpio.mode(pin, rpio.INPUT);
rpio.usleep(100);
/*
* Switch to input mode and read as fast as possible into our buffer.
*/
rpio.readbuf(pin, buf);
from node-rpio.
Any news on this topic ?
from node-rpio.
Solution is here :
`
/*
* Initiate the MCU sequence.
*/
rpio.open(pin, rpio.OUTPUT, rpio.PULL_UP);
rpio.sleep(1);
rpio.write(pin, rpio.HIGH);
rpio.msleep(10);
rpio.write(pin, rpio.LOW);
/*
* The datasheet says 18us, but we need to account for the JavaScript function
* call overhead. Trial and error suggests this is a working value.
*/
rpio.msleep(20);
rpio.write(pin, rpio.HIGH);
/*
* Switch to input mode and read as fast as possible into our buffer.
*/
rpio.mode(pin, rpio.INPUT);
rpio.usleep(100);
rpio.readbuf(pin, buf);
rpio.close(pin);
`
from node-rpio.
I rewrote the dht11 example in 049e187 but forgot about this ticket, if there are still issues with the code let me know, it worked pretty well for me across a range of devices though.
from node-rpio.
Related Issues (20)
- How to use Waveshare epaper HOT 1
- detect_pinmap hard codes /proc/device-tree/model causing docker issues
- Raspberry pi zero 2 w supports? HOT 4
- Banana Pi M2 Zero supports SPI with this library? HOT 1
- raspberry pi chrashing when pluggin cable into the gpio pin 39
- question about functionality HOT 2
- Issues with timing on poll HOT 2
- Compilation Warnings HOT 1
- M1 Mac support? HOT 4
- Orange Pi Zero 2? HOT 2
- Bindings.js Error HOT 2
- Example with button polling HOT 1
- orangepi 5 support HOT 1
- How to set BCM2835_SPI_BIT_ORDER_MSBFIRST ?
- Node.js Exception
- Software PWM support?
- Update the lib for newer kernel apis for epoll_ctl
- Node 20 Support HOT 5
- spi chipselect disable ? I will control it myself
- Support for Raspberry Pi 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-rpio.