Chat freely about anything...

User avatar
By rith87
#24112 For the rest who are curious, here's the bit in the docs (which didn't seem obvious IMO) that eriksl was referring to:

Function:
Set whether ESP8266 station will connect to AP (which is recorded)
automatically or not when power on. Default to enable auto-connect.
Note:
Call this API in user_init, it is effective in this current power on; call
it in other place, it will be effective in next power on.
This configuration will be saved in flash system parameter area if changed.


@eriksl: Thanks a lot! I was expecting the APIs to be a complex graph but it actually seems pretty sparse :|.

Also, for an event driven way to handle the wifi connection, I believe we can use wifi_set_event_handler_cb(). Pretty excited to try it!
User avatar
By eriksl
#24121 Yes, the documentation... Don't get me started. But there is really useful information, just don't expect the level we're used to from big companies like Atmel, NXP, Microchip... Not everything is in there and some of it seems to be "secret" for no apparent reason.

I think the best starting point is to dissect an existing (simple) project and from that, the api becomes more clear.

For instance, normally, if you just want to run a tcp listener, you're not really interested whether wlan was connected or not. If it's connected, you will get connections, not connected, there will be none. There is not much you can do about that from the esp8266 other than wait for wlan connection.