Multiple UDP connections on port 14551
I am using MAVSDK python and pymavlink in my project. I used the following code
await drone.connect(system_address= "udp://:14551" ) mavutil.mavlink_connection('udpin:0.0.0.0:14551')
It throws an error "address is already in use". Can two local processes simultaneously have access to PX4 via the same port 14551?. The documentation shows voxl supports up to 16 simultaneous UDP connections.
@CY-1992 That is not a Voxl issue, it's a general networking issue. There are lot's of sources of information about this on the Internet. Here is a quick example: https://stackoverflow.com/questions/1694144/can-two-applications-listen-to-the-same-port
@CY-1992 In general, I would try to use a different port if possible and not try to reuse them.
@Eric-Katzfey Based the docs, I thought multiple UDP connections can be established with voxl-vision-px4
Secondary IP is configured through the voxl-vision-px4 configuration
It looks like you are trying to use the same UDP port twice throu mavsdk
secondary_ip is found here:
I see the following statement, we will check internally and see if the documentation is correct
"Up to 16 simultaneous UDP connections can be established with voxl-vision-px4. These can be connections to qGroundControl, MAVROS, MAVSDK, or any custom software. voxl-vision-px4 listens for mavlink heartbeats on the standard mavlink port 14550 and opens a new link when it receives a new one. "
Port 14550 is meant for external connections to different IP addresses such as multiple ground control instances. Only one connection to localhost is supported on port 14551. To support multiple local IP connections a separate port and thread would likely need to be opened.
You can also have multiple local processes communicate through the "vvpx4_mavlink_io" pipe using libmodal_pipe instead of UDP.