-
Notifications
You must be signed in to change notification settings - Fork 1
Fresh Install Method
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
- Start with a clean or existing Jessie install. Skip steps if you've already have these items configured.
- Connect to your Pi with Putty (or direct with monitor/keyboard if that is how you're rolling)
Sudo raspi-config
- Select Expand File System. Let that finish and reboot the Pi
- Do any updating/apt-get you may need if this is an older install
sudo apt-get install apache2
-
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 sudo apt-get install phpmyadmin
-
Configure Apache to work with PhpMyAdmin
sudo nano /etc/apache2/apache2.conf
- Add the following line at the end of apache2.conf:
Include /etc/phpmyadmin/apache.conf
Control + X to save, type "Y" to overwrite. - Install WiringPi
sudo apt-get install git-core
git clone git://git.drogon.net/wiringPi
cd wiringPi
./build
- To get the DS18B20 sensors working (hard wired only! not SonoffTH or IoT)
sudo nano /boot/config.txt
Add the following linedtoverlay=w1-gpio
- Make sure WiringPi is working correctly
gpio -v
gpio readall
- Add the pi user to the group
sudo passwd -a pi www-data
sudo chown www-data:www-data /var/www
sudo chmod 775 /var/www
- Change the root directory of Apache
sudo nano /etc/apache2/sites-available/000-default.conf
- Change /var/www/html to /var/www
- [this may not bee needed anymore?]
sudo visudo
Add this line to the end of the filewww-data ALL=(ALL) NOPASSWD: ALL
- Download the latest Oasis Spa build
- Samba setup and upload files (TBD)
- 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!
- 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"
-
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
Web Interface: admin / 123456
SSH: pi / raspberry
PhpMyAdmin: root / raspberry
Original code by Rick Feenstra used with permission Instructables