BeyondRobotix / mavesp8266

ESP8266 WiFi Access Point and MAVLink Bridge
Other
185 stars 172 forks source link

Buffering messages to increase UDP frame size performance. #1

Closed dogmaphobic closed 8 years ago

dogmaphobic commented 8 years ago

Instead of sending messages out the UDP port every time a message arrives, I'm now buffering up to 5 messages (around 1,300 bytes) or 5 milliseconds, whichever comes first. Receiving data from the UART at 921600 baud, most of the time 2 or 3 messages get queued up before the timeout. For large data bursts, 5 messages in the queue are common. This helps performance as all messages will fit in one single UDP frame (as opposed to send one message per UDP frame).

With that said, QGC is showing a rather large amount of lost frames. My tests show that even after long periods of large data bursts at 921600 baud (PX4 -> UART -> 8266), not a single message was lost. That would indicate packets (or rather UDP frames) are being lost within QGC. I have yet to debug that.