Creating the CubeSatSim Raspberry Pi Image - alanbjohnston/CubeSatSim GitHub Wiki
These are the exact steps I used to create the Pi image, so you can recreate it if you want:
You will need:
- Raspberry Pi Zero W or Pi Zero 2 W (Pi Zero 2 W is preferred since the Pi Zero W won't fully work with Command and Control)
- micro USB cable to power the Pi Zero
- micro SD card 16GB or larger as storage for the Pi Zero
- Computer with micro SD card writer or USB adapter to remotely log into the Pi Zero
First, use the Raspberry Pi Imager to write a Pi OS Legacy 32-bit Bookworm image (the current software does not work with Trixie yet) to your SD card.
Here are the steps:
Raspberry Pi Imager Steps
First, you will need to download and install the Raspberry Pi Imager software onto your computer https://www.raspberrypi.com/software/
You will then insert the micro SD card into the SD card reader on your computer.
Then, run the Pi Imager.
You can start with the Bookworm version of Raspberry Pi OS (Pi OS Legacy, 32-bit). A Pi Zero or Pi Zero W should only run Lite while a Pi Zero 2 can run the Desktop. Make sure you create a user pi and do the install with that user or there may be issues with configuration files and settings as it references many paths in /home/pi/*. Your Pi will need to have internet access to update settings and install packages.
After Pi Imager is complete, remove the micro SD card from your computer and insert it in the Pi Zero 2 and power the Pi Zero 2 with a micro USB cable to power it and it will boot up.
Logging into your Raspberry Pi
You can customize your software by logging into the Pi. If you put in your WiFi information, the Pi Zero should automatically join your WiFi network. You will need your computer to also join this WiFi network using the same SSID and password.
After it finished booting up, you will have network connectivity to your Pi Zero. For example, in the Terminal Window or Windows Command Prompt, you can type (if your hostname is cubesatsim)
The first time you log in on your computer, you will be asked Are you sure you want to continue connecting (yes/no/[fingerprint])?. Type yes then return to continue the login. At the password prompt, type raspberry or what you chose then return but note that the characters will not display as you type them.
Alternatively, you can use a free application such as PuTTY on Windows. Download it here https://www.chiark.greenend.org.uk and open it, setting the Host Name to cubesatsima.local and then click Open to connect:
Here is how it looks when you login on Windows using PuTTY after entering the default username pi and password
Software Installation Steps
Once you have used SSH to log into your Pi Zero, you are ready to install the CubeSatSim software.
Verify that your Pi Zero is connected to the Internet by typing:
timeout 10 ping amazon.com
If you see messages such as "64 bytes received" then you are online. If not, check your WiFi hub.
To install the software, type these commands (or cut and paste to avoid typos):
cd
git clone http://github.com/alanbjohnston/CubeSatSim.git
cd CubeSatSim
./install
You will be prompted for your amateur radio callsign. Check your Wiki to see what to enter. If you don't have one or just hit Return, the default AMSAT will be used. The Callsign is transmitted as a CW ID (Morse code) each time the CubeSatSim software starts up.
You will also be prompted for your latitude and longitude - look it up and enter it for the APRS data packets.
After you enter the information, the installation script will run for quite a while. You will need to reboot using the command:
sudo reboot now
You will have to login again using SSH.
Configure Transmit Frequency
The default transmit frequency of the CubeSatSim will be 434.9 MHz. If you want, you can change it to another frequency in the range 420 - 450 MHz by typing the command CubeSatSim/config -F and then input the desired frequency.
Looking at Configuration and Logs
You can see all the settings for your Pi Zero 2 by typing CubeSatSim/config
To see all the commands and options of your Pi Zero 2 by type CubeSatSim/config -h
To see the complete second-by-second log output, which will be very useful later to debug your hardware, type CubeSatSim/log
To see the transmitter log, type CubeSatSim/log -t
Shutting Down your Pi Zero 2
You have completed the software installation steps. You should not just suddenly remove power from the Pi Zero 2 or the micro SD storage may become corrupted and you would need to redo all these steps. Instead, you can shut it down gracefully by typing a command, or by using the pushbutton when the Main or Lite Board is plugged into the Pi Zero 2.
To shutdown, type sudo shutdown now and after about 30 seconds, the Pi will have shutdown and you can unplug the power from it.
Other Options to access Pi Zero
If you have an HDMI monitor (and mini HDMI adapter or cable) and a USB keyboard (and micro USB to USB adapter or OTG cable), you can access the console directly.
Wi-Fi login
If you didn't set the WiFi using the Pi Imager but are able to connect a keyboard and HDMI monitor to your Pi Zero 2, you can configure the WiFi using these steps. First type this command:
sudo raspi-config
Then select System Options by hitting Return, then select Wireless LAN by hitting Return again. Then put your Wi-Fi name in the SSID field then hit Return, then type the Wi-Fi password then Return again. Hit the Tab key twice until Finish is highlighted, then hit Return. You may need to reboot. You can tell if you have Internet by typing:
timeout 10 ping amazon.com
If you see messages such as "64 bytes received" then you are online.
You can now update the Pi Zero software by typing:
cd
CubeSatSim/update
You can also login remotely from your PC if it is on the same Wi-Fi as the Pi Zero. For example, in the Terminal Window or Windows Command Prompt, you can type:
ssh [email protected]
and you should be prompted for the password to login.
You can set other Localization Options by running sudo rasp-config and selecting as Locale (unchecked en.GB and checked en.US.UTF-8 UTF-8 and C.UTF-8), Timezone (US Eastern), Keyboard (Generic 101-key PC, Other, English (US), English (US), default, no compose), and WiFi Country (set to US - if you don't do this, WiFi won't work on 3B or 4B)
You can edit the Message of the Day file sudo vi /etc/motd Added these lines to it:
This Raspberry Pi image has the CubeSatSim v2.x software installed
and runs automatically as systemd cubesatsim.service. For more
information see https://CubeSatSim.org. To update
to the latest version, enter this command:
CubeSatSim/update
To see configuration options, enter this command:
CubeSatSim/config
You can edit the /boot/config.txt file: sudo vi /boot/firmware/config.txt Uncommented this line:
hdmi_safe=1