V2 Pi Zero Software - alanbjohnston/CubeSatSim GitHub Wiki

Step 2a: Pi Zero Software Install

These instructions are for the CubeSatSim software for the Raspberry Pi Pico processor.

They include how to install the software, check the software log, and do various debugging.

Software installation

You will need:

  • Raspberry Pi Zero W
  • micro USB cable to power the Pi Zero
  • micro SD card storage for the Pi Zero
  • Computer with micro SD card writer or USB adapter to remotely log into the Pi Zero

Here are the steps to install the software image:

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

Under Choose Device select the Raspberry Pi Zero as the computer and for Choose OS choose Raspberry Pi OS (other) and then select Raspberry Pi OS (Legacy, 32-bit) Lite as the operating system. Under Choose Storage select your micro SD card that you inserted. If nothing shows here, check your micro SD card and your reader by unplugging and plugging in again:

When you select Next, you will be prompted about applying custom OS settings. Select Edit Settings.

Under the General tab, set the hostname to cubesatsim plus the letter of your group. For instance, if you are Group A, set the hostname to cubesatsima. You need to set the username pi and password raspberry. You will select the WiFi country to US and the SSID to CubeSatSim and the password to amsatao7 (note it is the letter O not the number zero in this password). Set the local to US/New York and us.

Select Save then under Services, make sure you enable SSH login with password authentication:

Select Save then select Next, then you will be warned that the data on the SD card will be erased. Select Yes and the write will begin:

After Pi Imager is complete, remove the micro SD card from your computer and insert it in the Pi Zero and power the Pi Zero with a micro USB cable and it will boot up.

Logging into your Raspberry Pi

You can customize your software by logging into the Pi. If you put in the WiFi information in the Pi Imager, the Pi Zero should automatically join the CubeSatSim 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 you are Group A and your hostname is cubesatsima)

ssh [email protected]

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 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.putty.org/ and open it, setting the Host Name to cubesatsima.local and then click Open to connect:

Pi SSH Login

Here is how it looks when you login on Windows using PuTTY after entering the default username pi and password raspberry

Pi SSH Login

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 Wi-Fi hub.

To install the software, type these commands (or cut and paste to avoid typos):

sudo apt-get update && sudo apt-get dist-upgrade -y

sudo apt-get install -y git

git clone http://github.com/alanbjohnston/CubeSatSim.git

cd CubeSatSim

git checkout beta

You are now ready to install the software.

./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. It will prompt you if you want to modify /boot/config.txt file. Type a y and the script will complete. You will need to reboot. After the reboot, you will have to login again using SSH.

When it reboots, you will need to SSH to log back into your Pi Zero and do the configuration that follows.

Configure Transmit Frequency

Check your Wiki to see if you need to change the default transmit frequency so it won't interfere with another CubeSatSim in the room. If you do, you will type the command CubeSatSim/config -F to change the transmit frequency from the default 434900 kHz.

Looking at Configuration and Logs

You can see all the settings for your Pi Zero by typing CubeSatSim/config

To see all the commands and options of your Pi Zero 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 -r

Shutting Down your Pi Zero

You have completed the software installation steps. You should not just suddenly remove power from the Pi Zero 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 STEM Payload Board is plugged into the Pi Zero.

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

You will need to connect your Pi Zero to your Wi-Fi so it can update the code from GitHub.

To get it on your Wi-Fi, follow 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.

Ethernet over USB

If not, you can access your Pi from a computer using just a USB cable. This Ethernet over USB service is known as RNDIS on Windows and USB Gadget on Linux.

On Mac or Linux, you don't need to install any software to use this. On Windows, you need the mDNS discovery program Bonjour. If you already have iTunes installed, you should have it. If not, you can download it from Apple here:

https://support.apple.com/kb/dl999?locale=en_US

Note that it is called Bonjour Printer Services, since that is the most common standalone use for the application. Run the installer and reboot.

On your Pi Zero, connect a micro USB cable to the inner micro USB connector which is labeled "USB", not the one on the edge labeled PWR IN (Power In).

When you connect the other end of the USB cable to your computer, it will power up the Pi and should be accessible by your computer to SSH into.

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 you are Group A and your hostname is cubesatsima):

ssh [email protected]

and you can login using the default password raspberry.

Sometimes, this doesn't work on Windows - if you are unable to connect after installing the software, try the steps described here: https://fredricraab.wordpress.com/cubesat-simulators/raspberrypi-zero-windows-10-rndis- driver-problems/