A few years back, I built my first status screen using a Raspberry Pi 2B and an old version of Raspbian. Now, I repeated the task using a Pi 3B and the latest version of the OS. Since things have changed significantly enough I decided it would be worth writing another quick post about it.
The result includes the date, time, current temperature outside, world and local news, and looks like this:
The first thing to do is to connect a Pi to an old TV, which is what I did. Installing Raspbian should be simple enough and is described quite clearly on the web site. Once done, there are basically three things we have to do:
Creating a status website
To make the actual web site, I used GitHub Pages. You can see the actual site I use here. The only file I had to create manually was the index page, which is a simple page that provides a black background, the needed styling, and some JavaScript functions to show the clock and refresh various parts of the page.
Once the repository is created, you can go to the Settings page and enable the GitHub Pages option. I use a custom domain name, but you don’t have to if it’s just a personal project.
Making the update script
The news pages and the current temperature are updated using a Python script that runs on the Pi itself. Basically, I added my GitHub SSH key, cloned the repository I created above, then wrote a simple script to fetch the news and the weather for the city I live in, update the files in the repo, and commit the changes to GitHub.
Here is the complete script is available in the repo itself but should be run on your Pi. When you run it, both news pages and the weather page should be updated automatically. Make sure your GitHub SSH key is configured first so the push command works.
The crontab command I use is this:
*/15 * * * * /share/scripts/update_status.py
Running the kiosk
To have my Pi show the status screen, I use Chromium in kiosk mode. Basically, I created the file ~/.config/autostart/chromium.desktop
with the following content:
[Desktop Entry]
Type=Application
Name=Chromium
Exec=/usr/lib/chromium-browser/chromium-browser-v7 --kiosk https://status.dendory.net
Of course make sure Chromium is installed first. Once you reboot, it should launch the browser in full screen mode showing that URL. Just use your GitHub Pages URL instead.
And that’s all there is to it.