-->
Page 2 of 3

Re: Switch between softAP and client mode?

PostPosted: Sun Jul 31, 2016 10:01 am
by martinayotte
treii28 wrote:asking 'can you do this' in the context of the AT command set and the answer being 'no, not without reprogramming the firmware'

Of course, this can not be done with AT firmware, you have to write your own code. Since we are here is ArduinoESP sub-forum, AT commands are not exist anymore after uploading any sketch.

When running WiFi.softAP(), you simply need to add WiFi.mode(WIFI_AP_STA) before.
when running WiFi.begin(), you simply need to add WiFi.mode(WIFI_STA) before.

For some examples, look at https://github.com/esp8266/Arduino/tree ... i/examples
Even if those doesn't explicitly use WiFi.mode(WIFI_AP_STA) and WiFi.mode(WIFI_STA), simply add them.

Re: Switch between softAP and client mode?

PostPosted: Sun Jul 31, 2016 12:34 pm
by bbx10node
treii28 wrote:I have a couple of things on a single program that could use this type of functionality. First, I would like to be able to connect to the ESP8266 to configure my home SSID (or change it as needed if I'm not near my home wifi)

Once the SSID is set, I want to then switch out of access point mode and connect to the 'known' network if possible. (if not, switch back to AP mode and wait for another connection)


WiFiManager does what you described. Install it using the Arduino IDE library manager.

https://github.com/tzapu/WiFiManager

If you want to do other things, look at the WiFiManager source code to see how it switches between AP and STA modes.

Re: Switch between softAP and client mode?

PostPosted: Fri Aug 12, 2016 8:41 pm
by Davidjb
Just a thought. You could store the mode to the EEPROM and some code. Store a vaule in the EEPROM and code which mode to begin in.

Re: Switch between softAP and client mode?

PostPosted: Fri Sep 16, 2016 7:55 am
by Joepjee
Hey! I was wondering if you already figured it out? I am stuck with the same problem. Would be really nice to get some help on this. Thanks in advance for your findings!