How to connect to multiple vehicles with system id greater than 9

I am starting 12 vehicles using PX4-SITL’s gazebo_multiple_vehicle.sh command.
Later using 12 seperate instances of my software, I am trying to connect to these vehicles. I am connecting through local host and using the ports through 14540 to 14549.
For the vehicles with id 1 to 9 (where seperate ports 14540 through 14548) I can easily connect to the autopilots. But, for the vehicles with id [10, 11, 12], I use 14549 port, and only one of my software instances can connect, while others throwing following error:

[08:24:41|Error] bind error: Address already in use (udp_connection.cpp:86)

Can anyone help me on this issue?
Thanks in advance.

@JulianOes and @JonasVautherin do you have any suggestion on this issue?

Currently, the port 14549 is re-used for all vehicles above 9, see:

So in theory, you only need to connect to the 9 ports and should receive all vehicles. In practice there might be some bugs. I’ll try to reproduce this.

Hi Julian,

I want to highlight again that I am trying to connect through port 14549 from different processes. Only one of my processes can connect, while others throwing an error indicating “bind error: Address already in use (udp_connection.cpp:86)”.

I can connect to autopilots with id 10, 11, 12 etc. when I run only one process at a time.
But the thing I am trying to do is that, run 3 processes simultaneously and make each process connect to an autopilot with different id. One will connect to autopilot-10, other will connect to autopilot-11 etc.