-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
EEPROM Lost after Reboot/Power Off NODEMCU V3 #1486
Comments
Does your esptool.py contain this fix? Off topic, but do you know that it's not necessary to use EEPROM to save SSID/password? These are stored by the SDK itself, so for most use cases you can just set SSID/password once and the ESP will connect automatically. |
Hi @igrr, thank you for your reply. the reason i am saving and loading ssid/pass from EEPROM is due to the fact that the board starts 'unconfigured' in default - meaning, enters AP mode for user to be able to set his own ssid/password via http. After the user saves this,data gets saved into EEPROM and board is rebooted. From now on board is connecting to the AP configured by user. Will download from https://github.com/themadinventor/esptool and report back if success. |
Ok, downloaded newest esptool from the url provided above, copied to Arduino IDE - still trash in EEPROM after reset. EEPROM ADDRESS: 0 VALUE: � Everytime i reset the board i get different values. Tried clearing 512 with ZEROES (0) No change, after powering off/on trash again. |
Okay, does |
Good point, EEPROM.commit(); returns false; even though, i see EEPROM is written, until reboot. |
Please check that your flash size setting in the IDE matches the size of your flash chip. |
I have three LoLin Nodemcu V3 - boards and they all return correct configuration. The issue may lie with your setup instead; I am using Arduino IDE 1.6.7 and the latest ESP8266-code from Github. |
@WereCatf , do you code on Mac OSX too? |
@codemasterPL No, I use Linux for that. You could try installing IDE 1.6.7 and latest code from Github on OSX and seeing if the problem goes away, and if it doesn't then you could install Linux in a virtual machine and testing there -- if it works with Linux with 1.6.7 and latest Github, but not under OSX with the same then it's a platform-specific bug in the tools/code and needs to be fixed. |
Got an idea... Perhaps esptool.py overwrites binary image header which contains flash size configuration? That would explain why CheckFlashConfig reports "Flash ide size: 524288". |
The behavior you are observing is explained as follows: when IDE compiles the sketch, it sets the flash layout (via a linker script). However in your case run-time configuration differs from compile-time one. This means that EEPROM library tries to use sectors which are out of bounds, leading to these issues. |
@igrr Connecting... Writing at 0x00000000... (0 %) |
default for esptool.py is 512K you need additional parameters.
https://github.com/Links2004/esptool/blob/master/esptool.py#L556-L557 |
Thank You @Links2004 , picked 32m. Flash real id: 001640E0 Flash ide size: 4194304 Checking EEPROM |
Good news! Worked like a charm! Thank you all for your input! |
Hi Guys,
So far i had no issues with programming Esp8266, great platform for IoT until i started saving/loading configuration to/from EEPROM.
The Setup i am having:
Mac OSX 10.11.2 (El Captain)
Arduino IDE: 1.6.7
Programmer: pyesptool (only this one works with Mac)
Board: LoLin Node MCU V3 (http://www.upgradeindustries.com/media/ebay/Photos/nodemcu_new/nodemcu_front_wm.jpg)
I used Arduino Board Manager to download Board from the address provided here:
http://arduino.esp8266.com/stable/package_esp8266com_index.json
programmers.txt
pyesptool.name=pyesptool
pyesptool.communication=serial
pyesptool.protocol=esp
pyesptool.program.protocol=esp
pyesptool.program.tool=pyesptool
pyesptool.program.extra_params=
platform.txt
tools.pyesptool.cmd=esptool.py
tools.pyesptool.cmd.windows=esptool.exe
tools.pyesptool.path={runtime.ide.path}/hardware/tools/esp8266/pyesptool
tools.pyesptool.program.params.verbose=""
tools.pyesptool.program.params.quiet=""
tools.pyesptool.program.pattern=python "{path}/{cmd}" {program.verbose} --port "{serial.port}" write_flash 0x00000 "{build.path}/{build.project_name}.bin"
Problem:
I can easily save/load data from EEPROM as long as ESP8266 is powered ON.
When i poweroff and poweronn - EEPROM comes back with random values
Code:
Please let me know if there is anything else i need to share, i am new to this world - be patient :)
The text was updated successfully, but these errors were encountered: