Installing the OS on the Raspberry Pi 5 for physics classes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 02Apr24 Everett Lipman Begin by formatting a micro SD card according to the instructions here: https://www.raspberrypi.com/software/ -> Choose the 64-bit "Raspberry Pi OS with desktop and recommended software" If you would prefer instead to format the card manually in Linux, use a command similar to this: dd if=2024-03-15-raspios-bookworm-arm64-full.img of=/dev/mmcblk0 bs=256k \ status=progress Do not attempt this unless you are sure you know what you are doing. 'dd' is nicknamed 'disk destroyer'. ---------------------------------------------------------------------------- Insert the micro SD card into the slot on the back of the Raspberry Pi 5. The printed side of the card should be visible as you insert it, and the contacts should face toward the circuit board. Connect the mouse and micro HDMI cables to the Raspberry Pi (RPi). Use the HDMI0 output connector on the RPi, which is the one next to the USB-C power connector. Plug the HDMI cable into a monitor. Make sure the monitor is on and set to receive input from the HDMI input port you chose. Plug in the power adapter, and connect it to the RPi. If your adapter has a switch, turn it on. Within a few seconds, you should see the RPi green indicator LED flash, and a colorful square may appear on the monitor. ---------------------------------------------------------------------------- The RPi should boot directly into its graphical user interface. A welcome window will appear. Click on "Next". In the "Set Country" window, select the following: Country: United States Language: American English Timezone: Los Angeles Check both boxes for "Use English language" and "Use US keyboard". Click on "Next". In the "Create User" window, Enter a username. Use only lowercase letters and numbers. The first character must be a letter. Enter a password. Use a secure password and remember it. The password is case-sensitive! You will not see the password as you type it if the "Hide characters" box is checked. Click on "Next". In the "Select WiFi Network" window, Click on "Skip". In the "Choose Browser" window, Select "Firefox". In the "Update Software" windowm, Click on "Skip". If you get a warning about translation files, click "OK". In the "Setup Complete" windowm, Click on "Restart". ---------------------------------------------------------------------------- The RPi should boot directly into its graphical user interface. If a popup window asks you to "Press 'Next' to get started", click on "Cancel". Click on the icon at the top of the screen to open a terminal. Right-click to choose 'Preferences', then 1. change the default terminal font to Monospace Regular 14; 2. change the "Palette" to "Solarized Dark" 3. click on "Background" and select black in the lower right-hand corner. 4. click on the "Foreground" color and under "Custom", press "+" and change the foreground color to #00EE00; 5. click on "OK". 6. close the terminal window with the mouse or by typing "exit" at the command prompt and hitting . Click on the icon at the top of the screen to open a new terminal. Your terminal should be 80 columns wide, with 24 rows (you can check this by typing "stty -a" and hitting ). If it is not, use the mouse to resize the window so that it has 80 columns and at least 24 rows. ---------------------------------------------------------------------------- From the terminal, run sudo raspi-config There are many different versions of raspi-config. These instructions are for the latest version. Older versions are similar, but the menus are organized differently. If you have trouble, ask the instructor or TA for help. Change the following settings: 1 System Options: If you are at home, S1 Wireless LAN: Enter the SSID and password for your network If you are asked for a country, select "US United States" S4 Hostname If the text box contains "raspberrypi", erase this. Choose a unique hostname. Don't use spaces or special characters. S5 Boot / Auto Login -> B1 Console Text console, requiring user to login S6 Splash Screen -> No 2 Display Options: D1 (if available) Resolution -> CEA Mode 16 1920x1080 60Hz 16:9 D2 Screen Blanking -> No 3 Interface Options: Enable the following: I1 SSH I3 SPI I4 I2C 5 Localisation Options L3 Keyboard -> Keyboard model -> Generic 105-key PC Keyboard layout -> English (US) [at the top of the list] Key to function as AltGr -> Right Alt (AltGr) Compose key -> No compose key Use Control+Alt+Backspace to terminate the X server? -> Yes L4 WLAN country -> US United States Select When you are prompted to reboot, do so. If you are not prompted, type sudo reboot in a terminal window, then hit . ------------------------------------------------------------------------------- When the machine comes back up, log in with the username you chose. Don't forget that your password is case-sensitive. Type startx at the prompt, then hit the key. The graphical user interface (desktop) should appear on the screen. Click on the up/down double red X icon at the upper right. If you are on campus, select eduroam from the menu. Select the following parameters: Wi-Fi security: WPA & WPA2 Enterprise Authentication: Protected EAP (PEAP) Anonymous identity: leave blank Domain: leave blank Check "No CA certificate is required" PEAP version: Automatic Inner authentication: MSCHAPv2 Username: your UCSB email address ending with @ucsb.edu (no umail) Password: your UCSBnet password If you are off campus, the network may automatically connect if you previously set your SSID and password. Otherwise, you will need to select a wireless network and enter the appropriate password. Click on the globe icon at the upper left to launch the web browser. Go to http://www.example.com to verify that your network connection is working. ---------------------------------------------------------------------------- Open a terminal and run the following commands: cd wget web.physics.ucsb.edu/~rpi/update_physrpi chmod 744 update_physrpi This last command makes the update script executable. In the terminal, type the following command: head update_physrpi The output should look like this: #!/bin/bash # # update_physrpi - Update Raspberry Pi configuration for physics class # # 19Sep18 Updated for course-independent configuration # 20Jun18 Updated for 129m18, multi-course configuration # 02Apr18 Updated for 129s18 # 15Jan18 Adapted from update_129m17 by Everett Lipman # If you see something completely different or get an error, type rm update_physrpi to remove the file, then check your Internet connection with the browser. Once you are sure you are connected, retry the commands above beginning with "cd". ---------------------------------------------------------------------------- *Never* turn off or unplug the power, or remove the SD card, without properly shutting down. Doing so can cause data loss or corrupt your card. If your RPi becomes unresponsive, you can force a clean shutdown by holding down the and keys while you type the six letters "reisuo". See the instructions below for shutting down properly. * Stop here unless you will be able to continue for at least 30 minutes. * ---------------------------------------------------------------------------- Open a terminal and run the following command: ./update_physrpi This will take up to 30 minutes, longer on older RPi hardware. You may have to answer prompts during the update process. Choose the default, or whatever allows the process to continue. If you are presented with a popup window announcing that "The desktop has been updated", click "OK" to continue. When the script has finished, manually run the following command: . /etc/bash.bashrc ---------------------------------------------------------------------------- You should now be ready to go. To shut down, run sudo shutdown -h now -h means "halt". If instead you use -r, the RPi will reboot. Once the green LED stops flashing, it is safe to remove the power.