Hello everyone, I am the little fish writing this blog while listening to the Great Compassion Mantra. Recently, I moved, and my girlfriend asked me to clean up my electronic waste. I found an old Raspberry Pi in there. It’s not that old, just a Raspberry Pi 3B from two or three years ago, but it has gathered too much dust. My girlfriend suggested I sell it on Xianyu, but I was definitely against it, so I intentionally priced it very high, hoping it wouldn’t sell.
Recently, I have been working with ROS2, so I thought about running ROS2 on the Raspberry Pi to play around with multi-machine communication between my computer and the Raspberry Pi, which led to today’s article.

1. Preparation
Software tools:
Imaging tool: https://downloads.raspberrypi.org/imager/imager_1.6.2.exe
Ubuntu 20 image: https://ubuntu.com/download/raspberry-pi/thank-you?version=20.04.3&architecture=server-arm64+raspi
Hardware tools:
A computer with Windows installed, and a virtual machine or dual system with Ubuntu, used for flashing the image and modifying the Raspberry Pi’s Wi-Fi address. A card reader for writing the image to the memory card. An old Raspberry Pi (model 3B), purchased many years ago and forgotten the price.
2. Flashing the image
First, install the flashing software. After installation, open it, and the interface will look like the one below. There are a total of three buttons; the first selects the image. We will choose the Ubuntu 20 image we just downloaded.

The second button is to select the device. We need to insert our memory card into the card reader and then plug the card reader into the computer to select it.

After completing the first two options, click Write to write the image. Wait a moment for the process to finish.

3. Modifying the Raspberry Pi’s Wi-Fi username and password
After flashing, the USB drive’s format changes, and the Windows system cannot recognize it. This is where the Ubuntu virtual machine or dual system comes in handy.
Here, I will take the virtual machine as an example. After inserting the USB drive, the virtual machine will pop up a window.

Since Windows cannot recognize it, we will mount it using Ubuntu. Open the Ubuntu file manager, and you will see the two mounted partition folders.
Select the one with more files.

Open the /etc/netplan/
folder, right-click in the blank area, and open a terminal.

Then enter the following command in the terminal:
sudo gedit 50-cloud-init.yaml
This opens the text editor, where you can add the related settings for Wi-Fi. The completed file looks like this:
network: ethernets: eth0: dhcp4: true optional: true version: 2 wifis: wlan0: access-points: "m": password: "88888888" dhcp4: true optional: true
Here, I used the hotspot name “m” with the password “88888888” from my computer’s hotspot.


After modifying and saving, we can open the user-data file on the other disk to check the default username and password:
chpasswd: expire: false list: - ubuntu:ubuntu
We can see that the username is ubuntu and the password is ubuntu.
4. Booting the Raspberry Pi
Remove the USB drive, take out the memory card, insert it into the Raspberry Pi, and power it on! If you have a monitor, you can connect the Raspberry Pi to it to see the complete boot process; otherwise, just wait for the Raspberry Pi to connect to our Wi-Fi, and then operate it via Wi-Fi. I have set up the Wi-Fi and am waiting for the Raspberry Pi to come online. My Raspberry Pi only supports 2.4G!

After a while, it came online, and now we can use SSH to connect to our Raspberry Pi.
5. Remote Connection
Open the terminal and type:
ssh [email protected]
You can also use PowerShell on Windows, which is a very handy built-in software.

After connecting remotely, we can proceed to install ROS2.
6. Installing ROS2
I must mention my one-liner to install ROS2:
curl http://fishros.com/tools/install/ros-foxy-raspi | bash
After installation:

7. Conclusion
Due to some issues with HTTPS, there are still some minor problems with the script, and I will work hard to fix them today. Finally, I wish everyone a happy weekend!