BUG in slave example of ESP32 NOW

gpezzella
Posts: 50
Joined: Sun Jan 27, 2019 8:04 pm

BUG in slave example of ESP32 NOW

Postby gpezzella » Wed Feb 07, 2024 6:51 pm

Hi
this part is wrong:

// callback when data is recv from Master
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("");
}


this is correction:

//-------------------------------------------------
// callback when data is recv from Master
//-------------------------------------------------
void OnDataRecv(const uint8_t * mac_addr, const uint8_t *incomingData, int len) {
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 Recv from: "); Serial.println(macStr);
Serial.print("Last Packet Recv Data: "); Serial.println(*incomingData);
Serial.println("");
}
//-------------------------------------------------

ESP_Sprite
Posts: 9052
Joined: Thu Nov 26, 2015 4:08 am

Re: BUG in slave example of ESP32 NOW

Postby ESP_Sprite » Thu Feb 08, 2024 1:45 am

What version of ESP-IDF are we talking about? I imagine you're talking about one of the examples in the 'examples' directory in ESP-IDF?

gpezzella
Posts: 50
Joined: Sun Jan 27, 2019 8:04 pm

Re: BUG in slave example of ESP32 NOW

Postby gpezzella » Thu Feb 08, 2024 11:53 am

Hi

I use PlatformIO and arduino project.
This is the link:
https://espressif-docs.readthedocs-host ... spnow.html

ESP_Sprite
Posts: 9052
Joined: Thu Nov 26, 2015 4:08 am

Re: BUG in slave example of ESP32 NOW

Postby ESP_Sprite » Thu Feb 08, 2024 12:25 pm

Ah, thanks! But given that this is a bug in the Arduino side of things, you're probably better off reporting it at https://github.com/espressif/arduino-esp32/issues

Who is online

Users browsing this forum: No registered users and 110 guests