3
$\begingroup$

I have two different machines installed with ubuntu 22.04 and ros (2) humble. I connected those two machines to the same subnet over ethernet connection, and check that they can ping each other. Then I executed in one machine:

ros2 run demo_nodes_cpp listener 

And in the other machine:

ros2 run demo_nodes_cpp talker

The communication works perfect.

But, when I did the same thing with the difference of connecting one the those machines to the same subnet via WIFI instead of via ethernet then there is no communication between the nodes. I also try direct wifi connection (turned one of the machines to hotspot). It didn't work. Any idea how to enable the communication over wifi?

It also didn't work with direct wifi connection (without a router). I checked traffic with Wireshark, I can see the broadcast messages over the ethernet network device but not over the wifi network device. I don't get it, if it is notoriously bad over wifi how otherwise autonomous robots communicate with ros2?

$\endgroup$
2
  • 1
    $\begingroup$ reconfigure your router ... it's probably blocking LAN access from WiFi $\endgroup$
    – jsotola
    Aug 14, 2023 at 15:43
  • $\begingroup$ In addition to wireless router config issues around multicast & NAT, the ros2 DDS node discovery is notoriously bad over wifi. Many people need to add a "discovery server" to work around this problem. $\endgroup$
    – Mike973
    Aug 15, 2023 at 12:10

1 Answer 1

1
$\begingroup$

Found the problem, it was definitely the router.

I couldn't find which of the settings I should change so I switched to another router and it worked.

Four out of five routers I tested blocked broadcasting over Wi-Fi. Unfortunately, as Mike973 said it would be, it works very slow:

In addition to wireless router config issues around multicast & NAT, the ros2 DDS node discovery is notoriously bad over wifi. Many people need to add a "discovery server" to work around this problem.

$\endgroup$
2
  • $\begingroup$ It is great that you found the source of your problem, i.e. the router. However, you can't ask a follow up question in the answer because it messes up the Q&A mechanism of Stack Exchange. I would suggest either: (1) asking a new question regarding how to make it faster (and delete that last line from this answer), or; (2) updating your current question, with the info in this answer (and then delete this answer post, as it could be considered just an extension of your question, and not really an answer per se). Please take the tour to better understand how SE works. $\endgroup$ Aug 17, 2023 at 7:06
  • $\begingroup$ I have removed the follow up question: Is there a way to make it reasonably faster over ROS2?. If the issue still persists, please ask a new question. Please don't forget to mark your answer as the accepted answer. You can always change the accepted answer should a better answer be posted in the future. Thanks. $\endgroup$ Mar 13 at 11:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.