5.0 KiB
rover-pi
Scripts and documentation for setting up a Raspberry Pi (Zero W 1 or 2) for use in Mechatronics 1 or Cyberphysical Systems. This single-board Linux computer is equivalent in power to the Raspberry Pi 2 but in a smaller form factor, includes WiFi and Bluetooth, and is very affordable at 15USD. For operations that need higher computing power, we recommend the Raspberry Pi 3 or 4 which can be purchased later.
Procedure
-
Raspberry Pi Imager procedure to setup ssh and Raspberry Pi Connect
-
Find out your Pi's ethernet addresss in case you need to find it on
iot-researchagain. Typeip addr show dev wlan0and for something likelink/ether 01:23:45:67:89:ab. Write this information (the 12 characters and colons) in your notebook. In T-411-MECH we want you to put this information in a spreadsheet links from the main page: this allows us connect Pi's to people in case of any issues. -
Login to the pi using ssh or serial. (Pi Connect breaks wihle upgrading the Pi Connect program). Now update the packages on your pi:
sudo apt-get update sudo apt-get -y upgrade -
Gadget Mode to setup a network connection over USB. A more explanatory version in the Raspberry Pi Newsletter
- If you don't have Internet Connection Sharing, th pi will show up as 10.12.194.1
-
Setup the OLED screen to print the IP Based upon Marcel's script on github to show the IP address on the OLED screen
-
Install Blinka by following the guide CircuitPython Libraries on Linux and Raspberry Pi]
RU student-only guides at ROB-IOT
References and Links
- Sparkfun GPIO pinout
- Guide to creating ssh keys Of note, this guide is a little dated as it suggests using RSA keys and many people are moving toward EDCSA keys.
- Raspberry Pi Connect
- Raspberry Pi Zero Headless Quick Start This guide assumes you have a serial cable adapter you can plug into the RX/TX serial pins on the Pi.
- Pi Headless Configuration over Bluetooth Guide from 2017 on how to setup a serial console over Bluetooth
- Turning your Raspberry Pi Zero into a USB Gadget Official Adafruit guide to gadget mode to allow the USB port to be used as a serial console to connect to it. We had trouble getting it to work in 2026 due to some changes in Raspberry Pi OS.
- Python gpiozero library a simple interface for working with GPIO devices
- CircuitPython Libraries on Linux and Raspberry Pi This is one option for GPIO, I2C, SPI, and PWM access in python.
- Comparing Rasbperry Pi python interfaces
For the Future
- Setting up Zeroconf to use local names (.local) to access your Pi: this does not work on iot-research because multicast and MDNS are broken.
- MDNS on iot-research MDNS is still an ongoing development.
TODO
- Finding the Pi using
nmaporarp - Create a interface HAT that makes it easy to attach to a digital analyzer (v207) and an Analog Discovery
Some Tricks
Here is a page of tricks we have discovered that may involve advanced techniques. Credit: Daníel Bjartur Guðmundsson, transcribed by Joseph T. Foley
- Check for list of networks: nmcli device wifi list
- Show details of "preconfigured" network: nmcli connection show preconfigured
- Change the SSID (which wireless network you will connect to) in the "New_SSID": nmcli connection modify preconfigured wifi.ssid "New_SSID"
- Change the wireless access password in the "New_Password": nmcli connection modify preconfigured wifi-sec.psk "New_Password"
Wifi keeps dropping out. What do I do?
sudo raspi-config- Advanced Options > A12 WLAN Power Save
- Yes to disabling
I'd like to stop typing my password all the time
- Copy your private key to your pi from
~/.ssh/id_*to the Pi - On the Pi, start ssh-agent with
eval $(ssh-agent) - Now add your key
ssh-add