Raspberry Pi

We use Raspberry Pi for our main microcontroller on the final products as it has more computing power.

Below is the pinout of the Raspbery Pi 4.

_images/raspberry_pi_pinout.png

OS Flashing

Raspberry Pi released an imaging tool which simplifies the process of flashing an OS into a micro SD card. If you do not have a micro SD card reader then use an adapter.

  1. Download RPi Imager

    Go to the following link

  2. Run Installer

    Click the .exe file

Installing Tools

At STARX we use use a variety of tools this inclues ROS, odrive, SPI, GPIO, Git, and more. Use the following lines and follow the installation instructions for the tool that you will be using so that the raspberry pi is ready to be used to test and work on anything related to STARX.

Headless

A headless raspberry requires no monitor to make changes, instead we remotely connect to it and make changes using a laptop. This is important during competition as we do not have the space or time to setup an environment for a raspberry pi.

This requires 3 different devices: hotspot, raspberry pi, and laptop

_images/headless.png

Hotspot

  1. Settings > About

    Name: starx

  2. Settigs > About > Personal Hotspot

    Password: joyride67

  3. Enable hotspot

Raspberry Pi

  1. Google Drive > STARX > PROGRAMMING Team

    Download the custom STARX Ubuntu image: starx_ubuntu.img.zip

  2. Unzip image

    $ unzip starx_ubuntu.img.zip
    
  3. Flash custom starx ubuntu image

    Open the Raspberry Pi Imager > CHOOSE OS > Use custom

Laptop

Note

The following will work for both Ubuntu and VM Ubuntu. VM Ubuntu MUST have the Network Adapter set to “Bridged Adapter”

Install the following tools to find the raspberry pi’s IP address.

$ sudo apt install net-tools
$ sudo apt install nmap

We wil use two commands to discover the raspberry pi’s IP as it it dynamically assigned. The following will print the gateway’s IP address.

$ arp -a

Example Output: 192.168.20.53

We will use this IP to do a wifi scan, this will find every device connected to this WIFI.

$ nmap -sP <gateway's ip (first 3 values)>.1/24

Example Input: nmap -sP 192.168.20.1/24

This should take a couple of seconds and should print three different IP’s: gateway, laptop, and raspberry pi

Use the raspberry pi IP to ssh into the pi.

$ ssh starx@raspi-IP