strange behaviour of S20 GPIO: sporadic toggles from 1 to 0 but not vice versa

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
ao16
Normal user
Posts: 19
Joined: 03 Oct 2018, 23:51

strange behaviour of S20 GPIO: sporadic toggles from 1 to 0 but not vice versa

#1 Post by ao16 » 30 Oct 2018, 12:26

Hi,
on some of my Sonoff S20 (not original Sonoff, PCB is from DLX using ESP8285)
I am seeing the issue that the Relay GPIO is changing from high to low without
any rule action nor any http-request.
The communication to Thingspeak continues, there is no reboot nor a WiFi-reconnect.

Environment:
- S20 copy model "AOGETYO", PCB labeled "DLX", using ESP8285
- 2200uF Cap directly at the 3.3V of ESP8285 installed inside the S20
- ESPEasy mega-2018-09-27
- publish of uptime, FreeRAM and relay#state to Thingspeak
- notify to eMail to see if there was a reboot,
a WiFi reconnect, an action from a rule or a http-get
- S20 bushbutton configured as "switch input",
Switch type "normal", switch button type "normal switch", interval 0 sec.



The reason that I am using ESPEasy-20180927 is that this one seems to be
more stable than all the newer ESPEasy releases from October onwards.

With all the newer releases I see more issues in reboots or sudden lost
of HTTP-Webserver access while ESPEasy still seems to be running on the device.
Well, that's another issue that if such a reboot happens, the relay does not return
to its original state and stays at the default state (in my case that's 0).



Coming back to the above "GPIO toggle issue":
At below Thingspeak charts you can see more details on the above described issue:

"Screenshot_2018-10-30-09-42-05.png":
S20 still running reporting the FreeRAM to Thingspeak but not the uptime anymore after ~06:20 (?!)
At around 6:20 AM the FreeRAM increases from 20kb to 25kb and then returning
back to 20kB.
Exactly at this timepoint, the relay at the GPIO switches from 1 to 0.
(see "Screenshot_2018-10-30-09-43-35.png")
S20 relay GPIO toggles from 1 to 0 at 06:20 AM
S20 relay GPIO toggles from 1 to 0 at 06:20 AM
Screenshot_2018-10-30-09-42-05_c.jpg (58.27 KiB) Viewed 2119 times
Attached you will also find the simple rules running on the S20.

Code: Select all

on time#initialized do
	Notify,1,"%ip% S20 plug booted and NTP initialized"
endon

on wifi#connected do
	notify,1,"%ip% S20 plug connected to WiFi %ssid%"
endon

on Button#state=1 do
	if [Relay#state]=0
		gpio,12,1
		notify,2,"relay ON due to key pressed"
	else
		gpio,12,0
		notify,2,"relay OFF due to key pressed"
	endif
endon

on Relay_ON do
	gpio,12,1
	notify,2,"relay ON due to HTTP-Get"
endon

on Relay_OFF do
	gpio,12,0
	notify,2,"relay OFF due to HTTP-get"
endon
What I noticed also:
If I set the interval within Devices of the S20 pushbutton to a value >0,
then the relay GPIO switches from 1 to 0 at the time the elapesed intervall time
if the GPIO was 1 before. If the GPIO was 0, there is no toggling to 1.
Setting the intervall of the pushbutton to 0 solves above strange behaviour.



Any idea what could be the root cause of above random issue?


best regards,

ao16

P.S.: Strange, I cannot submit the 2nd PNG altough it shows up in preview of this msg. As soon as this post is submitted, the 2nd snapshots disappears..?!

ao16
Normal user
Posts: 19
Joined: 03 Oct 2018, 23:51

Re: strange behaviour of S20 GPIO: sporadic toggles from 1 to 0 but not vice versa

#2 Post by ao16 » 25 Nov 2018, 15:54

Hi,

I was monitoring above issue in the past weeks - here are some more details and findings:

Issue:
Relay at a S20 is intentionally switched to ON.
After some time (can happen within a few hours or few days),
the S20-relay switches to OFF and stays OFF altough it still should be ON.


It looks that in most cases that I monitored in the past weeks,
the cause for this ON-to-OFF is caused by a Watchdog reset of the S20.


The following additional strange behaviours I monitored also:

1. This strange effect is with S20-clones (ESP8285 based) and also at original Sonoff S20's (ESP8266 based) visible


2. Quite often, the S20 is not accessible via ESPEAsy Webinterface anymore,
also a http-get command does not work anymore, also no ping.
It looks that the S20 lost the WiFi connection however in some cases, a local operation via the pushbuton is still possible.


3. In some cases, the S20 reacts very slow on local pushbutton pressing => the relay state changes after some time...
It appears that the firmware is just slowed down needing time for other tasks


4. In some cases, the S20 does not react at all, nor on local pushbutton presses not Webinterface Access.
Then only a hardware reset (power on/off) helps.


5. In many cases, the S20 shows as reset reason:
"Hardware watchdog" (quite often) or sometimes (seldom) "software watchdog"

In the line "Boot:" there is shown either "manual reboot (7), manual reboot (2), manual reboot (3) or manual reboot (1)


Tested with ESPEAsy firmwares (all normal 1024 BIN's, I did not compile myself):
20180927, 20180712, 20181110



On one of the S20's, I installed now a firmware of May 2018 to go back into history
if some change in the ESP core lib is causing this strange behavious, as on two NodeMCU's
I am using here, this older F/W seems to work better in terms of WiFi stabiliy.


The effects 2. and 3. I see also on the two NodeMCU and a Wemos D1 mini and some other additional issues
regarding WiFi stability. On Github, I saw issues from other users about their WiFi issues, so this may have a
connection to what happens with this S20's here.

I will describe the other findings and testing results in the other
thread that is about the NodeMCU's (viewtopic.php?f=4&t=5939)
as with them it was easier to test different setups.


Anyhow, does anybody has an idea about this many hardware watchdog resets?
Why do they happen at a simple plug that just switches the inside relay on and off via local pushbutton or via http-get ?
Why is the Webinterface not accessible anymore?

thanks in advance for any hints


ao16

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests