Closed GrooverFromHolland closed 6 years ago
Well, have you tested Serial.println(sizeof(data))
? You would have realized that it returns 28, which is 7 (the number of elements) times 4 (the size of an element (which is here a pointer on an uint8_t, so 4 bytes)).
@Loufylouf. Thank you, I ditn't know pointer variables are 32 bits wide, regardless of the type. The only thing I have to do is: esp_err_t result = esp_now_send(peer_addr, *data, 7); in my send method.
Hardware:
Board: DOIT ESP32 Devkit V1 Core Installation/update date: 11 december 2017 IDE name: Visualmicro Flash Frequency: 80Mhz Upload Speed: 921600
Description:
I am sending a packet of 7 bytes and 28 bytes are received on the slave. send method:
Serialmonitor output: Received from IR-Controller: 218103821 Sending: ................ 2, 40, 10, 0, 0, 0, 3 Send Status: Success Last Packet Sent to: 30:ae:a4:3c:64:b5 Last Packet Send Status: Delivery Success
Receive method:
Serial monitor output:
ESPNow/Basic/Slave Example AP Config Success. Broadcasting with AP: Slave_1 AP MAC: 30:AE:A4:3C:64:B5 ESPNow Init Success Last Packet Recv from: 24:0a:c4:13:ae:04 Datalength: 28 Last Packet Recv total Data: 2, 40, 10, 0, 0, 0, 3, 63, 0, 0, 0, 0, 128, 4, 254, 63, 0, 0, 0, 0, 224, 35, 254, 63, 0, 0, 0, 0,
Last Packet Recv Data: 2, 40, 10, 0, 0, 0, 3,
As the data sent is in the first 7 bytes my application is working, but why 28 bytes received and what is in the remaining 21 bytes?