From 284d5256935c874707e6ac8e29f6fd4c2e26db38 Mon Sep 17 00:00:00 2001 From: dosas Date: Thu, 22 Aug 2024 21:14:46 +0200 Subject: [PATCH] Fix race condition in esp now communication (#1673) when calling mac address to fast after setting it happened on ESP32-WROOM-32E with IDF version > 5 Co-authored-by: dosas --- src/Communication/ESPNowStream.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Communication/ESPNowStream.h b/src/Communication/ESPNowStream.h index f367c2cbd..31d4a0cdf 100644 --- a/src/Communication/ESPNowStream.h +++ b/src/Communication/ESPNowStream.h @@ -112,6 +112,7 @@ class ESPNowStream : public BaseStream { LOGE("Could not set mac address"); return false; } + delay(500); // On some boards calling macAddress to early leads to a race condition. // checking if address has been updated const char *addr = macAddress(); if (strcmp(addr, cfg.mac_address) != 0) {