ESP8266 Developer Zone The Official ESP8266 Forum 2017-10-12T00:32:15+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=6874 2017-10-12T00:32:15+08:00 2017-10-12T00:32:15+08:00 https://bbs.espressif.com:443/viewtopic.php?t=6874&p=16377#p16377 <![CDATA[Re: AP caching in station mode]]> Statistics: Posted by blubb — Thu Oct 12, 2017 12:32 am


]]>
2017-10-11T17:11:55+08:00 2017-10-11T17:11:55+08:00 https://bbs.espressif.com:443/viewtopic.php?t=6874&p=16369#p16369 <![CDATA[Re: AP caching in station mode]]>
Thanks!

Statistics: Posted by blubb — Wed Oct 11, 2017 5:11 pm


]]>
2017-10-11T14:06:06+08:00 2017-10-11T14:06:06+08:00 https://bbs.espressif.com:443/viewtopic.php?t=6874&p=16368#p16368 <![CDATA[Re: AP caching in station mode]]>
Sorry that it is a typo, the ID number starts from 0. We will revise the documentation.

And for the AP caching, you can refer to the examles/iot_demo, #define AT_CACHE.

Thanks for your interest in ESP8266!

Statistics: Posted by ESP_Faye — Wed Oct 11, 2017 2:06 pm


]]>
2017-10-11T07:43:24+08:00 2017-10-11T07:43:24+08:00 https://bbs.espressif.com:443/viewtopic.php?t=6874&p=16355#p16355 <![CDATA[AP caching in station mode]]>
I have a question regarding the AP cache for station mode. I understand that ESP8266 can cache up to 5 APs is was successfully connected to. The SDK says:


wifi_station_ap_number_set

Sets the number of APs that will be cached for ESP8266 Station mode. Whenever
ESP8266 Station connects to an AP, it caches a record of this AP’s SSID and
password. The cached ID index starts from 0.


What I don't understand: Once cached, does ESP automatically connect to any of the cached APs if it comes into range? Or only the first (or zeroth) one? Is it my task to switch between them?

SDK says:


wifi_station_set_auto_connect

Set the ESP8266 Station to connect to the AP (whose ID is cached) automatically
or not when powered on. Auto-connection is enabled by default.



wifi_station_ap_change

Switch ESP8266 Station connection to AP as specified.
uint8 new_ap_id: AP’s record ID; start counting from 0.



wifi_station_get_current_ap_id

Get the current cached ID of AP. ESP8266 records the ID of each AP it connects
with. The ID number starts from 1.


Now that totally confuses me. The ID number, does it start from 0 or 1??

Statistics: Posted by blubb — Wed Oct 11, 2017 7:43 am


]]>