Closed ZhenshengLee closed 2 years ago
This is not a bug, the client will try to connect to the agent at the begging of the app for a certain amount of times with a certain timeout.
If this attempt fails, in this example, the app will fail. You can check the return value of this function and retry until the agent is reached. You can ping the agent in order to wait until it is available. But in general, you should handle the client-agent connection.
In your use case, if you open the agent and later the client, the client might lose all the opportunities to connect. If you open the agent and then the client, it will succeed.
Thanks a lot!
I will check more info from xrce-agent and xrce-client doc.
Issue template
Steps to reproduce the issue
ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/serial/by-id/usb-STMicroelectronics_STM32_STLink_0670FF555071494867152654-if02
ros2 topic echo /freertos_int32_publisher
Expected behavior
Any time you plug the board, agent would established the link.
Actual behavior
agent output
Additional information
If you first run agent, then plug the board, the link will be established, and the demo would work
I think it may be related with #72 , and may be a problem with the initialization of the serial link.
I am not familar with embedded development so any help would be appreciated.
Thanks.