Hello !
TL;DR: How can I have AP and STA at the same time, configuring SSID, Password and/or IP Address, Gateway, SubnetMask, DNS while also serving pages using ESPAsyncWebServer to the user giving it the possibility of configuring the previously mentioned parameters and much more.
Right now, my code is separated into two blocks: AP and STA.
While in AP, I give the end-user the possibility of configuring SSID, Password and/or IP Address, Gateway, SubnetMask, DNS.
After the values were entered and saved, the ESP restarts and tries a WiFi.begin(SSID, Password); followed by WiFi.config();
And in STA I have the "functional" code, depending on the project at hand.
I would like to eliminate the ESP.restart() that separates the two WiFi modes and the transition time from one mode to the other. I would like to offer the user a smooth experience while setting up the ESP32.
Can I use STA and AP at the same time ?
-
- Posts: 160
- Joined: Thu Jan 31, 2019 2:32 pm
Re: Can I use STA and AP at the same time ?
You can just use WiFi.mode(WIFI_AP_STA); and than WiFi.begin(SSID,PASSWORD); after the user set it on AP.
Or if it is not working like this, use the WiFi.disconnect() from AP mode and then set AP_STA and start wifi.
If the user configured the right credentials , i assume that they want to switch to the sta network anyway.
Or if it is not working like this, use the WiFi.disconnect() from AP mode and then set AP_STA and start wifi.
If the user configured the right credentials , i assume that they want to switch to the sta network anyway.
-
- Posts: 160
- Joined: Thu Jan 31, 2019 2:32 pm
Re: Can I use STA and AP at the same time ?
How would that look like ?zekageri wrote: ↑Mon Oct 28, 2019 2:19 pmYou can just use WiFi.mode(WIFI_AP_STA); and than WiFi.begin(SSID,PASSWORD); after the user set it on AP.
Or if it is not working like this, use the WiFi.disconnect() from AP mode and then set AP_STA and start wifi.
If the user configured the right credentials , i assume that they want to switch to the sta network anyway.
Who is online
Users browsing this forum: Google [Bot] and 86 guests