ESPNOW Works But Sometimes Outputs Garbage Randomly

msh911
Posts: 11
Joined: Wed May 10, 2023 5:21 am

ESPNOW Works But Sometimes Outputs Garbage Randomly

Postby msh911 » Wed May 10, 2023 5:53 pm

Hi

I have setup communication between two ESP32 S3 boards. and I am sending an array of size 10 from one to another:

uint8_t Test[10] = {0,1,2,3,4,5,6,7,8,9};

I do not get any error and the code builds properly and connects to the other board imminently but sometimes I get garbage output on the receiver board every a few seconds or so and and the interval between garbage out put is also random:

Status= 1 hex: 0x68,0xB6,0xB3,0x36,0xAA,0x7C data: 0,1,2,3,4,5,6,7,8,9
Status= 1 hex: 0x68,0xB6,0xB3,0x36,0xAA,0x7C data: 0,1,2,3,4,5,6,7,8,9
Status= 1 hex: 0x68,0xB6,0xB3,0x36,0xAA,0x7C data: 0,1,2,3,4,5,6,7,8,9
Status= 1 hex: 0x68,0xB6,0xB3,0x36,0xAA,0x7C data: 72,96,108,3,1,1,45,26,45,64
Status= 1 hex: 0x68,0xB6,0xB3,0x36,0xAA,0x7C data: 0,1,2,3,4,5,6,7,8,9
Status= 1 hex: 0x68,0xB6,0xB3,0x36,0xAA,0x7C data: 0,1,2,3,4,5,6,7,8,9
Status= 1 hex: 0x68,0xB6,0xB3,0x36,0xAA,0x7C data: 0,1,2,3,4,5,6,7,8,9
Status= 1 hex: 0x68,0xB6,0xB3,0x36,0xAA,0x7C data: 0,1,2,3,4,5,6,7,8,9

I really can not find any source helping me with this error and I do not even know if the issue is from the source or destination board.
Any thoughts on this issue?

Thanks

MicroController
Posts: 1700
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: ESPNOW Works But Sometimes Outputs Garbage Randomly

Postby MicroController » Thu May 11, 2023 11:10 am

You may be
a) sending data from some dangling pointer,
b) printing RX data from some dangling pointer, or
c) having a completely different problem.

msh911
Posts: 11
Joined: Wed May 10, 2023 5:21 am

Re: ESPNOW Works But Sometimes Outputs Garbage Randomly

Postby msh911 » Thu May 11, 2023 6:48 pm

Thanks for your help.
I am new to this and I really appreciate if you could help me a bit further. What do you exactly mean by "dangling pointer"? how would I know if I have it somewhere? and How would I avoid it?

Thanks

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

Re: ESPNOW Works But Sometimes Outputs Garbage Randomly

Postby ESP_Sprite » Fri May 12, 2023 7:04 am

It's a pointer that used to point to data, but not anymore. E.g. you tell the WiFi stack you're done with the data it sent you (e.g. by returning from the callback) but you print the value at the data pointer afterwards.

It'd help if you could post your code (minimized to the smallest portion that reproduces the error, if possible) so we could take a look btw.

Who is online

Users browsing this forum: No registered users and 187 guests