Trotter73 / WeatherHAT

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This repo aims to build on CyntechUK WeatherHAT by adding an alternate method for obtaining and displaying OpenWeatherMap data and fixing now defunct install instructions and dependencies.

For reference the original instructionbs can be found here; http://guides.cyntech.co.uk/weatherhat/getting-started/

Weather-Display.py is based on getWeather.py found here; https://github.com/kd8bxp/WeatherHAT

Ensure the iC2 interface is enabled.

Basic HAT install

sudo apt-get update sudo apt-get upgrade sudo apt-get install git python3-smbus pip python3-requests python3-gpiozero

sudo pip install rpi_ws281x

Edit the location and add api key

nano Weather-Display.py

Now we can run the script:

sudo python Weather-Display.py &

To make the code into a service;

sudo nano /lib/systemd/system/weather-hat.service

add the following to the newly created file.

[Unit] Description=Weather Hat Service After=multi-user.target

[Service] Type=simple

WorkingDirectory=/home/pi/getWeather/

ExecStart=sudo python /home/pi/getWeather/Weather-Display.py

Restart=on-failure

[Install]

WantedBy=multi-user.target

To enable;

sudo systemctl daemon-reload

sudo systemctl enable weather-hat.service

To control;

sudo systemctl start weather-hat.service

sudo systemctl stop weather-hat.service

About


Languages

Language:Python 100.0%