Skip to content

Fresh Install Method

Cory Verellen edited this page Mar 25, 2018 · 33 revisions

If you'd like to add Oasis Spa functionality to an existing Raspberry Pi, or would like to start over for yourself this guide is for you. There are quite a few steps, and sure to be some gotcha's in there depending on your setup. If you're just starting out and want to try Oasis Spa, save yourself some time. Flash the full image onto a spare SD card and boot it with your pi. If you like it, and want to do something different with your pi as well that our Jessie imaged doesn't do, then build the full OS up below.

In this guide we'll cover everything starting after a working Raspberry Pi Jessie install. Much of the following is a re-post from Rick's Instructables Guide.

If you just want this thing to work and get on with the luxury, check out the Image Install Method.


Let's start with a teaser. Here's Rick's video of his original install guide

The following packages will be installed.

  • Apache 2
  • PHP5
  • MySQL Database
  • PhpMyAdmin
  • GPIO Control/WiringPi
  • Hallonlarm

Installation

  1. Start with a clean or existing Jessie install. Skip steps if you've already have these items configured.
  2. Connect to your Pi with Putty (or direct with monitor/keyboard if that is how you're rolling)
  3. Sudo raspi-config
  4. Select Expand File System. Let that finish and reboot the Pi
  5. Do any updating/apt-get you may need if this is an older install
  6. sudo apt-get install apache2
  7. sudo apt-get install mysql-server I'll assume you've saved the paswword that is asked for. The default for the website is 'raspberry'. If you change it, then you'll need to modify config.php > MySQL_pass later. this is important
  8. sudo apt-get install phpmyadmin
  9. Configure Apache to work with PhpMyAdmin sudo nano /etc/apache2/apache2.conf
  10. Add the following line at the end of apache2.conf: Include /etc/phpmyadmin/apache.conf Control + X to save, type "Y" to overwrite.
  11. Install WiringPi sudo apt-get install git-core
  12. git clone git://git.drogon.net/wiringPi

cd wiringPi

./build

  1. To get the DS18B20 sensors working (hard wired only! not SonoffTH or IoT) sudo nano /boot/config.txt Add the following line dtoverlay=w1-gpio
  2. Make sure WiringPi is working correctly gpio -v gpio readall
  3. Add the pi user to the group sudo passwd -a pi www-data
  4. sudo chown www-data:www-data /var/www
  5. sudo chmod 775 /var/www
  6. Change the root directory of Apache sudo nano /etc/apache2/sites-available/000-default.conf
  7. Change /var/www/html to /var/www
  8. [this may not bee needed anymore?] sudo visudo Add this line to the end of the file www-data ALL=(ALL) NOPASSWD: ALL
  9. Download the latest Oasis Spa build
  10. Samba setup and upload files (TBD)
  11. Import DB: Browse to http://oasis-spa/phpmyadmin or http://IPADDRESS/phpmyadmin login with root/MySQL password you set when installing. Add Database with the name "controller". Click on controller in the left pane and click import. Select controller.sql from the root of the Raspberry Pi Web files (/var/www/html/controller.sql) upload!
  12. Setup Cronjob crontab -e Add the following to the end of the file * * * * * wget -q -O - "http://127.0.0.1/cron_jobs/cron_min.php?auth=Gdw34zXrFHYDe" 1,11,21,31,41,51 * * * * wget -q -O - "http://127.0.0.1/cron_jobs/cron_10minutes.php?auth=Gdw34zXrFHYDe"
  13. HALLONLARM
    Download the binary to /usr/local/bin
    curl -L https://github.com/hemtjanst/hallonlarm/releases/download/v0.1.0/hallonlarm_0.1.0_linux_armv7.tar.gz | sudo tar zx -C /usr/local/bin hallonlarm

Install the unit file
sudo curl -Lo /etc/systemd/system/hallonlarm.service https://raw.githubusercontent.com/hemtjanst/hallonlarm/v0.1.0/hallonlarm.service

Edit the unit file to change mqtt address
sudo nano /etc/systemd/hallonlarm.service

Reload systemd
sudo systemctl daemon-reload

Copy and edit the sample configuration
sudo curl -Lo /etc/hallonlarm.conf https://raw.githubusercontent.com/hemtjanst/hallonlarm/v0.1.0/example.conf sudo nano /etc/hallonlarm.conf

Start the service
sudo systemctl start hallonlarm.service

Enable at boot
sudo systemctl enable hallonlarm.service

Usernames and Passwords

Web Interface: admin / 123456
SSH: pi / raspberry
PhpMyAdmin: root / raspberry