Memory Loss on Power Cycle, ESP01S and v0.14.0

Greetings everyone,

Quick info:

Current Issue - WLED 0.14.0 forgets all settings data once power is removed from select ESP01S boards.

MCU - ESP01S, 1MB
**edit: The working board has a 2MB flash memory chip installed. This may be the issue.

Highest Success Level - WLED version 0.13.3 is successfully installed, retaining memory upon reset

What I Want - WLED version 0.14.0 on all of my boards.

Over the holidays I’ve been making smart Christmas ornaments with 3d printed components and WLED. The first ornament had its issues, but they were the typical things you run into when making something for the first time, nothing that would indicate that anything would go wrong the next time. It was made from an ESP01S and flashed with a USB flasher dongle that came with it.

So I ordered a batch of 5 ESP01S boards and they all came in one foil pack strip. The first one was connected and loaded from the website using a USB flasher dongle, but without any WiFi info prompt. This was done no problems with the first board, so I didn’t question it.

This one was soldered to its power supply (AMS1117, @ 3.3V) and tested with USB power (as in the final application). This is when I noticed that there was no WLED-AP WiFi network available. I set this one aside and focused on the next two in the foil pack.

At first I thought maybe something had been done wrong, or maybe this one had an issue. I moved to the next module (ESP01S #2). That is when I started to realize they were not taking any flash, and suspected hardware problems.

ESP01S #3 was reluctantly used to verify #2 wasn’t faulty, and all three were on the unresponsive pile for a while.

ESP01S #4 was left as a control group. No way I was going to mess this one up too. AT commands found that the firmware on this board (and most likely the others wrapped next to it) was left over from 2016. Not sure if that info is relevant to the case, but it seems very old to me.

From here, I updated my Python, ran EspTool, and flashed updated firmware to a version from October 2021. I flashed over all 3 faulty boards and restored their functions. Verified with AT commands. Code below (redacted).

esptool write_flash --flash_size 1MB 0x0 C:\Users\#######\Desktop\esptool-win64\boot_v1.7.bin 0x01000 C:\Users\#######\Desktop\esptool-win64\user1.1024.new.2.bin 0xfb000 C:\Users\#######\Desktop\esptool-win64\blank.bin 0xfc000 C:\Users\#######\Desktop\esptool-win64\esp_init_data_default_v08.bin 0xfe000 C:\Users\#######\Desktop\esptool-win64\blank.bin 0x7e000 C:\Users\#######\Desktop\esptool-win64\blank.bin

WLED 0.14.0 still did not install successfully from the web (Chrome).

Finally I started using alternative installation methods for WLED versions available at GitHub. I tried Python, but finally had great success using ESPHome Flasher 1.4.0. I was able to get WLED 0.14.0 to flash successfully.

However, a few days later I realized my second finished ornament wasn’t done yet, and it had no use of its memory.

I initially tried to independently erase the memory using esptool erase_flash. This worked, but with no effect on memory retention.

I then started trying random versions of WLED to see if memory could be restored. My thinking was that either:

  1. A nightly build may just have fixed the issue. Does not explain my initial ornament working.
  2. Perhaps OTA updates could solve the issue I was seeing. Load an older working version and OTA update may make my installation v0.14.0. This would explain my working ornament.

WLED 0.14.1-b2_ESP01.bin was flashed successfully, using the same method described above. This did not fix the memory issue, however.

Yesterday I finally got a version of WLED to work on these boards. Version 0.13.3 works and this version retains its memory.

So with that said:
I have a first ornament, with my first (supposedly the same) ESP01S, running 0.14.0 just great. Loaded from the website, it functioned flawlessly outside my early goof ups. I’m curious about the hardware differences too, but I don’t really want to take this one apart.

I have a second ornament, containing the first problematic ESP01S, that forgets its settings, running 0.14.0, that is just as soldered down and glued together as the first. Being as it also forgets which pixel strips are soldered to it, I may have to tear this one down anyway.

I have the third ESP01S on my USB dongle now, running 0.13.3 whenever I plug it in. I look for a custom named AP, which tells me it hasn’t forgot its settings.

#4 is my control. We can run AT commands here, if needed.

#5 (unmentioned yet) will stay in its wrapper until this is all sorted out.

Just to be clear, these MCUs came in a strip package from a factory-supplied roll. These weren’t repackaged and resealed like some are.

And, it may seem silly that it’s just one version out, but these are envisioned to work together, even though they are independent on the tree, or even all over the house. With each version there are new patterns and features, and I don’t want to run into any conflicts. I’m sure you guys understand!

If there is anything you need me to try, just let me know. I didn’t really want to get into writing custom firmware, but I’m no stranger to electronics. I think at this point I am approaching something that I need more familiar folks to help with.

I was poking around last night with the two ornaments, one that retained its settings, one that did not, both running v0.14.0. I came across this:

The filesystem field (working installation) shows a filesystem capacity. Now for the installation that cannot retain its settings:

We have a 0/0 kB, with an undefined percentage remaining. I’m guessing this installation cannot find the nonvolitile memory?

That looks like a classic “initial flash” problem.
I’m not an expert on the ESP01S, but I know I’ve seen posts about getting the 1st flash done properly.
From what I recall, the recommended path is via esptool(?) at the moment.

I’d suggest starting from scratch and try to wipe that board and do an initial bootloader install followed by a WLED version (2 steps). If it works better, you could try to get V0.13.3 up and then OTA to V0.14.

There does seem to be some “chatter” in the development circles that V0.13.3 is safer for 8266 boards at the moment.

13.3 looks like it doesn’t support OTA…

Let me see if I can get a 14.0 pre-release working. Maybe one of these nightly builds has OTA but hasn’t interfered with my ESP01S.

Still have no idea what’s so special about these 5 MCUs.

I’m pretty sure OTA has been in since V0.12 (or earlier).

One trick I’ve had to use for smaller memory ESP’s (8285’s in my case) - the .bin file needs to be compressed to allow enough room for the OTA to proceed. I just ran the standard .bin through 7-Zip and created a .gz (g-zip) version. I used that in place of a bin and the OTA ran just fine. BTW, you can use that file with Chrome installer as well.

Might be worth a try

I’m pretty sure if you can get a V0.13.3 loaded to give you a proper FS (about 499K on 8266’s, 1024K may be too big for the ESP01S) you’ll be in good shape. Without a FS, WLED has nowhere to save any settings, presets, configs, etc. The size has to be right for the version and chip type.

Where have you been getting your .bin files for the flash?

Support for OTA on esp01 is not there as it is disabled in the environment


Also for a stable setup on esp01 might be a good idea to stay on 0.13.3 as updating to 14 might not be a good idea from the feedback we received from others ( I personally tested 0.14.0-b1 and it was okish but not a detained test ). More info here OTA update for 1M flash size? · Issue #2040 · Aircoookie/WLED · GitHub

@divsys

I’ve been getting my binaries form https://github.com/Aircoookie/WLED/releases.
I may have to give the FS compression trick a shot. I haven’t heard of that one yet and it may be what I’m looking for.

@ALDIY
That’s a little discouraging, but to be truthful I haven’t tallied up what I would be losing between the two versions. Would different WLED instances have any problems with synchronized programming? I haven’t tested v0.14.0-b1 yet, but I may get to that soon. I’ve been working down the list of releases looking for that one that doesn’t show any problems. I’m on -b4 right now, but it doesn’t look promising.

I still trying to figure out how my first one worked so well. And these others had so many issues. Judging by photographs, it looks to have been loaded around November 20 (2023) or so. I’m wondering if it got another load and OTA may have updated it.

I have technically stopped using all esp8266 in production and i only have test units but a lot of them , what i have tested with esp01s on 0.14.0-b1 is only to confirm stability for other users . The advise to stay on 0.13.3 for esp01s and even all esp8266 came direct from the only active developer working on wled so you might be better off taking the hint and i believe you will not miss much to go to latest but you could have a use case so might be try it out and make up your own mind as you might actually help identify bugs or bottlenecks

@divsys
I finally couldn’t take it anymore and pulled apart the working ornament to discover what could possibly look like an ESP01S and still run v0.14.0. What I found was this:


The flash module on this particular board is a GigoDevice GD25Q16C 16Mb. Looking at the other problematic boards, it looks like they are all 8Mb flash modules, Zbit Semi ZB25VQ80.

So my questions now surround the software’s determination of 1Mb memory.

  1. Is this something that is hard written for ESP01S binaries for WLED, since flash size could be anything (at current) from 512k to (apparently) 16Mb?

  2. Should another binary be more suitable for 8266EX and larger flash sizes, to take advantage of the extra flash?

  3. Or is this something a custom binary should be compiled for?

I figured it out. It may have been spoken about and lost in internet shorthand but here it is.

The part numbers are in bits. Not bytes.

So, the one ESP01S that runs WLED v0.14.0 so well, loaded it automatically from install.WLED.me, and continues to confuse everyone indeed has a 16M bit flash, or rather, 2M bytes of flash. This is plenty to run the latest WLED.

As for the other 5 that I have, they have only 8M bit flash, or 1M byte. This is typical of an ESP01S mcu and normally would not run WLED v0.14.0.

This all now makes plenty of sense and may just be the solution. The only thing left to do is test with real hardware and establish more than one case. I’m sure to do it eventually, but not this week.

I’m sure with the fresher versions of the ESP01S hitting the markets with larger flash chips, this issue may come along again to a newbie who just happens to use this mcu, like I did. After all, they are fantastic for small battery-powered builds, running on 3.3V and being so small.

ESP01 (s or non-s) with 1MB flash can run 0.14 without any issue*.
I have bunch of them.

The * means with limitations imposed on ESP8266 in general.

@blazoncek
Well, that’s not exactly what I’m finding here. It seems my 1MB versions are having issues, while my one that runs smoothly just happens to have a 2MB chip.

I’m about to test my theory in full, but I’m waiting on a package of flash chips to arrive. Until that happens, much of this talk about flash size is speculation.

Perhaps you have faulty devices.

I don’t think so. After all, they all work on WLED v0.13.4. But this is to be expected with ESP01S boards.

OK so finally my strip of new flash chips have arrived and I got to confirm our suspicions. Long story short, flash size makes the difference.

The old chip was unsoldered from the board and replaced with a new Winbond 25Q32F. With 4MB of storage, it will be more than enough for future projects. After that all basic procedures (website install, automatic, v14.0 WLED) worked as expected.

So here is what we found out:

  1. ESP01S boards should come with 1MB of flash. This is too small for WLED v14.0+, and normally will not work.

  2. Some lucky ESP01S boards are coming from board houses with larger flash memory sizes. This would be the case of my first ESP01S board, which ran 14.0 without issue.

  3. If you have the ability, you can take these little boards and add larger flash chips to them. This seems to work fine, as long as you can solder tiny components. The only drawbacks I can see from swapping flash chips is the system only displaying a filesystem size of 1024 kB on the Info tab. This does not seem to affect operation, however.

In light of all of this, I think the limitations should still be advertised as ESP01S boards run v13 or earlier, since the typical board will most likely be supplied with a 1MB chip. If all boards were coming out with latger sizes, then that would be something else to consider.