When in WIFI_AP
mode all goes well, but when in WIFI_STA
mode it is still in WIFI_STA_AP
mode.
How do I set the WiFi to station only with no software access point available.
if(wmode == "AP") {
Serial.println("Starting in AP mode");
WiFi.mode(WIFI_AP);
WiFi.softAP(ssid, pwd);
WiFi.softAPConfig(charToIPAddress(ip), charToIPAddress(gateway), mask);
} else if (wmode == "STA") {
Serial.println("Starting in STA mode");
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, pwd);
WiFi.config(charToIPAddress(ip), charToIPAddress(gateway), mask);
}
EDIT: this is not about wmode
, this code's if
statement works fine, re: arduino String class operator (shorthand)