How to enable UDP multicast communication?
Hi all, i'm having a really bad time with ROS2 communication between 2 machines: 1. my laptop where i run a VM with ubuntu focal ( ip 192.168.1.24) 2. Raspi 4 with Ubuntu focal as well running ROS2 (ip 192.168.1.42) I set the ROS_DOMAIN_ID=5 on both machines. The problem is that when i try to make a communication between the 2, ie running a listener node on Raspi and a talker node on the VM, nothing happens! Neither when i run the ros2 multicast send / receive doesn't give any responses!! Surfing on internet, i found that it might be a UDB multicast communication problem, but unfortunately i didn't found any solutin!! Any ideas? Thanks.
This is the ip addr on the VM:
andi@andi-vm:~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 08:00:27:14:e4:9a brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic noprefixroute enp0s3
valid_lft 86173sec preferred_lft 86173sec
inet6 fe80::5ae5:7f99:50fa:1e8d/64 scope link noprefixroute
valid_lft forever preferred_lft forever
and this is on the Raspi:
andi@andi-raspi:~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether dc:a6:32:e9:fa:20 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether dc:a6:32:e9:fa:21 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.42/24 brd 192.168.1.255 scope global dynamic noprefixroute wlan0
valid_lft 86228sec preferred_lft 86228sec
inet6 2a02:8428:1d60:fc01:fc52:84a0:d7fd:e5c9/64 scope global dynamic noprefixroute
valid_lft 604783sec preferred_lft 604783sec
inet6 fe80::4d6:4e0:eaf9:fbd7/64 scope link noprefixroute
valid_lft forever preferred_lft forever
Can you show the network configuration (ip addr) on Linux, or similar on your OS? You need to make sure multicast is enabled on your network interface.
At the ROS level, the default settings already have it enabled.
I updated the question with this info.
Can you ping the PC with VM and RPi normally? The addition of the VM layer could be to blame for the problem - what software are you using for VMs? Can you check if the VM config has the networking enabled/bridged?
Yes i can ping the Pc by both VM and Raspi. The VM has Ubuntu focal. The thing is that from the Raspi i cannot ping the VM ip which is 10.0.2.15 (the one assigned to the VM), but i do ping the PC (192.168.1.24). In the VM Network conf i have the Virtual-Box Host-Only Ethernet Adapter with address 192.168.56.1. So i guess that the problem is in the assignement of the VM ip address. I do not know that much on how does this work!
Can you check, whether your ports (on both sides) are open or not? Check here: https://docs.ros.org/en/galactic/Conc... which UDP ports should be open according to your
ROS_DOMAIN_ID
Which VM do you use? VirtualBox? If yes, check this document: https://nsrc.org/workshops/2014/sanog...