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("");
}
//-------------------------------------------------
BUG in slave example of ESP32 NOW
-
- Posts: 9757
- Joined: Thu Nov 26, 2015 4:08 am
Re: BUG in slave example of ESP32 NOW
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?
Re: BUG in slave example of ESP32 NOW
Hi
I use PlatformIO and arduino project.
This is the link:
https://espressif-docs.readthedocs-host ... spnow.html
I use PlatformIO and arduino project.
This is the link:
https://espressif-docs.readthedocs-host ... spnow.html
-
- Posts: 9757
- Joined: Thu Nov 26, 2015 4:08 am
Re: BUG in slave example of ESP32 NOW
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 38 guests