# \[bug\] ports already in use multi vehicle simulation

**URL:** <https://discuss.px4.io/t/bug-ports-already-in-use-multi-vehicle-simulation/8481>\
**Category:** Uncategorized\
**Created:** [November 14, 2018, 2:29pm UTC](https://discuss.px4.io/t/bug-ports-already-in-use-multi-vehicle-simulation/8481 "2018-11-14T14:29:11Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![shrit](https://discuss.px4.io/letter_avatar_proxy/v4/letter/s/ea5d25/32.png) [@shrit](https://discuss.px4.io/u/shrit)\
**Post date:** [November 14, 2018, 2:29pm UTC](https://discuss.px4.io/t/bug-ports-already-in-use-multi-vehicle-simulation/8481/1 "2018-11-14T14:29:11Z")

</div>

I was trying to have a connection to the 3 quad defined in the multi vehicle simulation.

I read the launch file, and started the mavros nodes with roslaunch, according to the [info] coming from the px4 I should use the port 14581 14582 14583. However all of them are already in use

I have also tried with another addresses, just in case missed up something.

Also, reading the comments at the end of the Firmware/launch/multi\_uav\_mavros\_sitl.launch in the master version, it indicate about using 1455x numbers which are not declared at all in the files

develop /meta/DronecodeSDK/example/offboard\_velocity/build\> ./offboard udp://:14581  
[03:25:19|Info] DronecodeSDK version: 0.2.6 (dronecode\_sdk\_impl.cpp:25)  
[03:25:19|Error] bind error: Address already in use (udp\_connection.cpp:82)  
Connection failed: Bind error  
exit 1  
develop /meta/DronecodeSDK/example/offboard\_velocity/build\> ./offboard udp://:14583  
[03:25:21|Info] DronecodeSDK version: 0.2.6 (dronecode\_sdk\_impl.cpp:25)  
[03:25:21|Error] bind error: Address already in use (udp\_connection.cpp:82)  
Connection failed: Bind error  
exit 1  
develop /meta/DronecodeSDK/example/offboard\_velocity/build\> ./offboard udp://:14582  
[03:25:23|Info] DronecodeSDK version: 0.2.6 (dronecode\_sdk\_impl.cpp:25)  
[03:25:23|Error] bind error: Address already in use (udp\_connection.cpp:82)  
Connection failed: Bind error  
exit 1  
develop /meta/DronecodeSDK/example/offboard\_velocity/build\> ./offboard udp://:14540  
[03:25:27|Info] DronecodeSDK version: 0.2.6 (dronecode\_sdk\_impl.cpp:25)  
[3] 1586 segmentation fault (core dumped) ./offboard udp://:14540  
exit 139  
develop /meta/DronecodeSDK/example/offboard\_velocity/build\> ./offboard udp://:14550  
[03:25:33|Info] DronecodeSDK version: 0.2.6 (dronecode\_sdk\_impl.cpp:25)  
[3] 1671 segmentation fault (core dumped) ./offboard udp://:14550  
exit 139  
develop /meta/DronecodeSDK/example/offboard\_velocity/build\> ./offboard udp://:14551  
[03:25:36|Info] DronecodeSDK version: 0.2.6 (dronecode\_sdk\_impl.cpp:25)  
[3] 1759 segmentation fault (core dumped) ./offboard udp://:14551  
exit 139  
develop /meta/DronecodeSDK/example/offboard\_velocity/build\> ./offboard udp://:14552  
[03:25:38|Info] DronecodeSDK version: 0.2.6 (dronecode\_sdk\_impl.cpp:25)  
[3] 1843 segmentation fault (core dumped) ./offboard udp://:14552  
exit 139  
develop /meta/DronecodeSDK/example/offboard\_velocity/build\> ./offboard udp://:14561  
[03:26:07|Info] DronecodeSDK version: 0.2.6 (dronecode\_sdk\_impl.cpp:25)  
[03:26:07|Error] bind error: Address already in use (udp\_connection.cpp:82)  
Connection failed: Bind error  
exit 1  
develop /meta/DronecodeSDK/example/offboard\_velocity/build\> ./offboard udp://:14562  
[03:26:09|Info] DronecodeSDK version: 0.2.6 (dronecode\_sdk\_impl.cpp:25)  
[03:26:09|Error] bind error: Address already in use (udp\_connection.cpp:82)  
Connection failed: Bind error  
exit 1  
develop /meta/DronecodeSDK/example/offboard\_velocity/build\> ./offboard udp://:14563  
[03:26:11|Info] DronecodeSDK version: 0.2.6 (dronecode\_sdk\_impl.cpp:25)  
[03:26:11|Error] bind error: Address already in use (udp\_connection.cpp:82)  
Connection failed: Bind error  
exit 1  
develop /meta/DronecodeSDK/example/offboard\_velocity/build\> ./offboard udp://:14541  
[03:26:19|Info] DronecodeSDK version: 0.2.6 (dronecode\_sdk\_impl.cpp:25)  
[03:26:19|Error] bind error: Address already in use (udp\_connection.cpp:82)  
Connection failed: Bind error  
exit 1  
develop /meta/DronecodeSDK/example/offboard\_velocity/build\> ./offboard udp://:14542  
[03:26:22|Info] DronecodeSDK version: 0.2.6 (dronecode\_sdk\_impl.cpp:25)  
[03:26:22|Error] bind error: Address already in use (udp\_connection.cpp:82)  
Connection failed: Bind error  
exit 1  
develop /meta/DronecodeSDK/example/offboard\_velocity/build\> ./offboard udp://:14543  
[03:26:24|Info] DronecodeSDK version: 0.2.6 (dronecode\_sdk\_impl.cpp:25)  
[03:26:24|Error] bind error: Address already in use (udp\_connection.cpp:82)  
Connection failed: Bind error  
exit 1  
develop /meta/DronecodeSDK/example/offboard\_velocity/build\> ./offboard udp://:14557  
[03:30:09|Info] DronecodeSDK version: 0.2.6 (dronecode\_sdk\_impl.cpp:25)  
[3] 2384 segmentation fault (core dumped) ./offboard udp://:14557  
exit 139  
develop /meta/DronecodeSDK/example/offboard\_velocity/build\> ./offboard udp://:14558  
[03:30:12|Info] DronecodeSDK version: 0.2.6 (dronecode\_sdk\_impl.cpp:25)  
[3] 2466 segmentation fault (core dumped) ./offboard udp://:14558  
exit 139  
develop /meta/DronecodeSDK/example/offboard\_velocity/build\> ./offboard udp://:14556  
[03:30:15|Info] DronecodeSDK version: 0.2.6 (dronecode\_sdk\_impl.cpp:25)  
[3] 2549 segmentation fault (core dumped) ./offboard udp://:14556  
exit 139  
develop /meta/DronecodeSDK/example/offboard\_velocity/build\>

---

<div class="post-metadata">

**Author:** ![JulianOes](https://discuss.px4.io/user_avatar/discuss.px4.io/julianoes/32/30_2.png) [@JulianOes](https://discuss.px4.io/u/JulianOes)\
**Post date:** [November 15, 2018, 7:20am UTC](https://discuss.px4.io/t/bug-ports-already-in-use-multi-vehicle-simulation/8481/2 "2018-11-15T07:20:30Z")

</div>

So the SDK is considered an alternative to MAVROS, so usually you would be using one or the other.

If you are already in the ROS environment, then you can also set offboard control using ROS. If however, you opt not to use ROS, you could do similar things (generally simplified, with less options) using the SDK.

Therefore, SDK and MAVROS connect on the same port, and that’s why you see the `Bind error`.

The question is if you really need both at the same time, if you do, then you can either use the QGC port(s) (14550) by the SDK, or add another mavlink instance with a separate port in the PX4 startup script here:

> <https://github.com/PX4/Firmware/blob/c2e036837045e8de778fbe097ed582f9297d5ec4/ROMFS/px4fmu_common/init.d-posix/rcS#L225-L238>

---

<div class="post-metadata">

**Author:** ![shrit](https://discuss.px4.io/letter_avatar_proxy/v4/letter/s/ea5d25/32.png) [@shrit](https://discuss.px4.io/u/shrit)\
**Post date:** [November 15, 2018, 7:57am UTC](https://discuss.px4.io/t/bug-ports-already-in-use-multi-vehicle-simulation/8481/3 "2018-11-15T07:57:50Z")

</div>

That is interesting  
I do not care about mavros. I wrote my entire application using the SDK. (And I really do not have time to do that)  
However, I can not start several drones without using mavros. Unless if you know another method. I also need separate ports because I need to control each drone separately.

I do not know how to Not use mavros and stay capable to control and communicate with several drones.

Best regards,

---

<div class="post-metadata">

**Author:** ![JulianOes](https://discuss.px4.io/user_avatar/discuss.px4.io/julianoes/32/30_2.png) [@JulianOes](https://discuss.px4.io/u/JulianOes)\
**Post date:** [November 15, 2018, 8:08am UTC](https://discuss.px4.io/t/bug-ports-already-in-use-multi-vehicle-simulation/8481/4 "2018-11-15T08:08:54Z")

</div>

> However, I can not start several drones without using mavros.

Yes, that would probably be what you need to do. It should be possible!

Have you tried this: [Multi-Vehicle Sim with JMAVSim · PX4 Developer Guide](https://dev.px4.io/en/simulation/multi_vehicle_jmavsim.html)

---

<div class="post-metadata">

**Author:** ![shrit](https://discuss.px4.io/letter_avatar_proxy/v4/letter/s/ea5d25/32.png) [@shrit](https://discuss.px4.io/u/shrit)\
**Post date:** [November 15, 2018, 8:19am UTC](https://discuss.px4.io/t/bug-ports-already-in-use-multi-vehicle-simulation/8481/5 "2018-11-15T08:19:24Z")

</div>

Thanks for the answer, I imagine that you are making my entire life easier.

However, I am using Gazebo, for all my simulations, and I can not find another files similar to this one, I imagine I should create a world that contain several instance of IRIS, but I have know idea how to specify the ports and the configuration for gazebo and px4 to make several instance of px4 communicate with several instance of IRIS

In general for one drone simulation I use make px4 gazebo\_iris. So how to make it for several

Thanks in advance,

Best regards,

---

<div class="post-metadata">

**Author:** ![JulianOes](https://discuss.px4.io/user_avatar/discuss.px4.io/julianoes/32/30_2.png) [@JulianOes](https://discuss.px4.io/u/JulianOes)\
**Post date:** [November 15, 2018, 2:06pm UTC](https://discuss.px4.io/t/bug-ports-already-in-use-multi-vehicle-simulation/8481/6 "2018-11-15T14:06:52Z")

</div>

Hm, I don’t know how to do that either. I think you have to reverse engineer how it is done with ROS, and find out how it’s done for just one drone in Gazebo without ROS and then combine what you found.

I suggest to make a new forum post or ask on Slack. Maybe there are people that have done it before.

---

<div class="post-metadata">

**Author:** ![shrit](https://discuss.px4.io/letter_avatar_proxy/v4/letter/s/ea5d25/32.png) [@shrit](https://discuss.px4.io/u/shrit)\
**Post date:** [November 15, 2018, 2:09pm UTC](https://discuss.px4.io/t/bug-ports-already-in-use-multi-vehicle-simulation/8481/7 "2018-11-15T14:09:51Z")

</div>

I think I have already find a solution, but I need to verify with px4 and the SDK.

To be verified this evening…

---

<div class="post-metadata">

**Author:** ![shrit](https://discuss.px4.io/letter_avatar_proxy/v4/letter/s/ea5d25/32.png) [@shrit](https://discuss.px4.io/u/shrit)\
**Post date:** [November 15, 2018, 4:41pm UTC](https://discuss.px4.io/t/bug-ports-already-in-use-multi-vehicle-simulation/8481/8 "2018-11-15T16:41:05Z")

</div>

Details of the solutions:

Some verifications are needed from any one who understand what is happening

The solution is very simple and not professional at all. However it do the work perfectly (from my point of view)

Let’s take the iris quadcopters,

1. Go the the sitl\_gazebo folder in Tools, find the iris folder in the model folder
2. We start by creating 3 different folders each one contain the iris.sdf and the model.conf
3. Change the mavlink ports number to make it communicate with the px4 (For example)
4. Change the file name to iris\_1.sdf for example and continue to iris\_x.sdf for the wanted drone numbers
5. Change the model name inside the iris\_x.sdf to correspond to the file name
6. Modify the same thing inshttps://dev.px4.io/en/simulation/multi\_vehicle\_jmavsim.htmlide the model.conf
7. Go to the iris.world in the world folder. Add the above created models with new positions
8. Go to the page : [https://dev.px4.io/en/simulation/multi\_vehicle\_jmavsim.html](https://dev.px4.io/en/simulation/multi_vehicle_jmavsim.html)
9. Do number 1 an 2 only
10. Start gazebo with the path to the new iris.world

Now I can connect to any quadcopter using the SDK using the port 14540 14541 1454(i+1) where i is the drone number.

During tests everything looks fine without any problem I have some warning when I start gazebo with the verbose option  
!?master /meta/Spider-pig/Firmware/Tools\> gazebo --verbose sitl\_gazebo/worlds/iris.world  
Gazebo multi-robot simulator, version 9.3.0  
Copyright © 2012 Open Source Robotics Foundation.  
Released under the Apache 2 License.  
[http://gazebosim.org](http://gazebosim.org)

[Msg] Waiting for master.  
[Msg] Connected to gazebo master @ [http://127.0.0.1:11345](http://127.0.0.1:11345)  
[Msg] Publicized address: 129.175.4.102  
Gazebo multi-robot simulator, version 9.3.0  
Copyright © 2012 Open Source Robotics Foundation.  
Released under the Apache 2 License.  
[http://gazebosim.org](http://gazebosim.org)

[Msg] Waiting for master.  
[Msg] Connected to gazebo master @ [http://127.0.0.1:11345](http://127.0.0.1:11345)  
[Msg] Publicized address: 129.175.4.102  
[Dbg] [gazebo\_mavlink\_interface.cpp:138] \<joint\_name\> not found for channel[0] no joint control will be performed for this channel.  
[Dbg] [gazebo\_mavlink\_interface.cpp:138] \<joint\_name\> not found for channel[1] no joint control will be performed for this channel.  
[Dbg] [gazebo\_mavlink\_interface.cpp:138] \<joint\_name\> not found for channel[2] no joint control will be performed for this channel.  
[Dbg] [gazebo\_mavlink\_interface.cpp:138] \<joint\_name\> not found for channel[3] no joint control will be performed for this channel.  
[Wrn] [gazebo\_mavlink\_interface.cpp:127] joint [zephyr\_delta\_wing::propeller\_joint] not found for channel[4] no joint control for this channel.  
[Wrn] [gazebo\_mavlink\_interface.cpp:127] joint [zephyr\_delta\_wing::flap\_left\_joint] not found for channel[5] no joint control for this channel.  
[Wrn] [gazebo\_mavlink\_interface.cpp:127] joint [zephyr\_delta\_wing::flap\_right\_joint] not found for channel[6] no joint control for this channel.  
[Dbg] [gazebo\_mavlink\_interface.cpp:138] \<joint\_name\> not found for channel[7] no joint control will be performed for this channel.  
[Msg] Using MAVLink protocol v2.0  
[Dbg] [gazebo\_mavlink\_interface.cpp:138] \<joint\_name\> not found for channel[0] no joint control will be performed for this channel.  
[Dbg] [gazebo\_mavlink\_interface.cpp:138] \<joint\_name\> not found for channel[1] no joint control will be performed for this channel.  
[Dbg] [gazebo\_mavlink\_interface.cpp:138] \<joint\_name\> not found for channel[2] no joint control will be performed for this channel.  
[Dbg] [gazebo\_mavlink\_interface.cpp:138] \<joint\_name\> not found for channel[3] no joint control will be performed for this channel.  
[Wrn] [gazebo\_mavlink\_interface.cpp:127] joint [zephyr\_delta\_wing::propeller\_joint] not found for channel[4] no joint control for this channel.  
[Wrn] [gazebo\_mavlink\_interface.cpp:127] joint [zephyr\_delta\_wing::flap\_left\_joint] not found for channel[5] no joint control for this channel.  
[Wrn] [gazebo\_mavlink\_interface.cpp:127] joint [zephyr\_delta\_wing::flap\_right\_joint] not found for channel[6] no joint control for this channel.  
[Dbg] [gazebo\_mavlink\_interface.cpp:138] \<joint\_name\> not found for channel[7] no joint control will be performed for this channel.  
[Msg] Using MAVLink protocol v2.0  
[Dbg] [gazebo\_mavlink\_interface.cpp:138] \<joint\_name\> not found for channel[0] no joint control will be performed for this channel.  
[Dbg] [gazebo\_mavlink\_interface.cpp:138] \<joint\_name\> not found for channel[1] no joint control will be performed for this channel.  
[Dbg] [gazebo\_mavlink\_interface.cpp:138] \<joint\_name\> not found for channel[2] no joint control will be performed for this channel.  
[Dbg] [gazebo\_mavlink\_interface.cpp:138] \<joint\_name\> not found for channel[3] no joint control will be performed for this channel.  
[Wrn] [gazebo\_mavlink\_interface.cpp:127] joint [zephyr\_delta\_wing::propeller\_joint] not found for channel[4] no joint control for this channel.  
[Wrn] [gazebo\_mavlink\_interface.cpp:127] joint [zephyr\_delta\_wing::flap\_left\_joint] not found for channel[5] no joint control for this channel.  
[Wrn] [gazebo\_mavlink\_interface.cpp:127] joint [zephyr\_delta\_wing::flap\_right\_joint] not found for channel[6] no joint control for this channel.  
[Dbg] [gazebo\_mavlink\_interface.cpp:138] \<joint\_name\> not found for channel[7] no joint control will be performed for this channel.  
[Msg] Using MAVLink protocol v2.0  
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris\_2/motors, deleting message. This warning is printed only once.  
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris\_2/imu, deleting message. This warning is printed only once.  
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris/motors, deleting message. This warning is printed only once.  
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris/motor\_speed/0, deleting message. This warning is printed only once.  
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris/motor\_speed/1, deleting message. This warning is printed only once.  
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris/motor\_speed/2, deleting message. This warning is printed only once.  
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris/motor\_speed/3, deleting message. This warning is printed only once.  
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris/imu, deleting message. This warning is printed only once.  
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris\_1/motors, deleting message. This warning is printed only once.  
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris\_1/motor\_speed/0, deleting message. This warning is printed only once.  
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris\_1/motor\_speed/1, deleting message. This warning is printed only once.  
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris\_1/motor\_speed/2, deleting message. This warning is printed only once.  
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris\_1/motor\_speed/3, deleting message. This warning is printed only once.  
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris\_1/imu, deleting message. This warning is printed only once.  
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris\_2/motor\_speed/0, deleting message. This warning is printed only once.  
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris\_2/motor\_speed/1, deleting message. This warning is printed only once.  
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris\_2/motor\_speed/2, deleting message. This warning is printed only once.  
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris\_2/motor\_speed/3, deleting message. This warning is printed only once.

I do not know if they are serious errors or not.

Best regards,

---

<div class="post-metadata">

**Author:** ![shrit](https://discuss.px4.io/letter_avatar_proxy/v4/letter/s/ea5d25/32.png) [@shrit](https://discuss.px4.io/u/shrit)\
**Post date:** [November 16, 2018, 12:16pm UTC](https://discuss.px4.io/t/bug-ports-already-in-use-multi-vehicle-simulation/8481/9 "2018-11-16T12:16:34Z")

</div>

I am re-opening an new thread for this issue,

---

<div class="post-metadata">

**Author:** ![JulianOes](https://discuss.px4.io/user_avatar/discuss.px4.io/julianoes/32/30_2.png) [@JulianOes](https://discuss.px4.io/u/JulianOes)\
**Post date:** [November 19, 2018, 5:33am UTC](https://discuss.px4.io/t/bug-ports-already-in-use-multi-vehicle-simulation/8481/10 "2018-11-19T05:33:17Z")

</div>

Thanks for posting your steps.

And I see these warnings often, I’m assuming it’s normal.
