Closed Magnus-rosenborg closed 5 years ago
Same issue with a Wemo D1 and DHT11. Physical startup shows value for Temp/Humidity and Drewpoint. After 3 minutes all values become null.
My DHT22 AM2302 sensors using a ESP01 work when first configured, but most of the time when I issue an SetOption8 command to change to Fahrenheit they begin issuing Nulls. Strangely if I go into the Configure Template window and change the GPIO2 pin to AM2302 from User save and then go back and change from AM2302 to User they begin working for a short period of time then go back to issuing nulls. Not I have used 3 DHT22 sensor boards and 3 ESP01s and the problem always happens when I attempt to change to Fahrenheit. Even stranger when I use new boards they work at Celsius. But once this happens erasing and reprogramming with Tasmotizer they continue with the Null problem.
(All details posted below for clarity)
Does anybody have any further information on this?
I'm getting random null readings for the sensor and it's the only thing stopping me from completing dehumidifier home automation project i've spent weeks on.
The sensor just simply stops working when I need it to work constantly and consistently for my Node-Red and Mosquitto Broker, both installed on a raspberry pi, flow to work.
I've tried changing between AM3201 and SI7021 in the Module parameters drop down menus and no difference.
It will sometimes give successful readings for hours, and then just "null".
Powering off at the mains, discharging anything by pressing the sonoff button a couple of times, and powering back on again, refreshes and gives me temp and humidity again.
Sonoff Basic R2
Sonoff RF R2 Power V1.3
12.2.0(tasmota)
2_7_4_9/2.2.2-dev(38a443e)
DHT22
Sonoff PCB | DHT22 | 4.7K Pull-up Resistor |
---|---|---|
GPIO5 | (data) OUT | * |
5V | (VCC) + | * |
GND | - |
Here I created an empty generic(18) configuration file (right) and made the same connections that correlate to the standard onboard connections of the RELAY, BUTTON & LED for the Sonoff, that I first gleaned from in the Configure Template section in Tasmota (left), and selected AM3201 for GPIO5.
||
|
on esp32c3 (luatos cdc version, see https://cdn.openluat-luatcommunity.openluat.com/attachment/20220609213416069_CORE-ESP32-A12.pdf and https://wiki.luatos.com/_static/bom/esp32c3.html and https://wiki.luatos.com/chips/esp32c3/board.html#id3 ) with Program Version 13.3.0(tasmota32) Build Date & Time 2023-12-12T14:31:41 Core/SDK Version 2_0_14/4.4.6.231122 my dht22 still has this issue. it is on gpio5
I have the same problems with AM2302, connected directly (no resistors) to different devices. Working perfectly, then stops! Problem may appear once in few years, in few months or daily! Only hard power cycle or removing the AM2302 GND wire (other two do not solve the issue) and reconnecting it back fixes things! For 3 years!
Today, I have 100% positively proved, that in my case, problem is absolutely not the Tasmota! Problem is caused by electromagnetic interference (EMI/EMP) - not my field, these therms may not be perfectly correct! I am an expert programmer and mathematician. My own, extremely complex, SmartHome program runs several homes and I had to program around 30+ bugs in Tasmota! So I am not defending the Tasmota!
Note: I do not claim this is the only possible cause for this problem! But, if others would check if this may be the cause of their AM2302 problem, we would all prosper! Unfortunately, this needs bit of explaining to be accepted as proved. Please, bear with me! Not a simple problem to prove!
One of my homes is in colder continental EU N45 climate and needs humidifiers. In 2021 I bought two AM2302 to test if they can be used to run humidifiers. They worked perfectly for heating, and are useless for cooling. They were connected to D1 minis. One of them would occasionally blank out. It was temporary connected to D1 mini, using DuPont wires, and was next to humidifier, so I would dismiss occasional (once in weeks) problem and would just replug the GND. The second AM2302 was permanently connected to a D1 mini in another zone. That second AM2302 had the problem just once in 3+ years! Again, I dismissed it and reconnected its Gnd to its screw-in clamp.
This problematic one, connected with DuPont wires to D1 mini, would bug me from once in few days to once in few months. No rule. So, recently I decided to move it to Sonoff Dual R2 where it was supposed to be connected permanently. I soldered it! Man, was that a mistake! From occasionally, it would faint on a daily basis! So, I ordered third AM2302 and replaced the old one with the new one. It works! Until my shutters were closed yesterday at sunset! AM2302 fainted again! I reconnected the AM2302 GND, it works again. Until my shutters were raised this morning! I retested everything: 2 different AM2302, different GPIO0s, different Grounds, checked solder points, verified all connections are OK. This particular Sonoff Dual R2 is used to: lower and raise the shutters, it has one DS18B20 sensor with its own pull-up, has a Reed switch for open/close window and its LED is used for signalling. Everything else all homes works perfectly for 5 years! This zone alone has 15+ devices.
Sometimes AM2302 does not make a problem. When the shutters are fully lowered - it faints. On small shutter movements and after raising the shutters, problem often does not present itself! Problem may occur immediately or after a 1-2-3 minutes! AM2302 disappears. Power cycle or recouplling the AM2302 GND solves it always! Noting else helps.
So, today I left a new AM2302 attached to my 230V powered Sonoff and brought nearby an USB powered D1 mini and attached the old AM2302 to it. Here is my proof: I have witnessed on multiple occasions, that both AM2302s, connected to separate USB powered D1 mini and to the 230v Sonoff, would disappear at the same instant! Moving D1 mini around, its AM2302 would disappear less frequently, while the AM2302 connected to the Sonoff would drop dead during every cycle! At least once!
I ave proven and am absolutely certain that my shutter motors emit occasional EMI/EMP killing the AM2302s! In another home, similar shutters motor would disrupt TV picture for a 1-2 seconds! Friend said he has a Tuya gateway which, when plugged to its USB C cable, would disrupt TV picture for a moment! Problems occurs because motors are Inductive loads (having moving parts, as opposed to resistive loads: e.g. bulbs or heaters). I can not explain friend's Tuya gateway, except: they made it the cheapest possible way, usual Chinese quality.
Why this EMI/EMP problem occurred only once on my second AM2302 connected to D1 mini in large living zone, I have no clue. Btw, this living area D1 mini has 4 of the same shutter motors within 2-3 meters to the left and to the right of it! There are two Sonoffs with 4 relays and another one with 2 relays, all within half a meter from AM2302! Plus several other relays, not powering motors! Plus many other sensors and relays. Ah, just that particular D1 mini, additionally to the AM2302, has: 2 DS18B20 (using D1 internal pull-up resistor), BH1750 Illuminance sensor and its LED is used for signalling. I do think sometimes TV in that zone would flicker for a moment, but quite rarely. Mostly, all 4 shutter motors in that zone are run simultaneous! Every day, they run at least two times! In summer, 5 times. This AM2302 disappeared just once in 3+ years.
Now I need to find how to fix that problem. Two ferrites placed on the problematic AM2302 cable did not help. I will have to try placing them near the motor, but that is not my field of expertise. For now, I connected this Sonoff Dual, one whose motor is causing the problem, to a plug the SmartHome program controls. If the SmartHome notices AM2302 is unavailable, it cycles the power for Sonoff Dual R2 and its AM2302. But, that is not the solution! Guess what just happened, few minutes after the sunset? My SmartHome power cycled Sonoff and all is well again.
Anybody else willing to test it they have the same cause of this problem?
Just connect the power pin of the DHT to a gpio and send a low pulse when the DHT hangs. No need to reboot the whole thing. Some DHT are total crap and other are rock solid (older ones). Motors generate lots of electrical noise (EMF) that can even hang the ESP's. As as the ESP has a watchdog it heals itself, but the crappy DHT seems to be too basic.
Logically, that would work. But...
You propose that we connect both data and 3v3 pins of AM2302 to data pins? Not 3v3 to 3v3? Or do you mean both together? Sort of, something like DS18B20 parasitic mode where I connect both GND and 3v3 leads to the ground?
My problem can not be solved by breaking data or 3v3 lines, only by breaking data or power cycle.
My AM2302s are 3+ years apart. I expect all are crap, more or less, but crap.
How would that work? I would have to define 2 GPIOs as having AM2302? And then, do what?
My aim was for others to check if this is the cause of their problem. Rebooting the Sonoff takes 4 seconds total, but I said that can not be the acceptable solution.
No, connect the 3.3v to an unused gpio and configure it as a relay. So when it's on you are powering the DHT when it's off you are not. Now you can remote reboot the DHT switching momentarily off.
Well, I am embarrassed I did not think of that! Logically, this makes sense! I tried many variations, but not this one. It is late now for me to switch wires, I will try that tomorrow! AM2302 should work with current from a GPIO.
This sounds brilliant, strictly logically speaking. This really should work! In my particular situation, it will take some tinkering inside the Sonoff Dual to replace wires. Luckily, it has a free GPIO.
Still, I wanted to pint to a different cause of this problem, for the sake of other users. I have not seen anybody taking this route.
I just rewired a D1 mini with AM2302 as you suggest, and it works as expected. When the Relay is On, it works. I can kill it for a few seconds, AM2302 dies and then returns!
I will make a real test tomorrow. My concern is that I always had to break the GND, breaking Data or 2v2 never helped.
Regardless, this is a brilliant idea! I will report back tomorrow. But still, this is not a solution, but more elegant workaround than what I do now, by powering down the Sonoff.
Still, I like and appreciate brilliant ideas!
After a late supper, I went on to test a variant that I might need. Killing the Gnd line. I can not do it on a Sonoff, but it is simple on a D1 mini as its D8 has inbuilt pull-down.
Just connect Gnd from AM2302 to D1 mini's D8 GPIO15 instead to Gnd and define it as Relay_i. Kills Gnd line but takes quite long time.
Both of the above (GND or 3v3) resets AM2302 when connected alone to my D1 mini. But, for some reason, the AM2302 connected to my Sonoff Dual R2 resets only when its Gnd is cut.
We still need someone from this field to offer actual solution of the problem. Confirmation of others would also be nice. For now, we have usable workarounds.
Spec sheet says: One capacitor valued 100nF can be added between VDD and GND for wave filtering.
Is that related to problems we have and could that be a fix?
I'm experiencing similar but with multiple time of flight laser sensors sharing the I2C bus. VL53L0X has a configurable (volatile) i2c address, which is set up on boot via the inhibit lines to individually address each sensor and give a unique address. (I believe sensor 1 keeps the default address, and sensor 2++ get increments from there). From there on, if a sensor loses power, it loses config and starts colliding with the default address causing 1-2 nulls. I can't just power cycle the sensors as tasmo needs to run the startup script to re-address the volatile sensors. A soft reset of tasmota in this case DOES bring the sensors back to life by re-programming it.
We may need to use both tricks - io pin to relay power cycle the sensors if they internally crash, then software reboot the esp to fix the config. In theory just the reboot should be needed.
Startup:
After a while:
(Aside: using the distance sensors to track the inventory count of a pop machine, because makerspace decentralized volunteers need access to the inventory...and our vending controller only announces digital transactions over the network, not coin transactions because reasons).
Same here. Using Olimex ESP32-POE with multiple AM2302 sensors. What's peculiar is that sensors drop out to NULL in almost exact periods of time. Either at 20:41 in the evening or 5:32 in the morning. I register these dropouts in my Home Assistant. Definitely cannot be resistor or power issue. Can some timer be set in Tasmota drivers?