Raspberry Pi Setup
These are the instructions to set up Ubuntu 20.04 Focal Fossa on the robot's computer, a Raspberry Pi 4 B.
Note
In case you don't have a Raspberry Pi 4 B, it is also possible to create the robot using a Jetson Nano from Nvidia. See the related section in the documentation.
Ubuntu 20.04 image for the Raspberry Pi
ROS Noetic needs Ubuntu 20.04. Its standard support ended in May 2025 (see ROS Setup), and Raspberry Pi Imager no longer lists it. The official image from Ubuntu is still available: Ubuntu Server 20.04.5, without a desktop, which the robot doesn't need, because you work on it over SSH from your PC. The experimental Robot Container runs Noetic on a current OS instead, Ubuntu Server 24.04.
Download ubuntu-20.04.5-preinstalled-server-arm64+raspi.img.xz from Ubuntu's 20.04 release folder, and compare its checksum with the SHA256SUMS file there.
Not yet tested with DiffBot and Remo
The robots were set up with Ubuntu MATE 20.04.1, which has a desktop. Ubuntu MATE no longer offers it for download (its support for 20.04 ended in April 2023); it's only in the archive on releases.ubuntu-mate.org. Ubuntu Server hasn't been tested with the robots' hardware yet: I2C, the serial ports, the LiDAR and the camera. If your robot already runs Ubuntu MATE 20.04.1, you don't need to reinstall it to follow these docs.
Flash the image to an empty microSD card with Raspberry Pi Imager: under the operating system, choose Use custom and select the downloaded file. balenaEtcher works too.
Info
Flashing in this context, means the transfer of software data, also referred to as Firmware, from your computer to a device, such as a the sd card in this case. The term “to flash” comes from the Flash storage component of a device where the Firmware is stored.
First boot
Before the first boot, set up the Wi-Fi: on the card's system-boot partition, open network-config and remove the # at the start of the wifis: example's lines, down to the first access point. Replace myhomewifi with your network's name, keeping the colon, and S3kr1t with its password. Indent with spaces, not tabs. The image applies this file only at the first boot.
Insert the card and power up the Raspberry Pi. Log in with the user ubuntu and the password ubuntu, either over SSH (see below; the robot's IP address is in your router's list of devices) or with a monitor and keyboard. You have to choose a new password right away.
Changes to the boot configuration, such as the I2C lines on Hardware Interfaces, go into usercfg.txt on the system-boot partition (/boot/firmware/usercfg.txt): the image's config.txt says not to edit it. dtparam=i2c_arm=on is already set.
Wifi Issues
Country setting for 5 GHz networks: outside the US, the Raspberry Pi may not connect to a 5 GHz network until it knows your country. On the system-boot partition, add cfg80211.ieee80211_regdom=AT to the end of the single line in cmdline.txt, with your country's code instead of AT, as the image's network-config describes.
Robots with Ubuntu MATE: Wi-Fi power save
So far there are no known issues using WiFi with Ubuntu MATE 20.04 arm64 on the Raspberry Pi 4B. Ubuntu MATE manages the Wi-Fi with NetworkManager; Ubuntu Server uses netplan instead, and we haven't tested whether it needs a power-save setting.
There might be some wifi issues where the connection is lost after some time. This might be a firmware issue reported here. Although the wifi power save management is turned off by default, make sure to also do this for external wifi usb dongles by editing the following file
1 | |
It contains:
1 2 | |
Set this to 2 to turn power management off.
Possible values for the wifi.powersave field are:
1 2 3 4 | |
(Informal source on GitHub for these values.)
You can check if it is turned off with iwconfig:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | |
This is the output when there is one external usb WiFi dongle connected to the Raspberry Pi 4 B and no ethernet cable.
Instructions to install Wifi drivers
In case you use a Realtek USB Wifi dongle it might not be directly supported by the linux kernel.
To install the correct driver, you first have to figure out the driver id. When plugging in the USB Wifi dongle and running dmesg afterwards
should output something similar to:
1 2 3 4 5 | |
With the idVendor=0bda and idProduct=c811 you can search for the correct driver. In this case it is the
1 | |
For it the instructions in the https://github.com/brektrou/rtl8821CU repository can be used to install the driver.
Warning
These instructions are specifically for the Realtek (id c811) USB wifi dongle. In case you use another USB dongle it might work directly or there exists a ubuntu package. In general try to use Google for instructions on how to install. The following is only an example on what might be needed to get the driver working.
After cloning this package, the Makefile needs to be adapted to work for the Raspberry Pi 4B:
1 2 3 4 | |
Then follow the instructions from the README.md:
1 2 3 | |
and finally make and install the driver:
1 2 | |
After a reboot the USB Wifi dongle should be detected and two wifi adapters should show up - the internal wifi module on the RPi and the USB dongle.
Sources
- Disable power management in Stretch
- How to turn off Wireless power management permanently
- RPi4: WiFi client crashes often (brcmf_fw_crashed: Firmware has halted or crashed)
- WLAN Karten Realtek (german)
Remote access with SSH
To work on the robot from your PC, without a monitor and keyboard on the robot, log in with SSH (OpenSSH server). The robot runs the SSH server, and your PC is the client. Both must be in the same network. On the robot, install the server (Ubuntu Server has it already):
1 | |
On your PC, in Linux or in the Ubuntu in WSL 2, the ssh client is usually already installed. Log in with your user name on the robot and its IP address, which hostname -I on the robot shows. For example:
1 | |
Next, on the robot: install ROS Noetic, as described in ROS Setup.
Comments
Comments are GitHub Discussions, shown with giscus. Loading them connects to giscus.app (hosted by Vercel, USA) and GitHub (USA); you need a GitHub account to comment.