File tree Expand file tree Collapse file tree 2 files changed +1
-9
lines changed
Expand file tree Collapse file tree 2 files changed +1
-9
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,6 @@ void espnowStart()
9393 if (wifiState == WIFI_OFF && espnowState == ESPNOW_OFF)
9494 {
9595 // Radio is off, turn it on
96- WiFi.useStaticBuffers (true ); // Fix for one to many ESP-Now bug, prior to ESP32 core v2.0.4: https://github.com/espressif/esp-idf/issues/8992
9796 WiFi.mode (WIFI_STA);
9897
9998 esp_wifi_set_protocol (WIFI_IF_STA, WIFI_PROTOCOL_LR);
Original file line number Diff line number Diff line change @@ -209,20 +209,15 @@ void wifiStart(char* ssid, char* pw)
209209#ifdef COMPILE_WIFI
210210 if ((wifiState == WIFI_OFF) || (wifiState == WIFI_ON))
211211 {
212+ WiFi.mode (WIFI_STA);
212213
213214#ifdef COMPILE_ESPNOW
214215 if (espnowState > ESPNOW_OFF)
215216 {
216- WiFi.mode (WIFI_MODE_NULL); // We must go Null before setting static buffers
217- WiFi.useStaticBuffers (true ); // Fix for one to many ESP-Now bug, prior to ESP32 core v2.0.4: https://github.com/espressif/esp-idf/issues/8992
218- WiFi.mode (WIFI_STA);
219-
220217 esp_wifi_set_protocol (WIFI_IF_STA, WIFI_PROTOCOL_11B | WIFI_PROTOCOL_11G | WIFI_PROTOCOL_11N | WIFI_PROTOCOL_LR); // Enable WiFi + ESP-Now
221218 }
222219 else
223220 {
224- WiFi.mode (WIFI_STA);
225-
226221 esp_wifi_set_protocol (WIFI_IF_STA, WIFI_PROTOCOL_11B | WIFI_PROTOCOL_11G | WIFI_PROTOCOL_11N); // Set basic WiFi protocols
227222 }
228223#else
@@ -266,8 +261,6 @@ void wifiStop()
266261 // If ESP-Now is active, change protocol to only Long Range
267262 else if (espnowState > ESPNOW_OFF)
268263 {
269- WiFi.mode (WIFI_MODE_NULL); // We must go Null before setting static buffers
270- WiFi.useStaticBuffers (true ); // Fix for one to many ESP-Now bug, prior to ESP32 core v2.0.4: https://github.com/espressif/esp-idf/issues/8992
271264 WiFi.mode (WIFI_STA);
272265
273266 // Enable long range, PHY rate of ESP32 will be 512Kbps or 256Kbps
You can’t perform that action at this time.
0 commit comments