Udpin and udpout options

Hello everyone,

I am puzzled by the newer updin and updout options for the udp connections.
It would seem that a --master connection would use udpin and --out would use udpout, but scanning the code, this does not seem to be the case.

In the mavutil file, it looks like the udpin binds the IP address while udpout does not but broadcasts instead.
Incidentally, I still don’t know my Berkeley sockets well.

Which option should be used where? Is there some documentation somewhere?


UDP operates on a server/client architecture.

The server (udpin) attempts to connect to a UDP server on the specified IP/socket.

The client (udpout) creates an IP server. I think it only allows clients with the same IP address (ie. on the same device).

The server (udpbcast) listens on an IP/socket and connects to any udp client.

By default yes, unless you specify otherwise via mavproxy.py --master=udpin: for example.

Yes, by default.

For historical reasons, the code is a bit convoluted. Earlier versions of MAVProxy and pymavlink didn’t have the udpin and udpout options, rather the defaults described above were hardcoded.

I should probably put this all in the MAVProxy documentation at some point…

From the MAVProxy examples here both udpin and udpout option are used with the --master argument.

What is the difference between those two examples?

The only difference is the ordering of the ports. As long as there’s one udpin and one udpout, it doesn’t matter which is the output and which is the master.

So you can have:
mavproxy.py --master=udpin: connecting to mavproxy.py --out=udpout:
mavproxy.py --master=udpout: connecting to mavproxy.py --out=udpin:

Either will work.

1 Like

So, for each UDP pipe, you have to have one input and one output, regardless of the “direction”.

Thanks Steven!

I am new to mavproxy & I can’t locate a thread where newbies can ask what would be trivial questions, such as the one I have. First, a little about what I’m trying to do with mavproxy.

I have a Windows 10 Pro with WSL 1 running Ubuntu 20.04LTS, where I build arducopter with a little bit of custom code that implements a new flightmode for our company’s VOTL aircraft. The custom code in arducopter processes the payload data from incoming custom MAVLINK msgs and passes the results through to the aircraft.

I have been successful in using mavlink-router for routing the custom MAVLINK msgs form a simple test app to arducopter and even receiving other custom MAVLINK msgs back from arducopter for capture by another test app. Test app1 sends UDP pkts to port 14550 and test app2 listens for UDP pkts on port 9091 (I just arbitrarily chose these port #'s after making sure that they didn’t conflict with anything else). Mavlink-router requires very trivial setup for this routing. I am trying to replace mavlink-router with mavproxy, and the only thing I have been to do with it is to connect to arducopter; i.e., I have no idea how to tell mavproxy to listen for MAVLINK msgs from my test app1 or forward MAVLINK from arducopter to my test app2. Unfortunately, mavproxy setup documentation has not helped clarify this for me. Any help would be greatly appreciated.

Found the answer in Frequently Asked Questions and Issues — MAVProxy documentation