Issues with ESP8266 losing config


#1

Hi all - I bought the assembled kit recently and flashed it with version 2 of the .ino - all went well and I was able to trip the relays with the appropriate MQTT commands. Everything went well until I unplugged the board from my PC and rebooted it.

Every time it reboots it goes back into Soft AP mode, asking me to re-supply all of my information again. Once I do, it reboots, the board pings four times, times out 3-4 times, pings four more times, and dies. It’s then back to the soft AP to reconfigure everything again.

Every 20 or so tries the config sticks but I can’t depend upon that. I’ve tried going back to version 1 of the .ino but my MQTT broker uses authentication.

The good news is that when it works, it works great; the sprinklers come on as soon as the MQTT topic receives a zone on command and turn off when it receives a zone off command. The bad news is that I can’t seem to get the config to persist following a reboot. The pin is in RUN mode, I’ve re-uploaded the code several times via an Arduino Uno, and at this point I’m tapping out – anyone have any suggestions?


#2

Hey @smarchman - I have been racking my brain with this same problem as well…

Turns out my issue was related to an update to the Arduino Core.

In Arduino IDE, go to the Boards Manager, find the esp8266 board, select v2.4.0 and hit install. Restart Arduino IDE. Then try to compile and upload. That did the trick for me, took me MANY frustrating hours to figure out.

My ESP config has survived many restarts now!

As an aside, this was for the Blinds Control system he sells, however, I would imagine he uses very similar base code and my problem was the exact same as yours.


#3

Thanks @jmaciv for the feedback - very much appreciated! After tearing my hair out for a day or so, I ultimately decided to flash the ESP8266 board with Tasmota firmware and it works a treat as an MQTT client, so things are all good here.


#4

Ahh gotcha. Wish I had figured this out sooner, for both of our sakes!

My blinds device had been working flawlessly for about a year before I decided last week that I wanted to alter the code to retain the MQTT state messages. This is what got me down the path of the device losing its config on reboot.

Best of luck with Tasmota! Have never used it myself, only ESP8266 code I have used is Matt’s and some stuff I have written.


#5

I had a similar problem with my blinds control system. As soon as I removed power, the settings were lost. What I discovered after much agony was that I had the Arduino IDE Tools->Flash Size set to 4M (No SPIFFS). It caught my eye because I remembered seeing a test for SPIFFs in the code. I changed it to 4M (1M SPIFFS) and all is well now; the settings are retained when I remove power.