From dceab074cad0a337af8aca97cbd338e729b0b8da Mon Sep 17 00:00:00 2001 From: cyberman54 Date: Sat, 6 Mar 2021 16:20:26 +0100 Subject: [PATCH] BT/WiFi coex fix needed for IDF4.1 --- src/wifiscan.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/wifiscan.cpp b/src/wifiscan.cpp index f57aab90..4e25d542 100644 --- a/src/wifiscan.cpp +++ b/src/wifiscan.cpp @@ -82,7 +82,12 @@ void wifi_sniffer_init(void) { void switch_wifi_sniffer(uint8_t state) { if (state) { - // start sniffer +// start sniffer +#if (BLECOUNTER) + // workaround needed for IDF 4.1 + // see https://github.com/espressif/esp-idf/issues/5427 + esp_wifi_set_ps(WIFI_PS_MIN_MODEM); +#endif esp_wifi_start(); esp_wifi_set_promiscuous(true); esp_wifi_set_channel(WIFI_CHANNEL_MIN, WIFI_SECOND_CHAN_NONE);