-->
Page 1 of 3

Switch between softAP and client mode?

PostPosted: Sat Jul 30, 2016 3:08 pm
by treii28
Is it possible in the arduino code support to software switch the ESP8266 between softAP server and wifi client?

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)

I have another need that would require a similar ability to turn 'off' the softAP and connect to an existing wifi then switch back again.

Is this possible within the arduino ESP code?

SW

Re: Switch between softAP and client mode?

PostPosted: Sat Jul 30, 2016 5:06 pm
by martinayotte
It is up to your code to manage that switching using WiFi.mode(WIFI_AP_STA) and WiFi.mode(WIFI_STA).

Re: Switch between softAP and client mode?

PostPosted: Sat Jul 30, 2016 8:58 pm
by treii28
OK, but - I can't seem to find any examples of it. Is there a reference on WiFi for the ESP8266 that is worth a damn? Knowing 'yes you can' and knowing 'how' to do it are two different things. I've been googling on it all day and keep finding false hits or information about setting up more than one server. Nothing on switching.

Re: Switch between softAP and client mode?

PostPosted: Sat Jul 30, 2016 9:03 pm
by treii28
In other words, every example I find either says run WiFi.softAP() OR ways run WiFi.begin().

All the examples I find seem to assume you are either running a client or configuring an access point. I can find no examples that match both other than one post to some forum asking 'can you do this' in the context of the AT command set and the answer being 'no, not without reprogramming the firmware'