Arduino icon indicating copy to clipboard operation
Arduino copied to clipboard

How to get the AP configuration with ESP8266 classes? (AT+CWJAP_DEF?)

Open odilonafonso opened this issue 10 years ago • 5 comments

I want to know if the ESP-12e has already set the SSID and PASSW settings. With a AT firmware I use the AT+CWJAP_DEF? command from arduino sketch. Now I want to do the same on ESP8266 ESP-12e module, with the ESP8266WiFiClass (and similar) The goal is to start a ESP module, if there is a Station access set use it; if not, set the AP mode, load a webserver in 192.168.4.1 and get the credentials (ssid and password). Then, restart and use the credentials. But, some times this works, sometimes not.

odilonafonso avatar Jan 15 '16 18:01 odilonafonso

Take a look at the ESPWiFi.h. file- you should find all functions you need.

andig avatar Jan 15 '16 19:01 andig

It has almost nothing there. Is that I'm with the wrong library?

odilonafonso avatar Jan 15 '16 19:01 odilonafonso

I recommend the WiFimanager library by @tzapu.

On Jan 15, 2016, at 10:46 AM, odilonafonso [email protected] wrote:

I want to know if the ESP-12e has already set the SSID and PASSW settings With a AT firmware I use the AT+CWJAP_DEF? command from arduino sketch Now I want to do the same on ESP8266 ESP-12e module, with the ESP8266WiFiClass (and similar) The goal is to start a ESP module, if there is a Station access set use it; if not, set the AP mode, load a webserver in 19216841 and get the credentials (ssid and password) Then, restart and use the credentials But, some times this works, sometimes not

— Reply to this email directly or view it on GitHub https://github.com/esp8266/Arduino/issues/1438.

mtnbrit avatar Jan 15 '16 19:01 mtnbrit

Ist this what you need: https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.h

andig avatar Jan 15 '16 20:01 andig

Yes andig! This is OK !

Hey mtnbrit... cool WiFiManager !!!

Thanks !!

odilonafonso avatar Jan 15 '16 23:01 odilonafonso