- Joined
- Feb 14, 2020
- Messages
- 946
- Reaction score
- 1,259
- Review score
- +0 /0 /-0
- Location
- Edmonton, Canada
Hi, over the last couple years I've been using a script I made up to install reef-pi as there's quite a few steps and easy to miss 1wire, I2C or whatever. In 95% of the cases it worked great and made things easy for people but it wasn't perfect which is why I never shared it directly. A couple weeks ago @Tom Bishop came across it and saw a few things that could be improved, he was able to add the ability to change the Pi password, add a user account to the Pi and add a hostname to access the Pi on the network. This was my favorite as I always assumed it was complicated. He was also able to redirect the script to the Pi location selector, previously I had a link people needed to visit and manually type in the time zone so this is nice. After he did this it inspired me to polish it up and make it nearly bullet proof so a user can't make any mistakes. Thanks @Tom Bishop for helping improve this.
The installation script does the following
To install reef-pi there are three steps, first you need to install the operating system for the Raspberry Pi if you haven't yet, then you need to connect to the Raspberry Pi via SSH and finally you need to run the installation script. If your Pi is up and running and you can connect to it via SSH you can skip to the third step.
1. Install Raspberry Pi Operating System
1. Access Raspberry Pi via SSH
Now that the operating system is installed you need to connect to the Raspberry Pi using SSH so we can actually install reef-pi. Any program for SSH will work such as Putty or Tera Term.
The installation script does the following
- updates Raspberry Pi Operating System
- updates Raspberry Pi password
- prompts for new Raspbbery Pi user account
- prompts for hostname
- prompts for time zone
- enables time sync
- installs reef-pi
- configures reef-pi
- generates website address to access reef-pi
- removes reef-pi installation files
- expands file system on microSD card
- all installation files are deleted when install is complete or script is aborted
To install reef-pi there are three steps, first you need to install the operating system for the Raspberry Pi if you haven't yet, then you need to connect to the Raspberry Pi via SSH and finally you need to run the installation script. If your Pi is up and running and you can connect to it via SSH you can skip to the third step.
1. Install Raspberry Pi Operating System
- Visit the following page using the link below and download the ‘Raspberry Pi Imager’ to match your computer. This will automate the install process.
https://www.raspberrypi.com/software/
- Once the download is finished, open the file and go through the step-by-step install wizard to install, all the defaults are sufficient.
- Open the Raspberry Pi Imager program that you just installed. Before opening the program make sure your SD card is in your card reader as the program searches this when it opens.
- Now Press CTRL + SHIFT + X on your keyboard to open the advanced settings page.
- You should now see the Advanced options screen below. Enable SSH and add a password for the Raspberry Pi.
- Enable Configure wifi and add your network SSID and Password to connect to your Wi-Fi
- Set the Wifi country to match your location.
- Click the Save button at the bottom
- Now you can click the CHOOSE OS button
- If you are using a Raspberry Pi 3 or 4 and want to connect a display, keyboard and mouse for a Windows-like feel you can install the first option with ‘Desktop’ however it is recommended to install the Lite OS version using the 2nd option marked in the image below.
- Now you will see another menu, you should select Raspberry Pi OS Lite (32-bit). The minimal installation is best as there’s less code running in the background that could cause reliability issues and require frequent security updates.
- Now you can choose which SD card to write to, press the CHOOSE SD CARD button to select one.
- Depending on your card reader you may have one or more items in the list, if you are unsure remove your card and view this screen. Look for the row where the GB changes from 0 to the size of your microSD card.
- Now you can click the WRITE button and sit back while it installs everything to your microSD card. This will take a while to complete but when it’s finished you’ll have the latest Raspberry Pi OS and should be able to connect to your network.
- Once complete you’ll see the screen below. Click on the CONTINUE button to finish. You can now close the Raspberry Pi Imager program.
1. Access Raspberry Pi via SSH
Now that the operating system is installed you need to connect to the Raspberry Pi using SSH so we can actually install reef-pi. Any program for SSH will work such as Putty or Tera Term.
- Download Putty from https://www.putty.org/, the link is at the top of the page.
- Install Putty, the default settings throughout the install are sufficient.
- Once it’s installed you can open it and you’ll see the screen in the image below. Follow the next 3 steps.
- Set the Connection type to SSH
- Change Host Name to the IP address of your Raspberry Pi. You can log into your router or run an IP scanner to get this.
- Set the Port to 22.
- Optional - You can enter a name in the Saved Sessions field and click the save button, now next time you want to connect to your Pi you only need to double click the Saved Session and it will load up.
- Click the Open button at the bottom to start the connection.
- When you open a new connection you need to enter in your user name and password to log in to your Raspberry Pi, it will prompt you for this. The default username is pi and the password is what you set up earlier when you installed the Raspberry Pi OS. Note as you type the password nothing will show but it knows.
- Once successfully logged in you’ll see something like the following image. When you get this you are ready to complete the installation.
3. Install reef-pi
- If you haven’t connected to your Raspberry Pi via SSH follow step 2.
- Once connected type in the following command to download the script to your Raspberry Pi and press enter.
sudo wget -c https://www.robo-tank.ca/reef-pi_install_files.zip
- Now type in the following command to unzip the file you downloaded.
sudo unzip reef-pi_install_files.zip
- Now type in the following command to start the installation, follow the on screen instructions.
sudo bash reef-pi_install_files/install_reefpi.sh