Raspberry Pi setup

Raspberry Pi setup #

Video omission

Warning! The video above leaves out the step explained below where you enable SSH and set the password. If you get to the login prompt successfully, but the (obsolete) default password doesn’t work, that’s probably why.

Stuff you need (all in your kit) #

  • Raspberry Pi 4
  • micro SD card
  • USB-C power supply
  • USB-serial adapter, AKA a console cable

You may also need a USB card reader, if you don’t have a card slot built into your computer. We have extra adapters that you can borrow to write data to your SD card if needed.

To connect the console cable, look at this diagram.

RPi console cable connection

There are more details if you need them in Adafruit’s console cable tutorial. Emily K. also recommends the Sparkfun tutorial.

Setup checklist #

  • Install the Raspberry Pi Imager from the Raspberry Pi Software page
  • In the Imager, choose the image "Raspberry Pi OS (other)" --> "Raspberry Pi OS Lite (32-bit)"
  • Click the gear menu for Advanced Options to enable SSH and set the password for the user pi
  • Edit config.txt on micro SD card to include: enable_uart=1
  • Install the SiLabs CP210X USB driver for the console cable
  • Connect RPi to laptop with console cable
  • Put micro SD card in slot of Pi
  • Install PuTTY (Windows) or open Applications > Utilities > Terminal (macOS) or install Serial (macOS)
  • (macOS only) In Terminal, run ls /dev and find the entry that says tty.usbserial-XXYYZZ. Record the numbers you see instead of XXYYZZ.
  • (macOS only) In Terminal, run screen /dev/tty.usbserial-XXYYZ 115200)
  • (Windows only) In PuTTY, start a serial session at 115200 bps to the Pi
  • Connect USB-C power cable. Wait a minute or so for the Pi to boot up
  • Log in with username pi and password you set using the Imager
  • Run sudo raspi-config to set up your wireless connection

What the Imager should look like #

The gear menu doesn’t appear until after you choose the Raspberry Pi OS Lite (32-bit) image.

Raspberry Pi Imager OS selection

The advanced options you should pick #

Enable SSH and set the password for the user pi.

Raspberry Pi Imager advanced options

Checklist for Tufts_Wireless #

  • Figure out the Pi's MAC address with ifconfig. Be sure you get the MAC for wlan0, not eth0.
  • Register that MAC address with Tufts IT at the Tufts registration page
  • Wait a few minutes for MAC address permissions to propagate to local wireless access point
  • Add network settings below to /etc/wpa_supplicant/wpa_supplicant.conf
  • Reboot Pi

Network settings for Tufts_Wireless #


Setup for Tufts_Secure #

There’s a bug in /lib/dhcpcd/dhcpcd-hooks/10-wpa_supplicant in the current version of Raspbian OS (based on Debian 10.4, Buster). This post explains how to fix it, but we haven’t verified that it works yet: https://medium.com/@iced_burn/raspberry-pi-connected-to-wifi-of-wpa2-enterprise-ddd5a40c0b07

Read the note above about the bug in /lib/dhcpcd/dhcpcd-hooks/10-wpa_supplicant.

The LA’s can tell you the Nolop_IOT password; we try to avoid publishing passwords on the internet.

Network settings for Tufts_Secure #


Connecting to your Pi via SSH instead of serial #

Once you have your Pi connected to the wireless network, and you use ifconfig to find the IP address it has been assigned, you can log into it through SSH instead of through a USB-serial cable.

  • Have your Pi’s IP address handy.
  • Make sure your Pi is plugged into power. Do not attach the serial console cable.
  • Open a new terminal window.
  • Type ssh your_Pi_username@ip_address_of_your_Pi
  • You should be prompted for your Pi’s password, and then you should be logged in! No serial cable necessary!


What operating system should I use on my Pi? #

Unless you have a good reason not to, you should start with the Lite version of Raspberry Pi OS. The Raspberry Pi imager will download it for you. Previously called Raspbian, the OS should be based on Debian Buster or newer (as older versions will not work with a Pi 4).

How do I figure out what name is assigned to the USB-serial adapter when I plug it in? #

On Windows 10, it’s usually COM3 (but it is not uncommon to have a different number). You can check for sure in the Device Manager control panel under Ports (COM & LPT)

On macOS, it’s called /dev/tty.usbserial-123456, but the numbers at the end change. You can check it by running ls /dev in Terminal.

On Linux it’s called /dev/ttyACM0, but the number will depend on how many USB devices are plugged in. As with macOS, you can check by running ls /dev in Terminal.

When I open config.txt with Notepad, the lines all run together. How do I fix this? #

Use a better text editor, like Sublime Text, Textmate, or Notepad++. You could also try Wordpad.

What do the pin numbers correspond to? #

All the most recent Pi’s share a standard pin format. Below is a handy guide. This site is also an excellent resource for reference.

RPi pinout