-->
Page 1 of 1

Where to store SSID/Password? Flash? External EEPROM?

PostPosted: Wed Oct 21, 2015 11:49 pm
by jayeye
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

Re: Where to store SSID/Password? Flash? External EEPROM?

PostPosted: Thu Oct 22, 2015 3:07 pm
by jayeye
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

Re: Where to store SSID/Password? Flash? External EEPROM?

PostPosted: Fri Oct 23, 2015 7:44 am
by shoelessone
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

Re: Where to store SSID/Password? Flash? External EEPROM?

PostPosted: Thu Oct 29, 2015 2:48 am
by svkatielee
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