During Ipswich Makerspace’s Open day on the 28th September, part of my display consisted of a Weather Dashboard, on a Pimoroni Hyperpixel 4. For this display, I used some preexisting code that I modified to work on the higher density of the screen.
I used PiWeatherRock that is maintained on Github by “Genebean”. You can find the code and clone it from the following URL:
https://github.com/genebean/PiWeatherRock
This worked fine out of the box, but the icons bundled were either too big or too small. So looking through the code, I found the developer was using some icons from Github. I also found that that developer had made them available in other sizes.
https://github.com/manifestinteractive/weather-underground-icons/
So I cloned that, found a size that looked a lot nicer and modified my repository to use the other size.
I’ve made some changes to incorporate these icons and have created a new repository on GitHub. My version is also preset to use the UK format (Celcius and not Fahrenheit).
https://github.com/vwillcox/PiWeatherRock-HyperPixel
The final changes I have made are to get this to run each time the RaspberryPi is rebooted using a System file:
[Unit] Description=PiWeatherRock Wants=network.target After=network.target [Service] Environment=DISPLAY=:0 Environment=XAUTHORITY=/home/pi/.Xauthority ExecStart=/usr/bin/python3 /home/pi/PiWeatherRock/weather.py Restart=always RestartSec=10s KillMode=process TimeoutSec=infinity [Install] WantedBy=graphical.target
You need to copy this as follows
sudo cp PiWeatherRock.service /etc/systemd/system sudo systemctl daemon-reload sudo systemctl enable PiWeatherRock.service sudo reboot
All being well, you should see that once the Raspberry Pi has rebooted, you should be looking at the weather on your attached HyperPixel 4
Leave a Reply