Closed scimmiettarossa closed 1 year ago
Does not look like a conflict between GPIO1 and GPIO3. As the one-wire communication with the DHT22 (not a good sensor choice) is very fickle about timing, and software PWM on ESP8266 pushes the MCU hard, failure is not surprising.
thanks, @sfromis ... do you think that with other sensors I can overcome this issue? any suggestion?
Until now I used a sonoff TH with Si7021, using a PWM output as well, with no issue: is it worth to try to use the Si7021? I have also available a DHT11 (but very inaccurate, and I think it shares the same logic), or even DS18B20 (without humidity reading, but it is not a big issue): do you think any of them is more "robust" in behaviour?
What I'd prefer would be an I2C sensor, instead of any of those. Point being that the I2C bus communication is more robust than those one-wire protocols. But if you have good experiences with the Sonoff SI7021 wrapped as non-I2C - whatever works for you.
More generally, I'm not really in favor of trying to see those commercial devices as suitable for just adding stuff to.
I leave the issue open until I try with alternative sensors, then I'll let you know
thanks again
PROBLEM DESCRIPTION
I have a Sonoff DualR2 with the last Tasmota (12.3.1); I have hacked it a bit using additional GPIOs with respect to the standard two buttons / two relays:
stat/garageswitch/RESULT = {"NAME":"DualR2_ext","GPIO":[33,416,0,1216,0,225,163,32,224,320,0,0,0,0],"FLAG":0,"BASE":39} GPIO0: Button 2 [33] (default) GPIO1: PWM 1 [416], added to drive a led stripe GPIO3: AM2301 [1216], added to monitor temperature and humidity with a DHT22 GPIO5: Relay 2 [225] (default) GPIO9: Switch 4 [163], added to monitor a door contact GPIO10: Button 1 [32] (default] GPIO12: Relay 1 [224] (default) GPIO13: Led_i 1 [320] (default)
everything works fine, if the PWM output is off, while if I set it to any value >0 (via web GUI or via domoticz or via console with the dimmer command), the readings from the DHT22 goes to "null" or "0". If I set the PWM back to 0, after a few seconds the readings are back
If I modify GPIO1 from PWM1 to RELAY3 (with the same led connected to the pin), I have no issue, both with the output ON or OFF: thereforeI'm using this configuration as a fallback solution, but in this way I can not dim the led
REQUESTED INFORMATION
Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!
Backlog Template; Module; GPIO 255
:Status 0
:TO REPRODUCE
Steps to reproduce the behavior:
switch PWM on and off
EXPECTED BEHAVIOUR
A clear and concise description of what you expected to happen.
non conflict between GPIO1 (PWM and GPIO3 (sensor)
SCREENSHOTS
If applicable, add screenshots to help explain your problem.
ADDITIONAL CONTEXT
Add any other context about the problem here.
(Please, remember to close the issue when the problem has been addressed)