Mavsdk_server UDP connection requires PX4 restart

Yep, as usual build process changed significantly, so need to alter our scripts as well to test - all build targets from new or old documentation fail:

$ make px4_sitl gz_x500
gmake[1]: *** No rule to make target 'gz_x500'.  Stop.
make: *** [Makefile:232: px4_sitl] Error 2

$ make px4_sitl gazebo-classic
gmake[1]: *** No rule to make target 'gazebo-classic'.  Stop.
make: *** [Makefile:232: px4_sitl] Error 2

make does not list any useful targets to build as well. Any ideas?

I would just try to backport (use git cherry-pick) my PX4 change to your PX4 version.

Alternatively, if you want to hard-code the local MAVSDK port, just add a number here:

or here (should be the same):

Yes this works, thank You! And Now I can reconnect!

1 Like

Awesome, thanks for the note!

So now if I restart mavsdk_server connection is reestablished. However if I restart PX4 - it does not: simply because mavsdk_server does not have any re-connection mechanism. So think good to add it there as well.

Hm, UDP shouldn’t require a “re-connection mechanism” as such but it should respond to the new remote port.

If you look at the implementation it basically adds a new remote (IP and port) when new traffic arrives on a port such as 14550 or 14540, and then should respond to that new remote.

Can you share some output what happens exactly in your case where it doesn’t work?

Hmm, I was wrong it reconnects automatically. Never mind then - problem on our end.

1 Like