UDP stream not consistent parsed

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

Re: UDP stream not consistent parsed

Postby ESP_Sprite » Mon Aug 10, 2020 12:56 pm

Got your code to work. Few things:
- I couldn't reproduce the repeating received packages you got... I am not sure what's going on there, but one of my theories is that you're not checking the length of the incoming packets before you parse them. Perhaps you're seeing 'old' data in the buffer?
- You call esp_wifi_set_ps(WIFI_PS_NONE); very early on in the code. I am not sure it has effect there. Suggest moving it to after you connected to the WiFi AP.
- What you do inside the loop is somewat important as well; depending on the speed of the packets coming in, it's easy for a printf() within the loop to take enough time to get the data out of the serial port that you drop packets.

Who is online

Users browsing this forum: tomy983 and 236 guests