micro-ROS / micro_ros_setup

Support macros for building micro-ROS-based firmware.
Apache License 2.0
380 stars 137 forks source link

Impossible to retrieve an IP on Olimex E407 (ping pong app with UDP) #448

Closed guilyx closed 2 years ago

guilyx commented 2 years ago

Hello there!

I tried requesting an invite to the slack channel since I felt this would be easier with a direct chat, but didn't receive any email after clicking the button, so here I am.

Issue template

I have the JTAG, Serial to USB and Ethernet plugged in my laptop. Agent is ran in the rolling docker image.

Steps to reproduce the issue

Followed the tutorial for my setup using the provided docker image for rolling, with minor changes for using UDP instead of Serial.

Tried both these netplan configurations

network:
  version: 2
  renderer: networkd
  ethernets:
    eno1:
      dhcp4: no
      dhcp6: no
      addresses:           
        - 192.168.1.176/24
network:
  version: 2
  renderer: networkd
  ethernets:
    eno1:
      dhcp4: yes
      dhcp6: no
      addresses:           
        - 192.168.1.176/24
      gateway4: 192.168.1.1

Commands ran

# Laptop
docker run -it --net=host -v /dev:/dev --privileged ros:rolling

# Board
ros2 run micro_ros_setup configure_firmware.sh ping_pong -t udp -i 192.168.1.176 -p 8888
ros2 run micro_ros_setup build_firmware.sh
ros2 run micro_ros_setup flash_firmware.sh

# Docker (agent)
ros2 run micro_ros_setup create_agent_ws.sh
ros2 run micro_ros_setup build_agent.sh
source install/local_setup.bash
ros2 run micro_ros_agent micro_ros_agent udp4 --port 8888 -v6

Expected behavior

Just the Ping Pong app's normal behavior.

Actual behavior

Serial Output

Ethernet Initialization
Waiting for IP
Impossible to retrieve an IP
*************************************
Task     State      Prio      Stack         Num
*************************************
initTask   X         23               1240     1
IDLE       R          0                108       2
tcpip_thread     B
microROS_app   B
LinkThr              B
EthIf                 B
Tmr Svc             B
********************************
Failed status on line 87: 1. Aborting.

Agent output

[1643902859.760252] info     | UDPv4AgentLinux.cpp | init                     | running...             | port: 8888
[1643902859.760623] info     | Root.cpp           | set_verbose_level        | logger setup           | verbose_level: 6

Additional information

Basically want to know if there's any additional steps to what I did to get the connection to be established. Do I have to modify the IP anywhere ? Does my netplan configuration look wrong to you ?

I tested the ping pong app using serial communication and could list and echo the topics. Maybe there's something I missed...

pablogs9 commented 2 years ago

Is your Olimex board connected to a router that can provide IP addresses via DHCP?

guilyx commented 2 years ago

Hey @pablogs9, I do have a router which is configured to deliver IPs from 192.168.1.170 to 192.168.1.180.

I made the application work with the following netplan:

network:
  version: 2
  renderer: networkd
  ethernets:
    eno1:
      dhcp4: yes
      dhcp6: no

Could see the topics/publisher/subscribers created and echo/publish from/to topics fine. I think I got biased by another tutorial (external to microros.org that used static IPs) when configuration the example app. Maybe the page could benefit from having a tutorial explicitly for the UDP configuration?