Skip to content
This repository has been archived by the owner on Apr 28, 2019. It is now read-only.
/ enviro-pi Public archive

Web-based weather station for Raspberry Pi and SenseHat

License

Notifications You must be signed in to change notification settings

odlevakp/enviro-pi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Enviro-Pi

I wanted something to monitor my room temperature and humidity, so I wrote this simple web-based weather station for Raspberry Pi and SenseHat.

Very "raw", fixes and PRs welcome!

Hardware requirements

If you put your SenseHat on top of your Pi, the temperature readings might be inaccurate due to the heat coming from it - that's what the optional ribbon cable is for:

SenseHat Ribbon Cable

To use your SenseHat with a ribbon cable, you can remove the GPIO header on the bottom of the hat. It won't go easy the first time, just remember, you are removing the bottom one ;-)

The application was inspired by following resources:

Installation and Software requirements

Update your package database and make sure you have all required packages, then clone this git repository. Installation of supervisor is optional, it is used to keep the processes running in background.

sudo apt update
sudo apt install supervisor python3-flask sqlite3 git sense-hat
git clone https://github.com/odlevakp/enviro-pi.git ~/enviro-pi

Auto start

Supervisor was installed to keep your two processes alive. First one, writer.py, reads environmental information from sensehat and writes them into a database. Second process, webserver.py, starts a web server and displays collected data. The configuration needed to run them using supervisor, is placed in the supervisor subdirectory.

cd ~/enviro-pi

sudo ln -s /home/pi/enviro-pi/supervisor/* /etc/supervisor/conf.d/
sudo systemctl restart supervisor.service

sudo supervisorctl

You should see both processes running and good to go. Open you browser on PI_IP_ADDRESS:8080.

Screenshots

Status MacOS screenshot Charts MacOS screenshot Statistics Android screenshot

Playing with database

The writer process is storing environmental readings in a local SQLite database. You can use the CLI client to make additional queries on the recorded dataset.

$ sqlite3 sensehat.db

sqlite> .headers on
sqlite> .mode column

sqlite> SELECT * FROM sensehat;

sqlite> SELECT MAX(humidity),
datetime(epoch, 'unixepoch', 'localtime') as date
FROM sensehat;

Please note that time is stored in the epoch column as time since epoch. Column temp_prs stores temperature from pressure, not used in the web interface.

License and Authors

Copyright 2016 Pavol Odlevak

Using Chart.js and Moment.js available under the MIT license.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

Web-based weather station for Raspberry Pi and SenseHat

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published