Skip to content

Commit dd36722

Browse files
committed
fix(wifi): remove filters in end() instead of re-adding them
1 parent 5fe5ae0 commit dd36722

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎src/system/wifi/esp32SpiAtUdp.cpp‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,13 @@ bool WiFiUDP::end()
248248
_availableData = 0;
249249
_currentPosition = NULL;
250250

251-
// Re-enable filters.
252-
WiFi.messageFilter(true, "^Recv [0-9]* bytes", "\r\n$");
253-
WiFi.messageFilter(true, NULL, "\r\nSEND OK\r\n");
254-
WiFi.messageFilter(true, "^+IPD,[0-9]*:", "\r\n$");
251+
// Remove the filters beginPacket() added. Without this, every begin()/beginPacket()/end()
252+
// cycle re-adds duplicates and never frees them, eventually exhausting the ESP32's filter
253+
// table and making every further AT+SYSMSGFILTERCFG add permanently fail.
254+
WiFi.messageFilter(false, "^Recv [0-9]* bytes", "\r\n$");
255+
WiFi.messageFilter(false, NULL, "\r\nSEND OK\r\n");
256+
WiFi.messageFilter(false, "^busy p...", "\r\n$");
257+
WiFi.messageFilter(false, "^+IPD,[0-9]*:", "\r\n$");
255258

256259
// Disconnect from the server.
257260
if (!WiFi.sendAtCommandWithResponse("AT+CIPCLOSE\r\n", 2000ULL, 4ULL, (char *)("CLOSED"),

0 commit comments

Comments
 (0)