[OBSOLETE] Sonoff, Sonoff TH, S20, Dual, 4CH, POW, & Touch Device Handler & SmartApp ($5 & $10 Smart Switches)

hi,

I am using the firmware from the first post on my Sonoff switches. It works well. But I have an issue.
When a long duration electricity outage occurs, and then it comes back , my wifi gets up in 2-3 minutes.
However, Sonoff boots earlier and when it can’t find the predefined wifi it reverts to no connection.
Then it does not retry to connect wifi. Can we change this behaviour ?
Could it try to reaccess wifi ssied periodically ? Or at least when we switch off/on electricity ?

thanks

1 Like

I have had a similar experience.

Maybe it needs some kind of watch dog timer?

Maybe it could check for a known network, and it it’s not there after X number of minutes reboot, or at least try to re-establish the network?

@erocm1231, is this a feature that you could add to the firmware?

2 Likes

@erocm1231 can you do that please ?

Thanks very much for the post. I was about to throw away my first sonoff thinking it is defective. Tried NodeMCU flasher and all working now.

@erocm1231 I have setup a Sonoff POW. I am in the UK and the voltage here is 220V. The app always shows 120V or 125V. Would it be possible to make this work for UK voltages?

@Drew650 have you had any luck getting your Sonoffs to work? I’ve got the same issue with 2 of mine, even tried using 2 different computers and 2 different firmware. I get no light or click of the relay at all. The first Sonoff I flashed a few weeks ago worked fine, so thought I’d order a few more and none of the new ones I’ve flashed work after flashing, they did work before.
I really hope we can get them to work as even if they let me claim on warranty it would cost more to send them back than they cost to buy.

I was able to flash a regular Sonoff fine the other day. But they were old ones I got a few months ago. The newest one I got was a Sonoff TH10 and have had no luck with that

I’m going to try a few things tomorrow

I’m wondering if they have changed something in the latest ones that doesn’t work with Eric or Tasmota’s firmware.

The device is supposed to try to connect for 30 seconds after boot, if it can’t then it broadcasts its access point for 5 minutes. If it is not configured within those 5 minutes then it reboots and attempts the process again. So, does it seem to not be working that way or is it just more desirable to try to connect for a longer time?

@sapstar I can add an option to change between uk & us voltages.

Thanks @erocm1231. That would be great.

Hi @erocm1231

After a long duration of electricity outage. The device can not connect to the wifi when wifi is available. I am sure that the 5 minutes period is not working. Because it has been longer than that.
Can you test this to see if it is working as you described ?

If it works for you, then there is a problem in my setup. But in any case, I believe 30 seconds to 5 minutes is not a good idea. maybe it should be 2 minutes to 2 minutes. Because if one has to access it through its wifi access point, then he can wait more than 30 seconds. But I am sure that my wifi access point can not boot in 30 seconds.

and 1 more question:
could it be doing this 30 seconds , 5 minutes process once ?

Try using the NodeMcu flasher with the settings that I posted above:

@kaiser_willi that worked for one of my Sonoffs, just haven’t had time to try the other one yet.

Hi @erocm1231

Would you be interested in adding a Toggle option to the boot up state? To explain my scenario, I would like to install a Sonoff to control a lighting circuit and maintain local switch control but I am unable to change any of the wiring and the power supply comes via the switch - but I am unable to install the Sonoff at the switch.

My thinking is if the Sonoff can ‘toggle’ at power up I can change the switch to a momentary off type ON-(OFF) that will interrupt the power to the sonoff and cause a reboot when the switch is pushed. That will then toggle the light on/off.

If easier and you can release the source code for the firmware to me (publicly or via PM) I am happy to make the changes myself.

One thing to note is the toggle process would need to be pretty much the first thing the firmware does after power up before connecting to WiFi etc to minimise the lag between the switch press and the action.

Nick

Interesting idea. So it would basically need to do the opposite of its previous state right? So if it was on when it was powered off, it would need to boot in the off state and if it was off when it was powered off, then it needs to boot in the on state. Does that sound correct?

I had another electricty outage last night. And because the sonoff did not connect, my rules on motion did not fire up.
This is really making sonoff useless for me. On the other hand what you say sounds at least a good solution because it would at least make the sonoff live in 5-10 minutes after outage ends. But it does not work for me.
my wifi router boots in around 2 minutes. why can’t it connect ?

I just tried two scenarios and it worked as I expected. The first was that I turned the Sonoff on and waited about 30 seconds so that it would broadcast its SSID. After 2 additional minutes I started up the router. All of this time I was running a constant ping on the Sonoffs IP address. After 3 additional minutes (so 5 minutes and 30 seconds) after initial boot of the Sonoff, the ping started to receive a reply.

The second test was just like the first, except that I waited 7 minutes after turning on the Sonoff to turn on the router (just to make sure the loop is working). 11 minutes after turning the Sonoff on I started to receive a reply from the ping. So the Sonoff tried to connect for 30 seconds, started its access point for 5 minutes, did those two things again (because it still couldn’t connect), and then connected when the router was available.

Can you post the firmware version and date that is reported when you go to http://ip_address_of_sonoff/info

?

{
version: “2.0.3”,
date: “Mar 22 2017 15:44:14”,
mac: “xxxxxxxxx”
}

Is this the latest? Any way we can get this display in a device tile and can it phone home for firmware version checking?

Yep you got it. Just start up in the opposite state to how it was when it went offline.

Nick