# Mavlink server configuration of ports wont work

Source: https://forum.modalai.com/topic/3935/mavlink-server-configuration-of-ports-wont-work
Category: VOXL SDK and Software (https://forum.modalai.com/category/47/voxl-sdk-and-software)
Tags: mpa
Posted: 2024-11-13 10:02:30 UTC by jacob yaacubov
Replies: 3 · Views: 2797

## jacob yaacubov · 2024-11-13 10:02:30 UTC

Hi all,
you've ben very helpful i have an issue with mavlink-server / Voxl-px4-parameters 

I have an issue with mavlink-server I tired to change the config files 
```"onboard_port_to_autopilot":	14556,
	"onboard_port_from_autopilot":	14557,
	"gcs_port_to_autopilot":	14558,
	"gcs_port_from_autopilot":	14559,
```

I want to change it cause when using two drones or more , it seems like Mavlink comms are interfering between (both connected to same network when it occurs )
 each other,  and I want to isolate each in its own domain  
I changed the config file but that makes the mavlink-server not to pass any data between the autopilot and the voxl px4 

 ```voxl-mavlinke-inspect```
this passes no data from autopilot or to autopilot 

I think or guess this happens  since the ports are hardcoded in the firmware 
I tried to cahnge parameters 
MAV_0_UDP_PRT
MAV_1_UDP_PRT 
but they don't even exist on the params list of modalais voxl2 qrb5165 

any suggestions how to isolate each drone?  or to add those parameters? 
how to add the paramers without recompiling the px4-firmware ? 

i will appreciate your help having trouble flying more than one drone at each moment hinders my work 

Best Regard
Jacob

## Reply by Eric Katzfey (ModalAI staff) · 2024-11-13 17:26:04 UTC

@jacob-yaacubov Each drone will have it's own IP address so that is how they are separated. Those port numbers in the mavlink server configuration are only for communications within the board, not externally. What makes you say that they are "interfering"?

## Reply by jacob yaacubov · 2024-11-17 15:32:33 UTC (in reply to Eric Katzfey)

@Eric-Katzfey 

Thanks for the replay 

I understand the IP isolation  indeed this  how I expect this to work 

well to answer this I have these weird  issues 

When QGC is connected only to a single drone the attitude indicator jump between the values of the two drones - hence the home position jumps and the drone refuses to take off 
switching one of them off and rebooting the second makes the second one work well when alone on the network 

2. when looking at the ROS topic which is reading from the MPA  - (qgc is off at this stage ) 

the local pose values jumped as well,  at first I didn't understand why, but then I realized it was getting one value from drone A second From drone B 

both drones run same voxl2 with same SDK 1.1.3 

same packages and branches  on both 
tried to play with MAV_SYS_ID param maybe its mavlink issue 

kind of confused 
both ros master run on 127.0.01 so its local ros communication  looks more like mavlink issue  not sure though

## Reply by Zachary Lowell 0 · 2024-11-18 14:14:09 UTC (in reply to jacob yaacubov)

@jacob-yaacubov said in [Mavlink server configuration of ports wont work](/post/19751):
> branches 

@jacob-yaacubov said in [Mavlink server configuration of ports wont work](/post/19751):
> both ros master run on 127.0.01 so its local ros communication looks more like mavlink issue not sure though
> 
> Reply

@jacob-yaacubov yes you need to change the mav sys id for both otherwise they will overlap and create the problem you stated before when connecting to qgc and having overlapping px4 instances. As for ROS you need to change the ROS_DOMAIN_ID (an external terminal environment variable) otherwise all the ros topics will also overlap and create multiple publishers and subscribers on the same drone when you have multiple on.

Zach
