meshtastic / firmware

Meshtastic device firmware
https://meshtastic.org
GNU General Public License v3.0
2.97k stars 714 forks source link

[Feature Request]: Implement ESP32 BT / WiFi RF coexistance #4152

Closed Obliterous closed 1 week ago

Obliterous commented 1 week ago

Platform

ESP32

Description

Multiple projects with the ESP32 are able to use wifi and bluetooth at the same time; Can we please have this?

https://www.forward.com.au/pfod/HomeAutomation/Wifi2BLE/ESP32C3_BLE_WIFI/RF%20Coexistence%20-%20ESP32%20-%20%E2%80%94%20ESP-IDF%20Programming%20Guide%20latest%20documentation.pdf

Talie5in commented 1 week ago

Actual Espressif Doc Link: https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-guides/coexist.html Example Code: https://github.com/espressif/esp-idf/tree/master/examples%2Fbluetooth%2Fnimble%2Fbleprph_wifi_coex

Doing some reading/research on this, seems like if both are only needing to have small quick packets (eg, Bluetooth connection and sending MQTT over WiFi) you can keep it stable.

The moment you need to send some larger packets over wifi (thinking webclient being loaded from esp32 over wifi) that has some major issues and can lock out Bluetooth after that point, or cause early closure of the active transfer of the packet going over WiFi (only get a 100ms window) (think loading images or JavaScript packages of the webclient over WiFi)

Also the constant running software scheduler switching between Bluetooth and WiFi for their 50/50 share is going to draw more power usage/cpu cycles.