Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By jayeye
#31988 How can I store the SSID and the password for the access point I'm using, so I don't have to hard-code it in my code? (I don't want to accidentally push it to github!).

I could use an external EEPROM, but that's an overkill. Is there a way to reserve a few bytes of flash and just use them for storing configuration information?

More generally, where would all this stuff be documented?

Thanks!

/ji
User avatar
By jayeye
#32058 NVM. I found my answer in the source:

A 4K chunk of flash is reserved to simulate EEPROM. The relevant code is in

esp8266/hardware/esp8266/1.6.5-947-g39819f0/libraries/EEPROM/EEPROM.{h,cc}, and the EEPROM examples work.

The 4K chunk is defined In esp8266/hardware/esp8266/1.6.5-947-g39819f0/tools/sdk/include/spi_flash.h:

#define SPI_FLASH_SEC_SIZE 4096
User avatar
By shoelessone
#32106 FYI, I know very little about the ESP8266 or the various "runtimes" but this tutorial has an AWESOME setup that I'm hoping to use myself - the setup forces the esp to create a wireless network if it's unable to connect. I'm guessing if you used this it would store the ssid/password in volatile memory of some sort, or at least not require you to put it into source control. If this wouldn't work for you, I'd be curious as to why not (for my own sake, because it seems near ideal for my use case but I'd be curious about others!). Anyway, here's the link:

https://www.hackster.io/noelportugal/if ... ton-e11841
User avatar
By svkatielee
#32520 I am using (with his permission) a library utility I found below. It uses the simulated EEPROM and works fine so far.
http://www.forward.com.au/pfod/CheapWif ... index.html

However it may be overkill for your app...
- Larry