# Usage of multiple PX4s in offboard mode

**URL:** <https://discuss.px4.io/t/usage-of-multiple-px4s-in-offboard-mode/36058>\
**Category:** PX4 Autopilot\
**Created:** [December 25, 2023, 8:25am UTC](https://discuss.px4.io/t/usage-of-multiple-px4s-in-offboard-mode/36058 "2023-12-25T08:25:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![serkan](https://discuss.px4.io/user_avatar/discuss.px4.io/serkan/32/15385_2.png) [@serkan](https://discuss.px4.io/u/serkan)\
**Post date:** [December 25, 2023, 8:25am UTC](https://discuss.px4.io/t/usage-of-multiple-px4s-in-offboard-mode/36058/1 "2023-12-25T08:25:27Z")

</div>

Hello, I am using PX4 to control my drone with ROS2, and it is working. I am planning to build two drones, and I anticipate facing an issue in this part because having two PX4s means having the same topic names. When I researched this problem, I came across works done in simulation environments, and I tried them in simulation, and they worked. However, I am wondering how to achieve this in a real system. Can you help me with this?  
I have reviewed the PX4-Autopilot software and attempted to modify the ‘dds\_topics.yaml’ file located at ‘PX4-Autopilot/src/modules/uxrce\_dds\_client/’. However, the changes I made to the ‘topic’ sections in the file did not take effect when I attempted to upload it.

---

<div class="post-metadata">

**Author:** ![Benja](https://discuss.px4.io/user_avatar/discuss.px4.io/benja/32/11872_2.png) [@Benja](https://discuss.px4.io/u/Benja)\
**Post date:** [December 27, 2023, 12:58pm UTC](https://discuss.px4.io/t/usage-of-multiple-px4s-in-offboard-mode/36058/2 "2023-12-27T12:58:06Z")

</div>

see [[Bug] Two PX4 boards cannot be used simultaneously in offboard mode · Issue #22587 · PX4/PX4-Autopilot · GitHub](https://github.com/PX4/PX4-Autopilot/issues/22587#issuecomment-1870159285)

---

<div class="post-metadata">

**Author:** ![serkan](https://discuss.px4.io/user_avatar/discuss.px4.io/serkan/32/15385_2.png) [@serkan](https://discuss.px4.io/u/serkan)\
**Post date:** [October 31, 2024, 11:19am UTC](https://discuss.px4.io/t/usage-of-multiple-px4s-in-offboard-mode/36058/3 "2024-10-31T11:19:43Z")

</div>

I downloaded the PX4-Autopilot software and solved the problem by adding different names to the uxrce\_dds\_client section in the “PX4-Autopilot/src/modules/uxrce\_dds\_client/module.yaml” file while installing.

resources: [uxrce-dds-client](https://docs.px4.io/main/en/modules/modules_system.html#uxrce-dds-client)

The parameter specified in uxrce-dds-client must be added and the namespace we want to add must be added.

---

<div class="post-metadata">

**Author:** ![px4ke](https://discuss.px4.io/letter_avatar_proxy/v4/letter/p/a183cd/32.png) [@px4ke](https://discuss.px4.io/u/px4ke)\
**Post date:** [June 10, 2025, 10:53am UTC](https://discuss.px4.io/t/usage-of-multiple-px4s-in-offboard-mode/36058/4 "2025-06-10T10:53:46Z")

</div>

Hi serkan, I am have the same problem as you. I also try to control multiple drones but cannot switch to offboard mode. Could you please tell me how you changed the module.yaml?

---

<div class="post-metadata">

**Author:** ![serkan](https://discuss.px4.io/user_avatar/discuss.px4.io/serkan/32/15385_2.png) [@serkan](https://discuss.px4.io/u/serkan)\
**Post date:** [June 16, 2025, 5:59am UTC](https://discuss.px4.io/t/usage-of-multiple-px4s-in-offboard-mode/36058/5 "2025-06-16T05:59:31Z")

</div>

Hi @px4ke  
At the top of the file located at `src/modules/uxrce_dds_client/module.yaml`, in the following section

```auto
serial_config:
    - command: |
        if [$SERIAL_DEV != ethernet]; then
            set UXRCE_DDS_ARGS "-t serial -d ${SERIAL_DEV} -b p:${BAUD_PARAM}"
        else
            set UXRCE_DDS_ARGS "-t udp"
        fi
        uxrce_dds_client start ${UXRCE_DDS_ARGS} -n drone_1

      port_config_param:
        name: UXRCE_DDS_CFG
        group: UXRCE-DDS Client
      supports_networking: true

```

```auto
uxrce_dds_client start ${UXRCE_DDS_ARGS} -n drone_1

```

the value provided after the `-n` parameter will be used as the active name of the drone.

---

<div class="post-metadata">

**Author:** ![px4ke](https://discuss.px4.io/letter_avatar_proxy/v4/letter/p/a183cd/32.png) [@px4ke](https://discuss.px4.io/u/px4ke)\
**Post date:** [June 16, 2025, 6:17am UTC](https://discuss.px4.io/t/usage-of-multiple-px4s-in-offboard-mode/36058/6 "2025-06-16T06:17:14Z")

</div>

Hi @serkan , thanks for the reply. I solved my problem without chaging the module.yaml. I followd the instruction from [Multi-Vehicle Simulation with Gazebo | PX4 Guide (main)](https://docs.px4.io/main/en/sim_gazebo_gz/multi_vehicle_simulation.html) but I realized if I use

```sh
PX4_SYS_AUTOSTART=4001 PX4_SIM_MODEL=gz_x500 ./build/px4_sitl_default/bin/px4 -i 1

```

the copter target system is set to 2 instead of 1.

---

<div class="post-metadata">

**Author:** ![serkan](https://discuss.px4.io/user_avatar/discuss.px4.io/serkan/32/15385_2.png) [@serkan](https://discuss.px4.io/u/serkan)\
**Post date:** [June 16, 2025, 6:38am UTC](https://discuss.px4.io/t/usage-of-multiple-px4s-in-offboard-mode/36058/7 "2025-06-16T06:38:41Z")

</div>

Yes, if you are working in simulation, it’s more appropriate to do it that way. My answer mainly applies to real systems that communicate over serial. Since the simulation runs over UDP, any changes you make in `serial_config` won’t affect the system in that case.
