TCP Expected Format

I have an ESP32 that I have acting as a basic NTRIP client feeding RTCM messages to my GPS on my rover. It also has a basic HTTP server that reports various connection stats. I would like to also pipe the mavlink telemetry data over wifi for use with MP via a TCP connection. I have tried simply pushing all the bytes received on the serial port over the TCP connection but this does not work - MP does not recognise the data. I presume that MP is expecting the mavlink data to be correctly framed in each packet? I have looked for information on what MP is expecting and have spent time on the MP/mavproxy/ESPlink code but have not yet found an answer. Does anyone have a link to a reference or any idea what must be done to achieve this?

I have used an ESP01 to pipe the messages to my auto pilot using Tower and it works just fine.

You may be losing packets which will not work. There are Heartbeat packets that tell the auto pilot that the GCS is still there and in control. Each packet has a sequence number so it will know if one is missing.

I also watch for the start packet byte so I can properly frame the TCP data.

Mike

Thanks Mike - I suspect that having a whole mavlink message per packet will be the trick. I’ll give it a go as soon as I get some time :slightly_smiling_face:

I worked through a few issues (not the least of which was transposed TX/RX pins) and have it working. The one ESP32 board now performs as both an NTRIP client and TCP bridge (+http server to report connection stats). I’ll post my code one I have tidied it up some.