Can't get esp32_wifi to stay connected to microros_agent #4
Replies: 3 comments 1 reply
-
For sparkfun esp32 thing, please try change the board. ''' https://docs.platformio.org/en/latest/boards/espressif32/esp32thing.html Did you connect the external antenna to waveshare board? You may also try another wifi router/AP. Did you connect wifi antenna to waveshare board? |
Beta Was this translation helpful? Give feedback.
-
Yes. Most of my robots use esp32 wifi without a robot computer on them. I didn't see such issue. I use an old pc to run opnsense. I use several tp-link ax21 as wifi AP. ax21 works very well. You may try my fork of linorobot2_hardware. There is rsyslog support. |
Beta Was this translation helpful? Give feedback.
-
Thank you very much for your helpful suggestions Thomas. I got the rsyslog server working and it showed me that the gendrv_wifi host was connecting and logging an error about IMU initialization. This apparently was the cause of micro_ros_agent continually restarting, because when I commented out the IMU the micro_ros_agent stayed connected and I was able to see the odometry and (blank) IMU messages coming over wifi to my laptop. I'm sure I can figure out the IMU problem from here - the starting point you gave me was very helpful - thank you! |
Beta Was this translation helpful? Give feedback.
-
I followed the instructions to install and build and download micro_ros_arduino_examples_platformio/micro-ros_reconnection_example, and to build micro-ros. It all works fine when I use the serial port - the micro_ros_agent creates the publisher and datawriter and I can ros2 topic echo and see the incrementing number.
It doesn't work properly when I try to use wifi. I configured my laptop's IP, and the wifi parameters in platformiol.ini. It builds fine, and my router tells me the esp32 connected to my network. But when I start the micro_ros_agent it creates the publisher and datawriter, just like on serial, but then says delete_client, destroy_session, then restarts the connection process all over again, as shown below:
bouchier@xps15:firmware$ ros2 run micro_ros_agent micro_ros_agent udp4 --port 8888 [1739589769.130127] info | UDPv4AgentLinux.cpp | init | running... | port: 8888 [1739589769.130378] info | Root.cpp | set_verbose_level | logger setup | verbose_level: 4 [1739589770.026012] info | Root.cpp | create_client | create | client_key: 0x578BD9D6, session_id: 0x81 [1739589770.026089] info | SessionManager.hpp | establish_session | session established | client_key: 0x578BD9D6, address: 192.168.4.213:47138 [1739589770.071520] info | ProxyClient.cpp | create_participant | participant created | client_key: 0x578BD9D6, participant_id: 0x000(1) [1739589770.086474] info | ProxyClient.cpp | create_topic | topic created | client_key: 0x578BD9D6, topic_id: 0x000(2), participant_id: 0x000(1) [1739589770.098142] info | ProxyClient.cpp | create_publisher | publisher created | client_key: 0x578BD9D6, publisher_id: 0x000(3), participant_id: 0x000(1) [1739589770.117651] info | ProxyClient.cpp | create_datawriter | datawriter created | client_key: 0x578BD9D6, datawriter_id: 0x000(5), publisher_id: 0x000(3) [1739589770.907497] info | Root.cpp | delete_client | delete | client_key: 0x578BD9D6 [1739589770.907517] info | SessionManager.hpp | destroy_session | session closed | client_key: 0x578BD9D6, address: 192.168.4.213:47138 [1739589770.918087] info | Root.cpp | create_client | create | client_key: 0x26DE3F77, session_id: 0x81 [1739589770.918107] info | SessionManager.hpp | establish_session | session established | client_key: 0x26DE3F77, address: 192.168.4.213:47138 [1739589770.930585] info | ProxyClient.cpp | create_participant | participant created | client_key: 0x26DE3F77, participant_id: 0x000(1) [1739589770.941435] info | ProxyClient.cpp | create_topic | topic created | client_key: 0x26DE3F77, topic_id: 0x000(2), participant_id: 0x000(1) [1739589770.953196] info | ProxyClient.cpp | create_publisher | publisher created | client_key: 0x26DE3F77, publisher_id: 0x000(3), participant_id: 0x000(1) [1739589770.977555] info | ProxyClient.cpp | create_datawriter | datawriter created | client_key: 0x26DE3F77, datawriter_id: 0x000(5), publisher_id: 0x000(3) [1739589772.166405] info | Root.cpp | delete_client | delete | client_key: 0x26DE3F77 [1739589772.166461] info | SessionManager.hpp | destroy_session | session closed | client_key: 0x26DE3F77, address: 192.168.4.213:4
It loops like this forever. This happens with both an esp32_thing from Sparkfun and the Waveshare General Driver for Robotics board. I am running Jazzy on Ubuntu 24.04 on my laptop. I tried pio device monitor esp32 but nothing is coming out on serial, yet the esp32 side of the link is trying to work, because if I do ros2 topic echo I see the incrementing number coming out slowly, between restarts of the micro_ros_agent.
Do you have any suggestions for what to look at?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions