Skip to content

Shows the current weather from OpenWeatherMap on an LCD using a Raspberry PI

License

Notifications You must be signed in to change notification settings

danielwohlgemuth/pi-lcd-weather

Repository files navigation

Pi LCD Weather

This project uses a Raspberry Pi to show the current weather downloaded from OpenWeatherMap on an 16x2 LCD

Layout

The corresponding Fritzing file can be found in the images folder.

Raspberry Pi

Layout

Raspberry Pi 2 and 3

Layout

To check if the display was connected correctly the simple_lcd.py script can be used. It contains just the minimal configuration to show a message on the display.

Final result

Final result

Setup

The initial configuration of this project can be made by running the setup.sh script file with

source setup.sh

It installs the virtualenv package, if its missing, creates a virtual environment and install the dependencies listed in requirements.txt.

A systemd unit file is copied to /etc/systemd/system/pi-lcd-weather.service, which points to the current project location, it then gets enabled to start on boot and is then started.

The config.ini file contains the OpenWeatherMap API key, a city ID and the temperature measure unit. The API key can be obtained here. The city ID can be extracted from the url after searching and selecting a city here. Possible values for temperature measure units are metric (for Celsius) and imperial (for Fahrenheit) The config.ini file is created if its missing.

If the setup was done with setup.sh, the program can be started with

sudo systemctl start pi-lcd-weather.service

or restarted after a change with

sudo systemctl restart pi-lcd-weather.service

It can also be started by activating the virtual environment first and then executed with

source venv/bin/activate
python lcd.py

Errors are logged into lcd.log

Sources:

About

Shows the current weather from OpenWeatherMap on an LCD using a Raspberry PI

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published