Chat freely about anything...

User avatar
By petoknm
#14264 Hi!
I am using the Unofficial Dev Kit for ESP8266. Under examples I started modifing the esphttpd project. I got it up and running but I don't understand whether it should remember the AP to connect to after restart or not. Because when I connect to the Wifi hosted by the ESP8266 and go to 192.168.4.1 and go to wifi settings and select the AP and password it then connects to it and works. But after resetting it , it doesn't reconnect to it. I have to manually connect to the ESP6266 and tell it to connect again. So I looked at the documentation of the 0.9.5 SDK and there is a function called wifi_station_set_auto_connect() but I still don't know how to use it... What do I have to do to make it remember the AP settings and reconnect after reset? What setting does it use to auto connect(the last one)? Thanks.

EDIT
Now I figured out a way for it to autoconnect to a predefined AP(at compile time). But I want it to accept an SSID and password dynamically(through a webpage) and store that and use that to autoconnect... Is something like that possible? if not I am thinking about writing the data to RTC memory and then reading it at startup... Are there any better alternatives? Thanks.
User avatar
By Cicero
#19910 I'm also looking at trying to do this as well - haven't got very far with it but I'll share my thoughts and whatnot as I go.

I find the example works as you say, then after I click connect (after selecting the wifi SSID and password I want to connect to), it seems to restart and not connect.

It prints out this continuously every second:
scandone
no MYAP found, reconnect after 1s
reconnect

Looking at user_config.h, MYAP is there, and I presume that after clicking connect above, its not saved in flash. So I think thats what needs to happen, and where I'm going now.

EDIT: So turns out I was using the version 2.0.3 - which must have had a bit of a buggy esphttpd project, because the latest SDK download (v2.0.5 22 May 2015) from CHERTS works pretty well, also the esphttpd project has been cleaned up a lot!