Environment Monitor with graphs for the Raspberry Pi Zero with Enviro pHAT
Requirements:
- Raspberry Pi Zero
- Enviro pHAT https://shop.pimoroni.com/products/enviro-phat
- Wifi Dongle
curl -sS get.pimoroni.com/envirophat | bash
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install apache2 -y
sudo apt-get install php5 libapache2-mod-php5 -y
sudo apt-get install mysql-server php5-mysql -y
# note down the password you choose for the mysql root user
sudo apt-get install git
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
sudo php composer-setup.php --filename=composer --install-dir=/usr/bin
cd /var/www/html/
sudo chown pi:www-data *
sudo chown pi:www-data .
rm index.html
git clone https://github.com/robertclarkson/RaspberryPiEnviroMonitor.git .
composer install
mysql -u root -p
(enter your root mysql pass)
create database enviro;
exit;
sudo nano /etc/apache2/apache2.conf
sudo a2enmod rewrite
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
# to this
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
sudo nano /etc/php5/apache2/php.ini
# change
max_execution_time = 30
# to
max_execution_time = 120
sudo service apache2 restart
sudo chown pi:www-data . -R
sudo chmod 775 . -R
cp _ss_environment.sample _ss_environment.php
nano _ss_environment.php
#update SS_DATABASE_PASSWORD with your root password
sudo visudo
# then add this line
www-data ALL=NOPASSWD: /var/www/html/TakeReading.py
crontab -e
*/15 * * * * /var/www/html/framework/sake home/TakeReading
Go to your raspberry pi homepage in your browser http://raspberrypi
Hopefully the database should build and you should see the homepage