Open MarcinMlodzinski opened 1 year ago
Could you provide which command are you using for instantiating the agent?
Also, have you checked if the STM32 is sending data through the USB-Serial?
Could you provide which command are you using for instantiating the agent?
ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/serial/by-id/usb-STMicroelectronics_STM32_STLink_066EFF514852897267173214-if02
where /dev/serial/by-id/usb-STMicroelectronics_STM32_STLink_066EFF514852897267173214-if02 is present when I plug in the microcontroller.
Also, have you checked if the STM32 is sending data through the USB-Serial?
command: screen /dev/serial/by-id/usb-STMicroelectronics_STM32_STLink_066EFF514852897267173214-if02
gives nothing
In addition I'd say that with ESP32 on freertos everything works fine.
It seems that you are not using the correct USB port. This board has two USBs, the one that you are connecting is the STLink interface that bridges a UART of the main MCU. Maybe micro-ROS is communicating using the USB-CDC available in the other port. It depends on your transport configuration.
Can you check that?
You're right - that board has two USB ports: one marked as USB STLINK (which i plugged into RPi) and another marked as USB OTG. Ubuntu doesn't see the device if it is connected to the USB OTG port (using command sudo dmesg | grep tty
, which shows something if I connect microcontroller with USB STLINK). If I should check something in micro-ros configs, I need specific instructions where to look for it.
You can switch between transports using the configure step: https://github.com/micro-ROS/micro_ros_setup/blob/cdd082b8152a8931ddab5adee33da036ce158fd1/config/zephyr/generic/configure.sh#L27-L34
BTW are you adjusting the power supply jumper when changing the USB or you are just connecting both of them?
In any case, I recommend you using the Zephyr module for micro-ROS https://github.com/micro-ROS/micro_ros_zephyr_module
are you adjusting the power supply jumper when changing the USB or you are just connecting both of them?
I've tried both methods and some green diodes were flashing during those attempts to see the microcontroller from ubuntu, so I assume it was powered correctly.
I finally managed to make that micro-ROS Zephyr module flashing the board. Sadly it works in the same way as micro_ros_setup did. Do you have any other suggestions?
Check your cables, check if you are able to send some data using the serial port...
I'm encountering the same problem. Hardware is RP2040 based, following these instructions - https://ubuntu.com/blog/getting-started-with-micro-ros-on-raspberry-pi-pico
I can get it to come up if i reset the board, or un plug and re plug the board in before starting the micro ros agent.
My target application does have the ability to power cycle the pico, so it's not a massive issue, but is problematic for other users that don't have this ability.
Please advice as to what debug output etc you require to assist.
run with - micro-ros-agent serial --dev /dev/ttyACM0 baudrate=115200
and or - sudo micro-ros-agent serial --dev /dev/ttyACM0 baudrate=115200
@Chick92 I think you might be running into the RPi Pico Errata E5 where it doesn't init the usb of the pico properly in certain circumstances.
Steps to reproduce the issue
Expected behavior
Micro-ros node starts properly and its topics are visible from Raspberry.
Actual behavior
Micro-ros agent stops on:
Additional information
I tried to unplug, then plug in the board and resetting it with dedicated pushbutton. Raspberry runs ROS2 Humble on Ubuntu 22.04 server with kernel:
Linux ubuntu 5.15.39-rt42-raspi #1 SMP PREEMPT_RT Sat Jul 16 08:34:58 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux