Robot Network Configuration
Clearpath robots use netplan
to configure all network connections, including wired and
wireless interfaces. The netplan
package is installed on Ubuntu by default.
To edit the netplan
configuration files you will also need a text editor. The nano
and
vi
editors are included by default, but additional editors such as vim
or emacs
can
also be installed using the apt
command.
Standard Clearpath Bridge
The default networking configuration for a robot's computer is to bridge all Ethernet interfaces and assign the computer
the IP address 192.168.131.1
. See Standard IP Addresses for a detailed list of IP ranges.
Changing or removing the default bridge configuration may result in your robot no longer working
properly. Certain components inside the robot rely on static IP addresses in the 192.168.131.0/24
subnet.
To configure the default bridge, create or edit /etc/netplan/50-clearpath-standard.yaml
to
contain the following:
network:
version: 2
renderer: networkd
ethernets:
bridge_enp:
match:
name: "enp*"
dhcp4: false
dhcp6: false
bridge_enx:
match:
name: "enx*"
dhcp4: false
dhcp6: false
bridge_eth:
match:
name: "eth*"
dhcp4: false
dhcp6: false
bridges:
br0:
addresses:
- "192.168.131.1/24"
dhcp4: true
dhcp6: false
interfaces:
- bridge_eth
- bridge_enx
- bridge_enp
This will bridge all physical ethernet ports together into the br0
bridge, which is assigned
the static address 192.168.131.1
. The bridge can also be used to connect to a wired DHCP
server to provide internet access to the robot.
After editing the file, run the following commands to apply the changes:
sudo netplan --debug generate
-- this will verify your netplan configuration files and notify you if there are errors. Correct any errors before proceeding.sudo netplan try
-- this will try running the new configuration, but will automatically roll back if it doesn't work correctly.sudo netplan apply
-- this will apply the new configuration. Note that if you are logged in over SSH from a remote computer you may lose your SSH connection if the active interface was modified.
Connecting to an Existing Wi-Fi Network
Use netplan
to connect your robot to an existing wireless network.
First, determine the name of your wireless interface by running iwconfig
you should see
an entry similar to this:
wlp59s0 IEEE 802.11 ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=off
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:on
The interface name is in the left column, starting with w
.
Once you have identified your interface, edit or create a file
called /etc/netplan/60-wifi.yaml
containing the following:
network:
wifis:
MY_WIFI_INTERFACE:
optional: true
access-points:
MY_WIFI_SSID:
password: MY_WIFI_PASSWORD
dhcp4: true
with the following substitutions:
- Replace
MY_WIFI_INTERFACE
with the name of the interface you identified in the first step, e.g.wlp59s0
- Replace
MY_WIFI_SSID
with the SSID of your network. - Replace
MY_WIFI_PASSWORD
with your network's password.
For example:
network:
wifis:
wlp59s0:
optional: true
access-points:
BabCom:
password: peekaboo
dhcp4: true
This configuration will connect your robot via DHCP to your WPA2/3 wireless network. If you need to use a static IP address, modify the file to contain the following:
network:
wifis:
MY_WIFI_INTERFACE:
optional: true
access-points:
MY_WIFI_SSID:
password: MY_WIFI_PASSWORD
dhcp4: false
dhcp4-overrides:
send-hostname: true
addresses:
- MY_STATIC_IP/MY_SUBNET
nameservers:
addresses:
- MY_NAMESERVER
with the same substitutions noted earlier, plus
- Replace
MY_STATIC_IP
with the desired static IP address. - Replace
MY_SUBNET
with the length of your network's subnet mask (typically24
or16
) - Replace
MY_NAMESERVER
with the IP address of your DNS server You may add multiple DNS servers with each one on its own line.
For example:
network:
wifis:
wlp59s0:
optional: true
access-points:
BabCom:
password: peekaboo
dhcp4: false
dhcp4-overrides:
send-hostname: true
addresses:
- 10.25.0.134/16
nameservers:
addresses:
- 10.25.0.10
- 8.8.8.8
- 8.8.4.4
Once you have edited the netplan configuration file, run the following two commands:
sudo netplan --debug generate
-- this will verify that the netplan configuration files can be read properly. Correct any errors before proceeding.sudo netplan try
-- this will try running the new configuration, but will automatically roll back if it doesn't work correctly.sudo netplan apply
-- this will apply the new configuration to your network interfaces.
By convention, all Netplan configuration files should be prefixed with two numbers indicating the
order in which the file should be read. Files are read in alphanumeric order, with 00-
prefixes
first and 99-
prefixes last.
If multiple files define the same configuration, the last-read file will override the earlier definitions.
Once all files have been processed the result is amalgamated to create the system's Netplan confguration.