micro-ROS / micro_ros_renesas_demos

Demo code for Renesas e2 studio
Apache License 2.0
4 stars 5 forks source link

Identify USB port for demo app #109

Closed gsokoll closed 1 year ago

gsokoll commented 1 year ago

Issue template

Attempting to run the USB demo app on a RA6M5 board and connect to a micro ROS agent running on an Ubuntu 22.04 PC via USB. Unable to run the agent without knowing the appropriate USB port. No USB port appears when the micro ros app is running on the RA6M5 board.

Steps to reproduce the issue

Cloned per "Getting started" instructions. Imported projects into e2 Studio, fixed USB clock configuration issues, built and ran code. Connected USB High Speed port on RA6M5 board to PC USB port (Ubuntu 22.04).

Expected behavior

A USB device would appear when using lsusb or dmesg to query available USB devices.

Actual behavior

No new USB devices appear when disconnecting and reconnecting the RA6M5 board.

Additional information

The LED's on the RA6M5 indicate it is timing out on the "RCCHECK(rclc_node_init_default(&node, "my_renesas_node", "", &support));" line (red LED starts blinking after about 10 seconds).

Any suggestions?

pablogs9 commented 1 year ago

EK-RA6M5 has 3 micro USB ports, which one is your connection to the micro-ROS Agent?

Acuadros95 commented 1 year ago

@gsokoll Any update on this?

gsokoll commented 1 year ago

Sorry for the delay in replying. I ultimately got it working:

This is a little bit of a trap. You can't run the agent without knowing which serial device to use. So you first need to run the micro ros app before launching the agent, and check the available serial devices within the first 10 seconds or so after starting the micro ros app (i.e. before code times out and the serial device disappears).

pablogs9 commented 1 year ago

Closing as resolved

Acuadros95 commented 1 year ago

If you start the micro ros app on the board without the agent running first, the USB device will be visible briefly but then disappear after a few seconds (once the "create node" code in the micro ros app fails).

This can be fixed with a reconnection approach. Check this tutorial: Reconnections and liveliness: Client side.