Aircoookie / Espalexa

Alexa voice control for ESP8266/ESP32 (including brightness and color!)
MIT License
548 stars 137 forks source link

Use ESP32's AsyncUDP when ESPALEXA_ASYNC requested #212

Open DeLoachAero opened 1 year ago

DeLoachAero commented 1 year ago

When running on an ESP32 and choosing ESPALEXA_ASYNC, this PR changes the UDP implementation to async as well as TCP/web server. This change solves a memory fragmentation issue for ESP32 devices that results in WiFiUdp's parsePacket getting memory allocation errors causing CPU restarts. The async model also fixes the "flush" problem reported in PR#181 dropping packets since the async model delivers all packets it receives even on busy networks.