# Unexpected topic ID when starting micrortps agent

**URL:** <https://discuss.px4.io/t/unexpected-topic-id-when-starting-micrortps-agent/20482>\
**Category:** ROS 1 / ROS 2\
**Created:** [January 12, 2021, 12:16pm UTC](https://discuss.px4.io/t/unexpected-topic-id-when-starting-micrortps-agent/20482 "2021-01-12T12:16:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![moustafa](https://discuss.px4.io/user_avatar/discuss.px4.io/moustafa/32/8102_2.png) [@moustafa](https://discuss.px4.io/u/moustafa)\
**Post date:** [January 12, 2021, 12:16pm UTC](https://discuss.px4.io/t/unexpected-topic-id-when-starting-micrortps-agent/20482/1 "2021-01-12T12:16:15Z")

</div>

**I use ROS2 foxy on a companion computer that is connected to FMU with px4\_rtps via UART.**

**Whenever I try to start micrortps agent on the companion computer, I get the following output:**

```
~/px4_ros_com_ros2$ micrortps_agent -d /dev/ttymxc2 -b 921600
--- MicroRTPS Agent ---
[micrortps_agent]	Starting link...
[micrortps_agent]	UART transport: device: /dev/ttymxc2; baudrate: 921600; sleep: 1us; poll: 1ms; flow_control: No
--- Subscribers ---
- DebugArray subscriber started
- DebugKeyValue subscriber started
- DebugValue subscriber started
- DebugVect subscriber started
- OpticalFlow subscriber started
- PositionSetpoint subscriber started
- PositionSetpointTriplet subscriber started
- Timesync subscriber started
- TrajectoryWaypoint subscriber started
- VehicleTrajectoryWaypoint subscriber started
- OnboardComputerStatus subscriber started
- VehicleMocapOdometry subscriber started
- VehicleVisualOdometry subscriber started
-----------------------

---- Publishers ----
- InputRc publisher started
- SatelliteInfo publisher started
- SensorCombined publisher started
- Timesync publisher started
- VehicleOdometry publisher started
- CollisionConstraints publisher started
-----------------------
[micrortps_agent]	Unexpected topic ID to publish
[micrortps_agent]	Unexpected topic ID to publish
.
.
**[I clicked ctrl+C]**
 **^C** [micrortps_agent]	Interrupt signal (2) received.
[micrortps_transport]	Closed UART.
[micrortps_agent]	SENT: 52messages - 2600bytes
[micrortps_agent]	RECEIVED: 2684messages - 312298bytes; 2795 LOOPS - 5.136 seconds - 60.80KB/s
[micrortps_agent]	Unexpected topic ID '0' to getMsg

```

**If I leave if for a while without pressing ctrl+C, I get the following error:**

```
[micrortps_agent]	Unexpected topic ID to publish
[micrortps_agent]	Unexpected topic ID to publish
[micrortps_agent]	Unexpected topic ID to publish
[micrortps_agent]	Unexpected topic ID to publish
terminate called after throwing an instance of 'eprosima::fastcdr::exception::BadParamException'
  what(): Unexpected byte value in Cdr::deserialize(bool), expected 0 or 1

```

**Also, my px4 shell keeps displaying the following warning:**  
`WARN [micrortps_client] Unexpected topic ID`

Could somebody tell me what might be a cause to such an issue? Thanks!

---

<div class="post-metadata">

**Author:** ![TSC21](https://discuss.px4.io/user_avatar/discuss.px4.io/tsc21/32/4866_2.png) [@TSC21](https://discuss.px4.io/u/TSC21)\
**Post date:** [January 13, 2021, 12:47pm UTC](https://discuss.px4.io/t/unexpected-topic-id-when-starting-micrortps-agent/20482/2 "2021-01-13T12:47:49Z")

</div>

Please make sure to use the latest `px4_ros_com`, `px4_msgs` and PX4-Firmware. Also another note: you are using a low baud rate for the bandwidth being occupied and streams being used - [please check this PR comment](https://github.com/PX4/PX4-Autopilot/pull/15354#issuecomment-661052360) for more details (the documentation is being rewritten to cover this). So you rather reduce the number of topics on the stream, add a delay using the `-w` option (this though propagates some latency on the link) or you increase the baud rate (together maybe with flow control, but you need to make sure that the flow control is activated on both sides of the link).

---

<div class="post-metadata">

**Author:** ![asaif](https://discuss.px4.io/user_avatar/discuss.px4.io/asaif/32/9999_2.png) [@asaif](https://discuss.px4.io/u/asaif)\
**Post date:** [July 21, 2022, 2:21pm UTC](https://discuss.px4.io/t/unexpected-topic-id-when-starting-micrortps-agent/20482/3 "2022-07-21T14:21:13Z")

</div>

Hello Moustafa,

How did you solve that issue?
