File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -207,20 +207,13 @@ void wifiStart(char* ssid, char* pw)
207207#ifdef COMPILE_WIFI
208208 if ((wifiState == WIFI_OFF) || (wifiState == WIFI_ON))
209209 {
210+ WiFi.mode (WIFI_STA);
211+
210212#ifdef COMPILE_ESPNOW
211- // If ESP-Now is active, reconfigure protocols
212213 if (espnowState > ESPNOW_OFF)
213- {
214- Serial.println (" Mixing WiFi into ESPNOW setup" );
215- // Enable WiFi + ESP-Now
216- esp_wifi_set_protocol (WIFI_IF_STA, WIFI_PROTOCOL_11B | WIFI_PROTOCOL_11G | WIFI_PROTOCOL_11N | WIFI_PROTOCOL_LR);
217- }
214+ esp_wifi_set_protocol (WIFI_IF_STA, WIFI_PROTOCOL_11B | WIFI_PROTOCOL_11G | WIFI_PROTOCOL_11N | WIFI_PROTOCOL_LR); // Enable WiFi + ESP-Now
218215 else
219- {
220- // Radio is off, turn it on
221- WiFi.mode (WIFI_STA);
222- esp_wifi_set_protocol (WIFI_IF_STA, WIFI_PROTOCOL_11B | WIFI_PROTOCOL_11G | WIFI_PROTOCOL_11N);
223- }
216+ esp_wifi_set_protocol (WIFI_IF_STA, WIFI_PROTOCOL_11B | WIFI_PROTOCOL_11G | WIFI_PROTOCOL_11N); // Set basic WiFi protocols
224217#else
225218 // Be sure the standard protocols are turned on. ESP Now have have previously turned them off.
226219 esp_wifi_set_protocol (WIFI_IF_STA, WIFI_PROTOCOL_11B | WIFI_PROTOCOL_11G | WIFI_PROTOCOL_11N);
You can’t perform that action at this time.
0 commit comments