ESP_NOW broadcasts stop working after light sleep
Posted: Thu Jul 18, 2024 11:22 pm
This is the code that runs before and after light sleep:
```
WiFi.disconnect();
WiFi.mode(WIFI_OFF);
esp_now_deinit();
esp_sleep_enable_timer_wakeup(sleepTime);
esp_light_sleep_start();
WiFi.mode(WIFI_STA);
if (esp_now_init() != 0) {
Serial.println("Error initializing ESP-NOW");
return;
}
esp_now_register_recv_cb(OnDataRecv);
esp_now_register_send_cb(OnDataSent);
```
and while i can receive directed messages, receiving Broadcasts stops working?
I'm using an esp32 S3, arduino as framework and i'm including
```
#include "Arduino.h"
#include "esp_now.h"
#include "WiFi.h"
```
What could I be doing wrong?
```
WiFi.disconnect();
WiFi.mode(WIFI_OFF);
esp_now_deinit();
esp_sleep_enable_timer_wakeup(sleepTime);
esp_light_sleep_start();
WiFi.mode(WIFI_STA);
if (esp_now_init() != 0) {
Serial.println("Error initializing ESP-NOW");
return;
}
esp_now_register_recv_cb(OnDataRecv);
esp_now_register_send_cb(OnDataSent);
```
and while i can receive directed messages, receiving Broadcasts stops working?
I'm using an esp32 S3, arduino as framework and i'm including
```
#include "Arduino.h"
#include "esp_now.h"
#include "WiFi.h"
```
What could I be doing wrong?