Configuration and Installation

reef-pi requires a Raspberry Pi running Raspbian or Noobs. Adafruit already has guides on Preparing SD card,  First-time configurationNetwork and SSH setup. We'll not repeat those, if you are not familiar with Raspberry Pi, use those guides in exact order to get a working Raspberry Pi with latest Raspbian installed and network configured. 

It's always recommended you update Raspbian before installing reef-pi. We'll also enable network time to keep Raspberry Pi time up to date from the Internet.

Download: file
sudo apt-get update -y 
sudo apt-get upgrade -y
sudo systemctl start systemd-timesyncd
sudo systemctl enable systemd-timesyncd

reef-pi uses Raspberry Pi's hardware timers for PWM (used for LED dimming, DC motor control etc.). This allows reef-pi to use up to two PWM channels without any ancillary electronics. This feature is only available in newer Linux kernels (4.9 and above). We have to edit /boot/config.txt file and add this line at the end to enable (then reboot)

Download: file
dtoverlay=pwm-2chan

reef-pi uses a DS18B20 temperature sensor, which requires the one wire protocol to be enabled in the Linux kernel. reef-pi also uses I2C communications protocol for some features. We'll use the raspi-config tool from terminal for enabling both one wire and I2C.

Download: file
    sudo raspi-config
  

From the terminal type sudo raspi-config

 

Select Interfacing Options

Then select 1-Wire

Select Yes to enable, then restart

Update Hostname

You can use the raspi-config tool to rename Raspberry Pi to something else. For example, I named one of my reef-pi controllers as biocube29 (the name of the tank). Doing so allows accessing the reef-pi web UI as http://biocube29.local from other devices in the same network.

Disable SPI

reef-pi does not uses SPI, and disabling it will allow reusing the SPI pins as normal GPIO. The raspi-config utility can be used for this as well (disabling SPI).

Reboot and Install reef-pi!

Finally, we're ready to install the software.

sudo reboot the pi to make all the changes active

Next, download the latest release of reef-pi and install it

Download: file
wget -c https://github.com/reef-pi/reef-pi/releases/download/2.0/reef-pi-2.0-pi0.deb

sudo dpkg -i reef-pi-2.0-pi0.deb

That's it! reef-pi should be installed and running, you should be able to access the reef-pi UI by visiting the Raspberry Pi IP (or hostname.local, if you have set a hostname) in your browser. You'll get this login prompt:

Enter reef-pi as both username and password and click "Sign In". This is the default credentials reef-pi ships with. You will then redirected to the main dashboard:

The error message at the top is benign and expected, and an indicator of a fresh install (if you are curious, the error is about missing data for charting, since there is no data yet). Notice the footer information, it reflects the controller name, current time, reef-pi version, uptime, IP and any error. 

Next, let's customize the reef-pi installation for our specific use. For this, head over to the configuration tab and change the controller name from reef-pi  to adafruit-test and click on the update button to save the setting. 

adafruit_products_Screen_Shot_2018-09-02_at_10.35.27_AM.png
Resetting the controller name

The new name will be reflected upon reloading the controller, which can be done from the admin section under the configuration tab.

Click the reload button and refresh your browser.

adafruit_products_Screen_Shot_2018-09-02_at_10.39.57_AM.png
Reload reef-pi from the admin section under the configuration tab

After browser refresh, you should see the new reef-pi name changed in footer information.

At this point, reef-pi is running and responding, nice work!

We will next take a brief look at the UI and modules in general and test some of them using simple LEDs.

This guide was first published on Sep 12, 2018. It was last updated on Sep 12, 2018. This page (Configuration and Installation) was last updated on Apr 23, 2019.