Both the base and the raspberry pi are participating in the ROS2 network. Adding the developer computer to the network, there are multiple options to connect all three. Initially, the idea was that all three could be connected to the same Wi-Fi. This proved unreliable as the base Wi-Fi adapter does not provide stable connectivity. However, base and raspberry pi are internally connected via a USB connection where the base provides a virtual ethernet adapter.
For the use on the UW Campus, some Wi-Fi network must be used to provide connectivity. Either a purpose build access point can be used, or the UW-Lab
network provided by IST.
Option 1: Multi-cast routing
- Forward multi-casts with smcroute
- Currently unavailable: routing between usb subnet and Wi-Fi See https://github.com/turtlebot/turtlebot4/issues/26 for details
Option 2: Layer2 VPN
- e.g. a tap-based openvpn connection between the developer computer and the raspberry pi
- network bridge between the tap interface and the usb adapter on the raspberry pi
Also posted at https://github.com/turtlebot/turtlebot4/issues/26
On raspberry pi
sudo apt install openvpn
Install server.conf
in /etc/openvpn/server
dev tap
ifconfig 192.168.186.9 255.255.255.0
secret static.key
script-security 4
up up.sh
down down.sh
up.sh
in the same folder
#!/bin/bash
sudo ip link add bridge type bridge
sudo ip link set up bridge
sudo ip link set usb0 master bridge
sudo ip link set tap0 master bridge
sudo ip link set usb0 promisc on
sudo ip link set tap0 promisc on
# Move address to bridge interface. Necessary to have connectivity between developer PC and raspberry pi
sudo ip addr del dev usb0 192.168.186.3/24
sudo ip addr del dev tap0 192.168.186.9/24
sudo ip addr add dev bridge 192.168.186.3/24
down.sh
in the same folder
#!/bin/bash
ip link del bridge
Generate key
openvpn --genkey --secret static.key
Start VPN daemon on system startup:
systemctl enable openvpn-server@server.service
and right now
systemctl start openvpn-server@server.service
On client
$ scp RPI:/etc/openvpn/server/static.key ./
Have file client.conf
# raspberry pi wi-fi address
remote 192.168.23.101
dev tap
ifconfig 192.168.186.10 255.255.255.0
secret static.key
Start VPN client
sudo openvpn --config client.cfg
Now ros2 topic echo /odom
should work.
the base and the raspberry pi would by connected to Wi-Fi