prevent STA warning

This commit is contained in:
proddy
2026-06-08 20:44:00 +02:00
parent 2102180c46
commit afee7246c6

View File

@@ -82,7 +82,7 @@ void Network::begin() {
WiFi.persistent(false); WiFi.persistent(false);
WiFi.setAutoReconnect(false); WiFi.setAutoReconnect(false);
WiFi.mode(WIFI_STA); WiFi.mode(WIFI_STA);
WiFi.disconnect(true, true); // wipe old settings in NVS WiFi.disconnect(true); // turn STA off; don't eraseap here (STA netif not started yet -> log_e, and persistent(false) means nothing is in NVS anyway)
WiFi.setScanMethod(WIFI_ALL_CHANNEL_SCAN); WiFi.setScanMethod(WIFI_ALL_CHANNEL_SCAN);
WiFi.setHostname(hostname_.c_str()); // updates shared default_hostname buffer WiFi.setHostname(hostname_.c_str()); // updates shared default_hostname buffer
WiFi.enableSTA(true); // creates the STA netif WiFi.enableSTA(true); // creates the STA netif