Open gmag11 opened 3 years ago
I can confirm this behabiour. But I've found a workaround. Turning WiFi to OFF mode and setting it to the previous mode seems to restart WiFi interface and restores ability to receive broadcast messages.
This means:
uint8 mode = wifi_get_opmode();
wifi_set_opmode(0);
wifi_set_opmode(mode);
If you are Arduino framework this code is equivalent:
WiFiMode_t mode = WiFi.getMode ();
WiFi.mode (WIFI_OFF);
WiFi.mode (mode);
I've tested that this works even after several consecutive network scans
I've been playing with esp-now for a long time. Until now I've always used unicast messages, but for a new project I'd like to use broadcast.
For testing, I've written a program that sends a broadcast message and a unicast message every 10 seconds from one esp8266. Another one is configured to print data over serial when a packet is received.
If I trigger a WiFi network scan it stops receiving broadcast messages but is still able to receive unicast messages. This stays so until I reboot ESP.
This is the output log: