arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
22.09k stars 4.79k forks source link

configuration settings lost on power outage #4066

Closed dacorn closed 6 years ago

dacorn commented 6 years ago

IMPORTANT NOTICE If you do not complete the template below it is likely that your issue will not be addressed. When providing information about your issue please be as extensive as possible so that it can be solved by as little as possible responses.

Describe the bug I am located in the Philippines, I have over 40 T1 switches (so far) in my beach house. I live on the beach so we suffer from a lot of power brown outs. I have a solar system, generator and a automatic transfer switch to allow for a full failover scenario. However, there is still a split second where things failover. During this time some of the switches lose their configuration and the wifi light will blink and then switch wifi access point is available, if I connect the switch has gone back to its bare configuration, I then have to restore a back up config file to get the switch back to its configuration.

I have tried the 6 short presses to restart the switch but it doesn't seem to help.

Can you help with what may be wrong? It only happens to 3 or 4 switches every time this happens, it isn't on all switches.

Also, make sure these boxes are checked [x] before submitting your issue - Thank you!

To Reproduce Steps to reproduce the behavior: On power loss and power on the switch loses configuration.

Expected behavior A clear and concise description of what you expected to happen. Switches should restart with last settings and configuration.

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)

s1nbad commented 4 years ago

I am pleased to say I am all up and running.

My comment was not a complaint, although I was pretty unhappy at the time, the software did exactly as it was designed to do. It was more to do with the responses on the thread which seemed to focus on "you should have read the manual" rather than discuss how serious the ramifications of this default feature is.

The "warnings" were in an area that I mistakenly thought would not be relevant to an install and yet it wiped out my whole campus by design.

I do not know the answer but consider carefully how this "feature" could be used maliciously !!

pfeerick commented 4 years ago

@blakadder Rather, punishment for not reading that documentation you went to the trouble of prettifying! :-P

@meingraham Yes, just you! :-P I mean... really... sheesh... what's this my_user_config.h and user_config_override.h... and what's that got to do with pressing the big blue 'Tasmotize!' button on Tasmotizer? 😆 Jokes aside, some due diligence is needed on the part of user, but since when has that gotten in the way of ThingsGoingWrong(tm)?

@ascillato What do you think of another heading/section in the Getting Started guide... or better yet... it's own page? Common traps for new users? Think of it as a catch all troubleshooting page. Surely this isn't the only default option that can backfire spectacularly in the right circumstances? Or are there not enough to warrant it's own 5 seconds of glory?

@s1nbad Good point there on the malicious use... it would be like knowing that you only have to turn any Cisco router on and off five times and it would reset to the default password! :-O There's however no easy answer due to how many devices and variances Tasmota supports. Yes, it could be linked to the hardware template supporting a physical button, but even then, someone will get caught out after they've installed their device inside a hard to get area, and are trying to get it to reset. Better to somehow draw their attention to it in the first instance, so it is configured correctly for their application. And since you can't rely on the web interface, due to MQTT users, documentation it will have to be.

How about 42 cycles, since that's the ultimate answer? :-P 😆

meingraham commented 4 years ago

There are two paths that we've tried to guide users through - Getting Started ideally would be where new users would start... you can lead a horse to water... :wink: The other is the migration path for existing users. Perhaps these notes (e.g., QPC) or a separate article re: "gotchas" could be referenced in both of these paths. But again, you can lead a horse... but you can't make him read the docs!

blakadder commented 4 years ago

Whoops, seems I mistakenly edited that post instead of quoting it. Sorry

What do you think of another heading/section in the Getting Started guide... or better yet... it's own page? Common traps for new users?

For that to work we'd need new users to submit where they got caught! Its difficult for seasoned users to think in a new user way as much as we try.

Maybe you should start one ;)

martusi61 commented 4 years ago

The same problem happened to me every now and then, about 30 sonoff energy fluctuations with tasmota lose configuration, then I found this post and I'm trying the solution, but I have an idea, the SetOption65 problem is clearly a communication shortage / reading the guide, then why not move it to the web interface? This way everyone will see it and can set it up as they like.

ramanraja commented 3 years ago

I knew this configuration loss problem before I installed Tasmota for the first time; but I was fooled by my misplaced notion of consistency. I thought I was disabling the diabolical 'option 65', but actually enabled it! A very small sample:

SetOption56 : 0 = disable SetOption57 : 0 = disable SetOption58 : 0 = disable SetOption59 : 0 = disable SetOption62 : 0 = disable SetOption66 : 0 = disable SetOption67 : 0 = disable

But unfortunately: SetOption65 : 0 = enable

tangoTH commented 9 months ago

+1 "which is your proposed solution?"

A complaint without a proposed alternative or solution is just that, a complaint.

How about detecting the template applied then turning on or off this feature. I just lost 5 sonoff switches and have to reconfigure them by walking around my properly.

That said, it's a small price to pay for something I couldn't design myself (Tasmota)

tangoTH commented 9 months ago

Change WifiConfig to Disable wifi config but retry same AP without restart and flash writes Command: WifiConfig 5

Does this "WifiConfig 5" command tell the system to keep trying the old AP and not erase it's config?

I just had a 30 minute power outage and my Tasmota switches were all stripped to default configs and sharing their own SSID

barbudor commented 9 months ago

So your problem is not WifiConfig but most likely the Fast Power Cycle recovery mecanism

https://tasmota.github.io/docs/Device-Recovery/

tangoTH commented 9 months ago

Thanks Barbudor. As I wrote, I had a 30 minute power outtage and when the device was powered back up (and left for about 16 hours as I wasn't home and they are night lights) it was broadcasting the tasmota SSID and not connecting back to to my wireless network and the config was gone.

Are you saying the "WifiConfig 5" is not the fix. I don't have fast power cycles it's either off or on

barbudor commented 9 months ago

Have you read the doc ? Have you understood it ?

What I am saying is that Fast Power Cycle IS the reason for your configuration to be wiped and Tasmota restarting from fresh, broadcasting its AP

In many places, when power comes back after an outage, it does't come back nicely. Most of the time it comes up, down, up down a few times before being stable back on. This may triggers the Fast Power Cycle recovery mecanism. To avoid that you must have SetOption65 1 to disable Fast Power Cycle recovery. WifiConfig 5 will no help you with regards to that problem.

tangoTH commented 9 months ago

I've read the doc, but No, i don't understand the different WifiConfig examples. It is quite confusing for a home user.

I've done the SetOption 65 1 via the WebUi command line. I'm confident my power came back in a single time because I have records of my inverter after they replaced the failed electrical component up the street.

Appreciate the help, i'll keep an eye on it. Thank you

barbudor commented 9 months ago

Hi @tangoTH I'm not talking about WifiConfig but if your whole configuration is being erased (not only wifi credentials but every settings) the only possible reason is device recovery which can come from only 2 sources:

If your configuration is not erased but your Tasmota starts their own AP but successfully reconnect to your WLAN after a restart, then indeed WifiConfig 5 is your 1st level solution. The most possible cause is that Tasmotas devices restarts before your AP is UP, they can't find the SSID so they reboot in WIfiManager mode.

Note if you want to be safe from any of those, I suggest that you build your own binary/binaries with hardcoded Wifi credentials and WifiConfig 5. For that you need to compile with the following defined in your user_config_override.h:

#undef  STA_SSID1
#define STA_SSID1         "YourSSID"             // [Ssid1] Wifi SSID
#undef  STA_PASS1
#define STA_PASS1         "YourWifiPassword"     // [Password1] Wifi password

#undef WIFI_CONFIG_TOOL       
#define WIFI_CONFIG_TOOL       WIFI_WAIT // WifiConfig 5 : Wait for the AP without rebooting

#undef APP_DISABLE_POWERCYCLE  
#define APP_DISABLE_POWERCYCLE  true             // [SetOption65] When true, disable fast power cycle detection for device reset

With such embedded setting, even in case of Fast Power Cycle, your device will stick on your Wifi and wait for it to be ready.

tangoTH commented 9 months ago

Thank you. I have made the appropriate changes to my Tasmota (Sonoff 4 channel)

As long as the device will try to connect to WIfi when it's up and NOT erase the config, i'm good. I can walk into the yard and reset it.

Thanks again

coolchip commented 5 months ago

Thank you! Searched for this issue for very long. I ever thought my hardware is broken.

I've got a battery/solar powered esp8266 and sometimes the voltage of the battery drops and the esp seems to do a boot loop. After that my configuration was erased and a have to put it back in. With SetOption65 1 this never happens again since a long time.