Skip to content

atbPy/Pi_Weather_Station

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pi_Weather_Station: Weather Station Using Raspberry Pi and Sense HAT

Python 3.4.2 | flask 0.10.1 | sense_hat 2.2.0

Pi with HAT

Description

These scripts use a Raspberry Pi with a Sense HAT to monitor temperature, humidity, pressure, and orientation. The sensor information is displayed on the sense HAT 8x8 LED matrix, and via the web browser using flask.

Getting Started

On your raspberry pi with sense HAT run the command lines below

sudo apt-get update
sudo apt-get upgrade
git clone https://github.com/llamafarmer/Pi_Weather_Station.git

Next you will need to install the packages needed for the scripts to execute

sudo apt-get install python3-flask
sudo apt-get install sense-hat

You then need to change directories to the newly downloaded repository and start the python scripts

cd Pi_Weather_Station
python3 weather.py
python3 web_app.py

The 8x8 LED matrix should light up and begin scrolling sensor information. You can also view the sensor information using the web browser and pointing it to port 5000 of the raspberry pi.

Pi HAT LED

Web Screenshot

To execute these scripts automatically we need to update the bash scripts in the utils folder and make them executable

First change directories to the utils folder and update the bash scripts to point to your python scripts

cd utils
nano launch_weather.sh
nano launch_web_app.sh

Then make them executable

sudo chmod +x launch_weather.sh
sudo chmod +x launch_web_app.sh

Test the files

./launch_weather.sh
./launch_web_app.sh

Lastly add them to cron

sudo crontab -e
@reboot /home/pi/Pi_Weather_Station/utils/launch_weather.sh
@reboot /home/pi/Pi_Weather_Station/utils/launch_web_app.sh

ctrl+x to exit and y to save. Then enter the command below to reboot

sudo reboot -h now

Your raspberry pi should reboot and execute both scripts on startup

todo

  • add joystick functionality
  • add video (Pi Camera)
  • improve web interface (buttons/user input)
  • Allow user to create email alerts

About

Raspberry Pi Weather Station Using Sense HAT

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 83.4%
  • HTML 10.0%
  • Shell 6.6%