Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By CheapB
#13765
draco wrote:I would suggest that you just hardcode the address and length in your program, if all you need to store are the SSID and password.

For example, write your SSID into byte 0, with a length of 32.
Then write your password into byte 33, with a length of 64.

32 and 64 are the maximum lengths permitted for SSID/password, according to the standards. No overhead wasted on metadata in your tiny EEPROM space available that way, and you've ensured that you have enough space available for any SSID/password combination possible.

But, realistically, you might not even need to do that. In my experience, the ESP8266 is already storing the SSID and password by itself somewhere, so if you just start it up and tell it to connect, it will use the previous SSID/password.


Thanks for the feedback.

I need to store a few other values in addition to the SSID and password, but you could argue that the same format would work. I believe this is similar to my fixed length option above.

I agree the SSID and password is stored in the config but it need to get in there in the first place or if I move the module to a different network. I will have multiple of these running on different networks. Unless I am missing something here I would have to connect using the AT firmware and then setup the SSID and password and then flash my firmware to make this work without EEPROM. If I wanted to move a module to another network I would need to reflash it with the AT firmware and reset the SSID/password and then reflash my code.

Another and maybe better option would be to have WiFi.begin(ssid, pass); to take default SSID and password like WiFi.begin(); this would take the SSID and password stored in in the config area.
User avatar
By CheapB
#13776
timoline wrote:I think you want something like a dummy proof bootloader like:
https://github.com/sebastianhodapp/ESPbootloader

its not perfect yet, but i'm working on it...


Yes, I was thinking about doing something like that but I see several challenges. 1) Assuming you are running this in AP mode - the bandwidth where I am is so saturated that there will be an overlap in channels that has caused issues with connecting in the past. 2) How would you move the module to another network or if you change the password? I guess it could go in config mode if it is unable to connect.
User avatar
By HolgerW
#13778 I check every 10 seconds:
- Station Mode & got ip -- ok
- no ip, change to StationAP Mode
- StationAP Mode and got Station IP --> back to Station mode
- in StationAP mode i can connect and give new wlan parameters http://192.168.4.1/wlan=ssid,password, restart

It works since months for me. My router restart every night, all devices connect after a while, never had a problem.
Based on 9.2 AT Demo, pure C

Holger