Setting up Raspberry Pi (Stretch)


Note:  This page is largely deprecated, but I am leaving it here just in case.  To get BrewPi running now, follow these two pages:

  • Off With Her Head! – Headless Raspberry Pi setup.  You can just follow along and skip the wpa_supplicant.conf and .ssh setup if you don’t care about headless operation.
  • BrewPi Remix Install – Instructions to set up the new remix of BrewPi which supports contemporary Raspbian versions.

These instructions were created for the new Raspbian Stretch image. They assume intermediate knowledge of your chosen home computing system, as well as familiarity with using SSH and other networking tools.  These instructions assume a “headless” operation – that no monitor, keyboard or mouse are needed.

These are the general steps I follow when preparing a new Raspberry Pi image for use with BrewPi:

  • Download your new Raspbian image: https://www.raspberrypi.org/downloads/raspbian/ (get the full version if this is your first time, not the “Lite” one)
  • Install the image on your SD card:
  • While the SD Card is still connected to your computer, configure the image for headless operation:
    • Locate the /Boot/ partition on the SD Card.  In Windows this will be a new drive letter with the volume name “boot (X:)” where “X” is the new drive letter.
    • Create a new file in the root of this drive named “ssh” (no extension.)   This will enable SSH so that you can connect to the RaspberryPi immediately upon first boot.
    • Create a file called “wpa_supplicant.conf” on the root of the boot partition of the SD card.  In it, place the following information:
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant
GROUP=netdev
update_config=1
network={
ssid="SSID"
scan_ssid=1
psk="PASSWORD"
key_mgmt=WPA-PSK
}

Replace “SSID” with the SSID of your local wireless network (leave it in quotes), and “PASSWORD” with your wireless network (leave it in quotes also) .  This will connect your Raspberry Pi to your wireless network automatically upon startup so double-check the SSID and password.

NOTE:  If you do not have Windows Explorer configured to show file extensions, it is possible to have a hidden “.txt” or other extension on the files.

  • Insert the SD card and boot.  Your Raspberry Pi should now be accessible on the network via PuTTY.
  • Use PuTTY to SSH to “raspberrypi.local” with the username “pi” and password “raspberry”.

NOTE:  If you receive an error stating that the host could not be found, it may be that Bonjour services is not installed on your local computer (assuming you use Windows.)  You can obtain Bonjour either by installing iTunes, or with the stand alone installer found here. Bonjour also enables accessing the BrewPi web page with  “{servername}.local” without having to apply a static IP or remember an IP address.  If you use Linux you will need libavahi; under Mac, Bonjour should be installed with the base OS.

  • Enter the command “sudo raspi-config” to execute Raspbian configuration as the root user.
  • Complete configuration:
    • Immediately “Change User Password” to a secure one.
    • Change “Hostname” (I suggest: “brewpi”, this will be assumed through all documentation on this site.)
    • “Localisation Options”
      • “Change Timezone” to proper timezone for your area.
      • “Change Wi-Fi Country” to proper country fr your area.
  • Select <Finish> and reboot.
  • After the Pi reboots, SSH to “brewpi.local” with the username “pi” and password you set previously.
  • Issue the following commands to ensure your software is up to date:
sudo apt-get update && sudo apt-get upgrade -y
  • Issue the following commands to clean local repositories, deleting space used by downloaded archives:
sudo apt-get clean && sudo apt-get autoclean
  • Issue the following command to update the firmware of your Raspberry Pi:
sudo PRUNE_MODULES=1 RPI_REBOOT=1 rpi-update

If the command updated your firmware it will reboot automatically. If not; go ahead and reboot anyway with:

sudo reboot

That’s it!