Skip to content

Question about how to debug communication data between micro-ROS-agent and micro-ROS-client #265

Open

Description

@ChoiYouJung

Hello.
I'm running micro-ROS-agent on Linux. And micro-ROS-client (I'm running micro_ros_arduino) on the MCU to communicate with the agent.

However, as I've been running micro-ROS, I've noticed a lot of data being sent and received, and the data cycles are fast, so I've been experiencing frequent communication issues.

So, I'd like to know how to identify where communication issues and bottlenecks are occurring in micro-ROS.

As far as I know, changing the log level with the -v option when running micro-ROS-agent itself changes the diversity of the logs.
ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyACM0

However, when I use the -v option to view the data, it's too fast for the human eye. I'd like to either print out the transmitted and received data so it can be viewed by the human eye, or record it.

Is there an easy way to view or record this data, or a way to implement my own code, or a free debugging tool?

Thank you.

Activity

  1. Geibinger commented on Jan 11, 2026

    @Geibinger

    Hi @ChoiYouJung
    What exactly is it you want to debug? You have a few options. You could literally debug the agent code. For that you need to clone the agent repo and build it from source, then add appropriate debugging configuration (for C++ and VSCode, checkout this page). Then you can debug the agent just as any other ros2 C++ node.

    But I assume what you mean with debugging is checking the message throughput, loss and latency? That is something I did recently for a custom BLE transport. A common approach is that you setup publishers and subscribers for the topics you want to investigate within the MCU. Then, in the subscription callback within the firmware, you immediately publish back the same message. This way, you can make a normal benchmark node on your host (where the micro-ROS agent is running) that

    1. Publishes the benchmark message
    2. Saves the timestamp that the message has been published
    3. Waits until the same message is received again
    4. Saves the reception timestamp

    This way you can measure the round trip time (RTT). RTT/2 then is a good approximation for your one way message latency.

    To measure message loss, you could add a sequence integer as message content which you simply increase for every sent message. This way you can easily check if you received all sent sequence integers.

    Here are a few repos I created for this. Note that they are not super pretty, but I changed the visibility to public, maybe they help:

    If you have any questions, happy to help! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions