ESP32-S2 TCP Previous Segment Not Captured
Hello,
I'm having an issue with my ESP32-S2-SOLO-2U-N4 device where occasionally I am getting a "TCP Previous Segment Not Captured" message in response to a data packet coming in. Please see file here: https://www.dropbox.com/scl/fi/9xl8h9...
A little background info - I have a LabVIEW application that sends packets of data (7 bytes) every ~50ms to my ESP32-S2. On the other end of the ESP32-S2 I have an MCU. So the ESP32-S2 is really just a liaison between the two (I understand that the ESP device can act as an MCU as well... These are design constraints I currently have). Anyways, the ESP32-S2 forwards the TCP data to Serial to the MCU, the MCU processes the data and responds via Serial with a 14-byte packet. The ESP32-S2 takes that packet and sends it over TCP back to LabVIEW to read.
Note: This is a pretty large file. The main IP addresses here are 192.168.1.201 (my PC w/ LabVIEW) and 192.168.1.170 (ESP32-S2) but some lines of interest are 2992-2995, 2329-2332, and 1757-1760 (among others). You'll notice that the two communicate well the vast majority of the time, but occasionally this error happens and it takes ~1 second to get back to normal comms which I can not have.
I've tried a slew of different programming methods, firmware, and such with no luck. The only thing really remaining for me to try would be using the ESP-IDF but I am having a very difficult time even installing the software so I've kind of turned away from that (at the moment, anyway). Thanks in advance.
What is the connection between PC and ESP? Is there a device to make a capture on?
They communicate over TCP but both are on the same router, so WiFi is the connection between the two. I've just been running Wireshark on my PC w/ LabVIEW and capturing.
My MCU program sends out a "beep" when data is not received after some period of time (generally a little over a second) so I can audibly tell when this communication error occurs.
I've had a little success actually by coding a "manual retransmission." Essentially, if the ESP32-S2 doesn't receive TCP within ~250ms, I automatically send the previous packet it transmitted (basically a spurious retransmission of sorts). While I don't think this is an elegant solution, it does seem to jostle around the comms and prevent >1sec of lull.
Capturing in the middle is one step closer to verifying that the packet that is retransmitted was sent the first time to the ESP.