Failed status in rclc_support_init
I am testing microROS with an ESP32, FreeRTOS and the demo ping-pong (code unmodified). However, it fails on this line:
RCCHECK(rclc_support_init(&support, 0, NULL, &allocator));
It properly connects to y home wifi and then this two lines are printed:
micro-ROS transport: connected using UDP mode, ip: '192.168.1.124', port: '8888' Failed status on line 87: 1. Aborting.
Also, in the agent running in my computer, I can see the session being re-established several times.
sanjo:microros_ws$ ros2 run micro_ros_agent micro_ros_agent udp4 --port 8888
[1620584967.923002] info | UDPv4AgentLinux.cpp | init | running... | port: 8888
[1620584967.923424] info | Root.cpp | set_verbose_level | logger setup | verbose_level: 4
[1620584981.623578] info | Root.cpp | create_client | create | client_key: 0x18C6B6B8, session_id: 0x81
[1620584981.623684] info | SessionManager.hpp | establish_session | session established | client_key: 0x415676088, address: 192.168.1.92:33485
[1620584982.594373] info | SessionManager.hpp | establish_session | session re-established | client_key: 0x415676088, address: 192.168.1.92:33485
[1620584983.593569] info | SessionManager.hpp | establish_session | session re-established | client_key: 0x415676088, address: 192.168.1.92:33485
[ ... ]
No topic is created, the code doesn't reach that point.
I am seeing the same on an Olimex-E407 board with UDP as the transport. It happens regardless of whether I try it on FreeRTOS or NuttX.
From initial digging, the error code returned is 1, which corresponds to:
...which is not very helpful because it just means "generic error". Will try to dig further to see where the error is thrown.
In my case, it turned out that I was configuring with the microcontroller's IP address instead of the target PC's IP address. Entering the correct IP address fixed it for me! Hope that helps.