ExpressLRS / Backpack

Firmware for ExpressLRS compatible backpacks
GNU General Public License v3.0
100 stars 73 forks source link

Improve UDP MAVLink reliability through unicasting #152

Closed MUSTARDTIGERFPV closed 3 months ago

MUSTARDTIGERFPV commented 3 months ago

For unknown reasons, it seems that some PC / WiFi card / Backpack combinations struggle with high packet rate broadcasts and drop 20-50% of packets sent this way. This change instead unicasts MAV-to-GCS packets to the IP address from which the last MAVLink GCS-to-MAV packet was received.

Downsides: Can't connect multiple GCSes (but this would have been bad anyway) Upsides: 100% quality.

wvarty commented 3 months ago

Test 1 (comparison data point):

Test 2:

Test 3:

Not sure my test results actually mean anything now, as I cannot reproduce the "broken" state 😐 Only thing Ive changed between "broken" master and "working" master is doing a full chip erase on the ESP32.

I'm going to approve this PR anyway, as it doesnt seem to do any harm from what Ive seen in my testing, and from reports from other users in discord, this did help.

wvarty commented 3 months ago

Latest code changes have resolved the issue where MP would refuse to connect to the UDP port, and 10.0.0.1/mavlink was reporting IP_unset

hyp0dermik-code commented 3 months ago

master cb0e4e image

this pr, 20a7bab: image

master 179e8a: image

this pr, last: image