(2299) ESPNOW: Peer interface is invalid
Posted: Wed Mar 10, 2021 5:34 pm
Hello,
I am using ESP-NOW on a M5StickC and I have this error when I try to add a peer. The peer is a M5Stack Fire.
I started with the following code (that works) and when I change a little bit this code, I got this error (2299).
What does it mean ? Where can I find a workaround ?
Kind regards,
Patrick.
I am using ESP-NOW on a M5StickC and I have this error when I try to add a peer. The peer is a M5Stack Fire.
I started with the following code (that works) and when I change a little bit this code, I got this error (2299).
What does it mean ? Where can I find a workaround ?
Code: Select all
uint8_t broadcastAddress[] = {0xF0, 0x08, 0xD1, 0xC7, 0x3E, 0xF8};
WiFi.mode(WIFI_STA);
if (esp_now_init() == 0) {
Serial.println("ESPNow Init Success");
}
else {
Serial.println("ESPNow Init Failed");
ESP.restart();
}
esp_now_register_send_cb(OnDataSent);
esp_now_peer_info_t peerInfo;
memcpy(peerInfo.peer_addr, broadcastAddress, 6);
peerInfo.channel = 0;
peerInfo.encrypt = false;
if (esp_now_add_peer(&peerInfo) == ESP_OK) {
Serial.println("Pair success");
}
else
{
Serial.println("Pair failed");
}
Patrick.