Comments (8)
@tdicola Fail, the new code in 1.3.1 also doesn't work for DHT11 over a long cable, in my case a rasp pi 1.
I made these changes and fixed it:
// Set pin at input.
pi_mmio_set_input(pin);
// Need a very short delay before reading pins or else value is sometimes still low.
//for (volatile int i = 0; i < 50; ++i) {
for (volatile int i = 0; i < 500; ++i) {
}
from adafruit-raspberry-pi-python-code.
First thanks for this thread it seems to address the issue I am having with the dht-22, however; a question.
I made the changes to pi_2_dht_read.c and assume that this should be compiled but am unclear what (executable) to compile it to.
Or if it is compiled at runtime e.g. I am not getting the desired result i.e. I still get the same bad data on a long cable
from adafruit-raspberry-pi-python-code.
Great piece of detective work! Solved the problem I was having on a 20 metre cable to the sensor.
Thanks very much for posting the solution.
from adafruit-raspberry-pi-python-code.
Thanks for raising the issue and apologies that it couldn't be reviewed earlier. We've actually deprecated this Adafruit_DHT_Driver code and refactored the DHT sensor reading C code into the Adafruit_Python_DHT library here: https://github.com/adafruit/Adafruit_Python_DHT The timing functions in the new library are slightly refactored to use nanosleep for longer delays and busy waiting for shorter delays. I'm curious if this helps with stability over long wires. I'll close this issue for now, but it's great to have as a reference to point folks towards if they are also using very long wires. Thanks again for raising the issue.
from adafruit-raspberry-pi-python-code.
Thank you very much @gunkl!!!. Your fix worked like a charm for DHT22 over long cable in my RaspPi 1. (Adafruit_Python_DHT version 1.3.1)
from adafruit-raspberry-pi-python-code.
@tdicola, This should be reopened and @gunkl's fix (or something based on it) adopted.
from adafruit-raspberry-pi-python-code.
created pull request adafruit/Adafruit_Python_DHT#98
from adafruit-raspberry-pi-python-code.
@gunkl approach stopped working for me and I find a new solution here: #161
from adafruit-raspberry-pi-python-code.
Related Issues (20)
- PWM Servo Driver not running my servos HOT 1
- Adafruit_DHT binary needs updating with RPi 2 Base address HOT 1
- adafruit_charLCD/RPI.GPIO RuntimeError: No access to /dev/mem. Try running as root! HOT 1
- ws2801 needs update/test with py3 HOT 1
- patch for Adafruit_MCP230xx/Adafruit_MCP230xx.py HOT 2
- MCP4725 "Error accessing ...: Check your I2C address" HOT 1
- A package for Adafruit-Raspberry-Pi-Python-Code HOT 18
- Continuous integration and PEP8 HOT 1
- Enhancement - writeRowSane() HOT 2
- Hardcoded reference to 0x70 address HOT 1
- Is it possible to send data to WS2812 Light strip through the Servo Hat HOT 1
- LCD over I2C display on HOT 1
- <Deleted>
- lots of tutorials point to this repo HOT 3
- Unable to install many of the new python modules using python3 HOT 3
- Lines never reached HOT 1
- Send data BMP180 between client and server trought module socket HOT 1
- Solution for long cable on DHT22/11 HOT 6
- Port Code to .Net
- Rust HOT 1
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 adafruit-raspberry-pi-python-code.