Bonjour,
j'ai eu le même problème et il a suffit de changer les routines d'émission et de réception, voici ce que j'ai changé pour pouvoir compiler:
Avant:
void OnDataSent(const uint8_t *mac_addr, esp_now_send_status_t status) {
Serial.println(status == ESP_NOW_SEND_SUCCESS ? "Delivery Success" : "Delivery Fail");
}
//callback function that will be executed when data is received
void OnDataRecv(const uint8_t * mac, const uint8_t *incomingData, int len) {
memcpy(&dataRcv, incomingData, sizeof(dataRcv));
}
Après:
void OnDataSent(const uint8_t *mac_addr, esp_now_send_status_t status) {
// char macStr[18];
// snprintf(macStr, sizeof(macStr), "%02x:%02x:%02x:%02x:%02x:%02x",
// mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]);
// Serial.print("Last Packet Sent to: "); Serial.println(macStr);
Serial.print("Last Packet Send Status: "); Serial.println(status == ESP_NOW_SEND_SUCCESS ? "Delivery Success" : "Delivery Fail");
}
void OnDataRecv(const esp_now_recv_info_t * info, const uint8_t *data, int data_len) {
// char macStr[18];
// snprintf(macStr, sizeof(macStr), "%02x:%02x:%02x:%02x:%02x:%02x",
// info->src_addr[0], info->src_addr[1], info->src_addr[2], info->src_addr[3], info->src_addr[4], info->src_addr[5]);
// Serial.print("Last Packet Recv from: "); Serial.println(macStr);
// Serial.print("Last Packet Recv Data: "); Serial.println(*data);
// Serial.println("");
}
Essaye pour voir.
Cordialement
Antoine