Setting up the Pi from scratch #
There are a million and two ways to set up a Pi, but here are the steps I think need to be done every time to set up a Pi from scratch to work well as a Smart Camper media and information hub (recorded here for my own future reference as much as anything).
These steps may also be useful for other Pis acting as similar hubs, such as Magic Mirrors or car-puters.
First, get an OS on the Pi #
- Use Raspberry Pi Imager to install Raspbian on a good-quality, 32GB SD card. It's a wonderfully simple solution. I continue to debate using Raspian-lite and forgo the GUI in favor of more power for Plex. But for now, I keep it.
- Put the new card in the Pi and boot up. Assuming it starts OK, go through the first-run setup steps.
- Set a good password.
- Be sure to enable SSH
- And set a static IP. You'll be glad you did and aren't chasing ever-changing IP addresses set by your router. Note that your ISP and router may require additional work to make this happen.
Install Plex #
- Ensure the external drive containing the media library is mounted and will mount automatically.
- Follow the steps to prep for Plex server installation:
sudo apt-get install apt-transport-https curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add - echo deb https://downloads.plex.tv/repo/deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list deb https://downloads.plex.tv/repo/deb public main
- Update packages:
sudo apt-get update.
- Now get the Plex server:
sudo apt-get install plexmediaserver
- And upgrade:
sudo apt-get upgrade. In the past I've cleaned up some unneeded packages, but honestly, it's probably not worth it. They're not hurting anything, really.
Pi Configuration and further installations #
- Reset the resolution to 1440x900 (at 1920 it's too fine for fat fingers)
- Enable 1-wire interfacing, either through the
raspi-config"interfacing" option or by manually editing the config.
- Install xscreensaver. It's by far the easiest way to control when the Pi and display go to sleep.
Code setup #
- Pull my smarter camper code from the repo.
- Make sure it's on pythonpath:
- And just to be sure, put it in
- Pip install dependencies from the repo's requirements file:
pip3 install -r REQUIREMENTS.txt
- Set environment variables for services we're using. See settings.py for details.
- Follow my remaining instructions to re-install the web server and monitoring page