I want to use WSL2 on my development PC to send control signals to nodes running on a Raspberry Pi.

To get there I have a three step plan:

  1. get connectivity
  2. get ros2 humble communications to work
  3. get it to work with my software

Step 1)

Seems to work:

I've setup a subnet for the WSL2 with Wireguard. WSL2 has the address On the other end is the server.wg0 adapter with address The Raspberry Pi is in the subnet provided by my fritzbox with address I've set up routing on the fritzbox to use my development machine as the gateway to the subnet. Pinging between all of the participants works, so I guess the basic network architecture is ok. An example traceroute:

traceroute to (, 30 hops max, 60 byte packets

 1  DESKTOP-XXXXXX.fritz.box (  2.225 ms * *
 2 (  3.682 ms  3.902 ms  3.985 ms

Step 2)

To test if I can get ros2 humble / FastDDS right, I am using ros2 run demo_nodes_cpp talker on the WSL2 Ubuntu 22.04 and ros2 run demo_nodes_cpp listener on the Raspberry Pi Ubuntu 22.04.

I am currently not getting them to talk to each other. I've read a bit in the documentation and ended up with the following configurations for FastDDS: on WSL2:

<?xml version="1.0" encoding="UTF-8" ?>

    <profiles  xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">
        <!-- Configuration for the control computer -->
        <participant profile_name="control_computer_profile">

                    <!-- initial peer list -->
                    <!-- discovery config -->

On the RasPi the differences are the IP address and port number


as well as the <participantID>1</participantID>.

I have confirmed that the config.xmls get read, since when using an invalid value for the log level I get errors. However, even with log level Log::Kind::Info I get no output on my CLI which I would assume is the StdoutErrConsumer.

I have also opened the firewalls on both Ubuntu systems with

sudo iptables -A INPUT -p udp --dport 7410 -j ACCEPT
sudo iptables -A INPUT -p udp --dport 7411 -j ACCEPT

on WSL2 and

sudo iptables -A INPUT -p udp --dport 7412 -j ACCEPT
sudo iptables -A INPUT -p udp --dport 7413 -j ACCEPT

on the RasPi.

My Questions:

  1. How do I get the talker / listener example to work?
  2. How can I get more information of what is happening on startup? I.e. if FastDDS tries to connect to the peers on the initial peer list.
  3. Are there similar questions on this site or tutorials online around this issue?
  4. Can you give me an explanation of the PDP for dummies especially what the parameters do and if and when discovery ends? What happens say if another ros2 system wants to join five minutes after start up?
  5. Any other troubleshooting ideas? As in what to do and how to make it easier to spot mistakes?

Step 3)

Not there yet.


1 Answer 1


ROS 2 uses multicast packets for discovery unless you set it up differently. The multicast packets may not be routed across your subnet, which is something you can check in your router configuration.

You can also use the ros2 multicast receive and ros2 multicast send utilities to assist in debugging the network.

If you cannot make changes to the router, you may be able to get the nodes to communicate through a discovery server: https://docs.ros.org/en/humble/Tutorials/Advanced/Discovery-Server/Discovery-Server.html

  • $\begingroup$ This helped! Thank you @proan! There was no mention of multicast in my routers manual, so I assume it's not available feature, even though I am not confident. Using a discovery server worked. I got the demo_nodes_cpp example to run between WSL and the RasPi. Thanks a lot for the hint! $\endgroup$ Nov 22 at 15:47

Your Answer

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

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