-
Notifications
You must be signed in to change notification settings - Fork 639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Espurna doesn't seem to recover from error in sensor DHT #1918
Comments
Please do also try setting pinMode.
Do you mean that readings need more time? I think this value was taken from here:
|
Check the wiki https://github.com/xoseperez/espurna/wiki/Sensors and my troubleshooting #1534 hope it helps you. |
Hi and sorry, I've been very busy these days
could you give me a summary of what solution you found? My current hypotheses are
In summary; something in 1) brings the sensor to an error state and/or reset it, and something in 2) don't let it recover. My guess: inestabilty in vcc or wifi intereference resets (randomly) the sensor, and then espurna never waits 1 second. I tried disconnect and connect data line, and espurna always recovered the sensor after some timeouts; I will try next disconnet and connect vcc line simulating inestability to force a sensor reset and see what happen. |
In the sensor code is a part that counts the sensor read errors and then reset the sensor over the data line. In my case with none of my sensors this worked. What I did is assign a second io pin as power supply for the sensor and upon 5 read errors I pull down the power for half a second and the sensor is working again. Already have this running for months now without a problem (and I don't know why with almost no sensor resets) so the problem is in the supply of the sensor and if my way is the best way I can't say but it works satisfying for me. |
I have also the same problem with the sensor readings on the new buil 1.14..0-dev, on a sonoff-th-10 device. I have reverted back to 1.13.6-dev and everithing is working normal. |
@icevoodoo bad2855 did the timing change break this? 500 -> 1100 espurna/code/espurna/sensors/DHTSensor.h Line 175 in c96f2e4
espurna/code/espurna/sensors/DHTSensor.h Line 182 in c96f2e4
|
I have modified to 500 ms and uploaded to my device and seems to work now. The question is why you are not reverting back to 500 ms ? |
I guess this is some kind of hardware difference, not all DHT made equal. |
Hi...; I still can't test the code, I haven't had much time... |
I can confirm that is SI7021. But till now it worked very fine. You can see in the picture bellow (sorry the site is not in english, but you can figure it out). |
Ok, so the fix should probably be: #define DHT_CHIP_SI7021 <some number>
...
if ((_type == DHT_CHIP_DHT11) || (_type == DHT_CHIP_DHT12)) {
nice_delay(20);
+ } else if (_type == DHT_CHIP_SI7021) {
+ delayMicroseconds(500);
} else {
delayMicroseconds(1100);
} And add |
#2000 updated 1100 usec to be only used in case of |
I have tested today with the new modifications approved and everithing seems ok. |
The single weird thing that I notice in the web interface, is the missing switches and schedule section. I don't know if it's related with the new modifications. Can someone help with this? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
This issue will be auto-closed because there hasn't been any activity for two months. Feel free to open a new one if you still experience this problem. |
Hi; my data
Probably I have some problem in hardware, but I am not totally sure.
When I power my Sonoff, it reads the sensor correctly; some time later I get (via telnet) timeouts errors:
Then, if I reset Espurna via command "reset" in telnet, the error persists after the boot; but if power off and power on the sonoff, the problem disappears (at least for a time).
I suspect the following code in DHTSensor.h
because digitalWrite is not preceded by "pinMode(_gpio, OUTPUT);". Is it possible that this is the reason why it does not seem to recover?
By the way; DHT_MIN_INTERVAL is set to 2000; it is not to low?
PD: I will try to force the error timeout disconnecting and connecting GPIO 4
The text was updated successfully, but these errors were encountered: