How to setup UDP connection instead of TCP in SITL

Hello,
I try to change TCP connection to udp in my startscript for SITL simulation running in a podman container. Up to now all tryed changes of “–uartA tcp:…“ failes or have no effect. I use MissionPlanner.

The code I use:

...
JSON_INTERFACE_TARGET="127.0.0.1"
COPTER=/ardupilot/build/sitl/bin/arducopter
BASE_DEFAULTS_COPTER="/ardupilot/default_params/copter.parm"
...
GCS_START_TCP_RANGE=13010
...
for i in $(seq $N_VEHICLES); do
    idx=$(($i-1))
    TCP_PORT=$(($GCS_START_TCP_RANGE + $idx * 10))

    ...
    # What to enter here for UDP instead of TCP connection?

    $COPTER --model json:$JSON_INTERFACE_TARGET --uartA tcp:$TCP_PORT \
                            --instance $idx --defaults $BASE_DEFAULTS_COPTER,/ardupilot/vehicle$idx/identity.parm --home=${LAT},${LON},${ALT},${DIR} &

    ...
done

Thanks in advance

Joe

Looks like maybe your question has a typo?

Are you trying to use a TCP port or a UDP port? (If I’m reading correctly, the question says one, but the code attempt says the other.)

hello,

Here is our documentation : https://ardupilot.org/dev/docs/using-sitl-for-ardupilot-testing.html#using-a-different-gcs-instead-of-mavproxy-via-udp

you will need to know the MissionPlanner IP for it to works with udp

1 Like

Thank you for your reply.
Sorry, that it is unclear. The code is the old TCP one for reference what I have in production up to now.. I like to change it using UDP instead.
I imagine something like this:

--uartA udp:$UDP_PORT

Thanks

Thank you for your replay.

I tried “udpclient” but may the syntax was not corret. I will give it a trail again and check it double.

Thanks