Skip to content

ESP32 Wifi settings not saving #271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Boricuatec opened this issue Oct 21, 2019 · 28 comments
Closed

ESP32 Wifi settings not saving #271

Boricuatec opened this issue Oct 21, 2019 · 28 comments
Labels
stale This issue will be closed soon because of prolonged inactivity

Comments

@Boricuatec
Copy link

Thanks for making this project! I was able to download the ESP32 binary from https://github.com./Aircoookie/WLED/releases and upload so thats all good! But when I hit the webserver and try to configure my SSID and password it wont connect to it. I also noticed when I change the LED count from 30 to 300, it does not keep that setting. If I restart the ESP32 it always goes back to 30. Is there something special about getting the ESP32 to save those settings? Is there a forum I could access to have others help me?

@raoulteeuwen
Copy link

Can you link to the shop and device you're using? Just to check whether you have the right binary.

@Boricuatec
Copy link
Author

@raoulteeuwen
Copy link

Thank you @Boricuatec , sorry for asking, just checking. Seems fine ;-).

Do you have 2 ESP's or another controller you can try, to rule out a defective ESP / hardware?

@chris89178
Copy link

Hi. I have the same problem. I verified this with two esp32 WROOM32. None of the changed settings are stored after reboot.

@raoulteeuwen
Copy link

Mmmm, wondering whether the WROOM has some specific problem. Any chance you could try with another ESP, not a WROOM? Like https://nl.aliexpress.com/item/32647690484.html?spm=a2g0s.12269583.0.0.6136735667kiQe ?

How are you powering the ESP? While trying to find a possible problem, i found espressif/arduino-esp32#2969 .

I also found https://esp32.com/viewtopic.php?f=19&t=4657 , hinting to some problem with (writing/)reading.

@brentbrooks70
Copy link
Contributor

brentbrooks70 commented Oct 21, 2019

@raoulteeuwen It cannot be ESP-WROOM-32 specific as I have tested on two different ESP-WROOM-32 boards:

  1. Adafruit HUZZAH32 – ESP32 Feather Board
  2. HiLetgo ESP-WROOM-32 ESP32 ESP-32S

and both have no issues writing and reading WiFi Setup, LED Preferences, User Interface or Sync Interfaces settings across several reboots. Possibly the implementation of them by the manufacturer.
@raoulteeuwen could be on to something with his last comment from esp32.com were it seems some boards are being sent out with issues saving to EEPROM.

@Boricuatec I would try a different manufacturer of ESP32 and see if your issues persist. Can you try to run the eeprom_class example that should have been installed with the board definition? That is assuming you are using Arduino IDE.

@sansillusion
Copy link

sansillusion commented Oct 21, 2019 via email

@Digittt
Copy link

Digittt commented Oct 21, 2019

I'm on an ESP8266 and having the same issue. Loaded onto another ESP8266 2 days ago and that worked no problem.

Think it's either down to dud flash, or I've got a model ESP8266 that can't handle the memory settings. Effectively I can access WLED via the access point...whenever I try save changes as above (to either the AP or the LED settings), it resets and doesn't save the new settings.

Have got around this by changing the AP settings in the WLED00.ino file. It then works, although I cannot adjust the LED count. Issue appears to be that as soon as I use WLED to save the settings, the chip reboots. If I flash the sketch with it, it's fine. Not clever enough to know why that might be the case, although suspect it could be to do with the model ESP8266 I am using.

@Aircoookie
Copy link
Member

Thank you for all the reports!
I believe that this issue is due to an invalid SPIFFS configuration. You can try esptool.py erase_flash, it can often help with flash related issues.
ESP8266 users who build from source: Please make sure you select "Flash size: 4M (1M SPIFFS)"
ESP32 users: Seems like I made a mistake with the binary... I'll check and replace it if it is indeed faulty!

@Boricuatec
Copy link
Author

@Aircoookie Thanks for looking into this, when do you plan on updating this? I would love to try it out and see if it works.

@Aircoookie
Copy link
Member

@Boricuatec just pushed the new code to master! Might not yet work well though, will release a binary tomorrow!

@Boricuatec
Copy link
Author

Boricuatec commented Oct 24, 2019 via email

@Boricuatec
Copy link
Author

Boricuatec commented Oct 28, 2019

@Aircoookie Okay so it's partially working. I can now set the WIFI and it will connect which is awesome. But it the device gets powered down and restarted it, the wifi credentials are reset to default. Basically it wont reliably keep the settings even in the Wifi settings section.

@Aircoookie
Copy link
Member

@Boricuatec ok, so it seems like there is no issue with WiFi then, but the saving of settings fails, probably due to a somehow invalid flash configuration. Did you try esptool.py erase_flash?

@Boricuatec
Copy link
Author

@Aircoookie It worked but I still think there is an issue. I used the esptool to erase flash. But I think that the save button in wifi settings is not really committing it to storage. If I get it on wifi then go in to the security and updates then tell it to save it reboot then it will save it. I could be completely wrong but I have flashed this device and another over and over again and it may have been the saving to storage that was the problem the whole time maybe??? They are working now so I am happy, I have to say I am totally loving your damn WLED! Great work! Also I saw your webcast with DRZZZs the other day! Great job!!!

@Aircoookie
Copy link
Member

Tomorrow I will flash the binaries onto brand new ESPs and see if i'll be able to reproduce your findings!

@ggrant111
Copy link

ggrant111 commented Nov 7, 2019

Was someone able to come up with a solution? I installed the current .bin using ota programmer and having same issue. Can connect to AP but when I save settings for my local network and reboot everything is reset to defaults. Awesome program though! Great job!

@Aircoookie
Copy link
Member

Sorry for taking so long on this!
I couldn't reproduce any issue with the settings not saving yet...
What I reproduced though is another issue: espressif/arduino-esp32#2501
Basically, in some cases the wifi only reconnects every second attempt. The auto reconnect will take care of this though and the ESP will connect after 5 minutes. Alternatively, power cycling or saving the wifi settings from AP once again will also work.

Here is a new binary, please test if it solves the saving issue. I'm a bit tapping in the dark with that one, so this will probably not solve the issue, but here you go:
https://drive.google.com/open?id=1n1zE7rhBjg5QrfP3Y3VKmudvXFgVnCYz

@ggrant111
Copy link

ggrant111 commented Nov 10, 2019 via email

@Ukhauk
Copy link

Ukhauk commented Nov 17, 2019

For info I have the same issue WiFi credentials not saved after a reboot using the latest bin file
WLED_0.8.6_1911081_ESP32.bin board type is a wemos d1 r32

@ggrant111
Copy link

ggrant111 commented Nov 17, 2019 via email

@Ukhauk
Copy link

Ukhauk commented Nov 19, 2019

I am trying to erase the ESP32 and re flash can anyone confirm I am doing the basics correctly an I missing anything extra when downloading a pre-compiled bin file ?

esptool.py --port /dev/ttyUSB0 --chip esp32 erase_flash

esptool.py --chip esp32 --port /dev/ttyUSB0 write_flash -z 0x1000 ~/Documents/Wled/WLED_0.8.6_ESP32.bin

Its worth mentioning I can't get the OTAWebUpdater arduino sketch to connect to my network either so think something is corrupted somewhere. Update!! OTAWebUpdater now works after updating to latest ESP32 in the Arduino board manager.

Any help appreciated

@Ukhauk
Copy link

Ukhauk commented Nov 19, 2019

Just an update in case anyone else having the same issues am I doing something wrong ?
I clear the ESP32 (ESP32DOWDQ6 revision 1) using the commands
esptool.py --port /dev/ttyUSB0 --chip esp32 erase_flash
uploading the standard esp8266 OTAWebUpdater program connects to my wifi
using this to upload wifi credentials still don't save and connect after a re-boot
WLED_0.8.4_ESP32.bin
WLED_0.8.5_ESP32.bin
WLED_0.8.6_ESP32.bin

@Aircoookie
Copy link
Member

@Ukhauk did you try not setting a memory offset in esptool? Try this command:
esptool.py --chip esp32 --port /dev/ttyUSB0 write_flash -z 0x0000 ~/Documents/Wled/WLED_0.8.6_ESP32.bin

I'm not sure, but it might help :)

@Ukhauk
Copy link

Ukhauk commented Nov 20, 2019

Hi Aircookie thanks for suggestion I have tried the above clearing the flash and esptool.py --chip esp32 --port /dev/ttyUSB0 write_flash -z 0x0000 ~/Documents/Wled/WLED_0.8.6_ESP32.bin
WLED doesn't run and I get the following error on the serial port rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) flash read err, 1000 some google searches suggest this is a boot loader issue. I have 3 ESP8266 boards working without issue so its not critical to get this esp32 board working just thought it useful to report save other users.

I managed to get the OTAWebUpdater loaded by updating the ESP32 board manager to the latest revision. If I download WLED_0.8.6_ESP32.bin over the air I still can't save ths Wifi configuration as reported in this issue. I have the same issue with older version WLED_0.8.5_ESP32.bin

@LArivee15
Copy link

I have the same issue on a wemos d1 mini ESP32 board. I have uploaded by USB and OTA using OTAWebUpdater and connected to WLED_AP but on power cycle/reboot the WiFi credentials have returned to default. I have cleared the flash and re-uploaded with no success. I too have tried with previous versions of WLED none of these seem to work.

I tried recompiling in platformio with hard-coded credentials but it was my first time with platformio and I am getting errors I cannot resolve at the moment.

@andree182
Copy link

For the record, I have the same issue with "DOIT Esp32 DevKit v1", both 0.8.5 and 0.8.6 behave the same (only "remembers" settings until reset)

@stale
Copy link

stale bot commented Apr 7, 2020

Hey! This issue has been open for quite some time without any new comments now. It will be closed automatically in a week if no further activity occurs.
Thank you for using WLED!

@stale stale bot added the stale This issue will be closed soon because of prolonged inactivity label Apr 7, 2020
@stale stale bot closed this as completed Apr 14, 2020
netmindz pushed a commit to netmindz/WLED-MM that referenced this issue Jul 28, 2024
SR 0.13.4 release updates, part1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This issue will be closed soon because of prolonged inactivity
Projects
None yet
Development

No branches or pull requests