Raspberry Pi
COSMOS Running on Raspberry Pi 4
The Raspberry Pi 4 is a low-cost powerful ARM-based minicomputer that runs linux. And because it runs modern linux, it can also run COSMOS! These directions will get you up and running.
What you'll need:
- Raspberry Pi 4 board (tested with 8GB RAM)
- A Pi Case but Optional
- Raspbeerry Pi Power Supply
- 32GB or Larger SD Card - Also faster the better
- A Laptop with a way to write SD Cards
Let's get started!
-
Setup 64-bit Raspian OS Lite on the SD Card
Make sure you have the Raspberry Pi Imager app from: https://www.raspberrypi.com/software/
- Insert the SD Card into your computer (Note this process will erase all data on the SD card!)
- Open the Raspberry Pi Imager App
- Click the "Choose Device" Button
- Pick Your Raspberry Pi Model
- Click the "Choose OS" Button
- Select "Raspberry Pi OS (other)"
- Select "Raspberry Pi OS Lite (64-bit)"
- Click the "Choose Storage" Button
- Select Your SD Card
- Click Edit Settings
- If prompted if you would like to prefill the Wifi information, select OK
- Set the hostname to: cosmos.local
- Set the username and password. The default username is your username, you should also set a password to make the system secure
- Fill in your Wifi info, and set the country appropriately (ie. US)
- Set the correct time zone
- Goto the Services Tab and Enable SSH
- You can either use Password auth, or public-key only if your computer is already setup for passwordless SSH
- Goto the Options tab and make sure "Enable Telemetry" is not checked
- Click "Save" when everything is filled out
- Click "Yes" to apply OS Customization Settings, Yes to Are You Sure, and Wait for it to complete
-
Make sure the Raspberry Pi is NOT powered on
-
Remove the SD Card from your computer and insert into the Raspberry Pi
-
Apply power to the Raspberry Pi and wait approximately 1 minute for it to boot
-
SSH to your raspberry Pi
-
Open a terminal window and use ssh to connect to your Pi
- On Mac / Linux: ssh yourusername@cosmos.local
- On Windows, use Putty to connect. You will probably have to install Bonjour for Windows for .local addresses to work as well.
-
-
From SSH, Enter the following commands
sudo sysctl -w vm.max_map_count=262144
sudo sysctl -w vm.overcommit_memory=1
sudo apt update
sudo apt upgrade
sudo apt install git -y
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER
newgrp docker
git clone https://github.com/OpenC3/cosmos-project.git cosmos
cd cosmos
# Edit compose.yaml and remove 127.0.0.1: from the ports section of the openc3-traefik service
./openc3.sh run
-
After about 2 minutes, open a web browser on your computer, and goto: http://cosmos.local:2900
-
Congratulations! You now have COSMOS running on a Raspberry Pi!