Weather display project, featuring a Inky wHAT e-ink display and a Raspberry Pi.
Current weather information
Hourly Weather Forecast (Every two hours, total of eight hours ahead)
sudo raspi-config
sudo apt update
sudo apt install git
curl https://get.pimoroni.com/inky | bash
pip install pyowm
git clone https://github.com/Hothomir/weather-report.git
cd weather-report
nano configfile.ini
[OWM_API]
api = 123456789abcdefg
[Location] latitude = 39.952583 longitude = -75.165222 city = Philadelphia country = US
9. Run the program while in the weather-report directory
Inky wHAT: python main.py Inky Impression: python impression-main.py
# Recurring Display Refreshes
To get new weather information in timed intervals, I've used crontab. Crontab schedules when to run the main.py file and is flexible with how often it should be run.
I've set up the crontab job to run every 30 minutes, so the display will refresh every 30 minutes. Example:
1. Open crontab in terminal
crontab -e
2. At the bottom of the crontab file, provide the following line:
/30 * python /home/pi/weather-report/main.py
3. To refresh the display every 60 mins (every hour):
/60 * python /home/pi/weather-report/main.py
# To-Do
- Where the weather condition prints "Clear" in the image, it would be better to print the detailed condition for the current weather. However, need to see how to wrap text, as the detailed conditions print as one line and get cut off by the edge of the display.
# Resources
pyOWM
https://pyowm.readthedocs.io/en/latest/#
Pimoroni Inky
https://github.com/pimoroni/inky