Skip to content

Server status visualizer on LED matrix

License

Notifications You must be signed in to change notification settings

aw/hw-statuspage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Statuspage Unicorn HAT HD

Display site, component, and incident status from the Atlassian Statuspage.io v2 API on a Unicorn HAT HD, as shown below:

Site Status
www.githubstatus.com hat-status-github2
37status.com hat-status-37signals2
status.openai.com hat-status-openai2
  1. How to read the matrix
  2. Requirements
  3. Getting started
  4. How it works
  5. Contributing
  6. License

How to read the matrix

Here we'll use an example from githubstatus.com:

matrix dots

First, most importantly: The blue lines are dividers

Above the blue line

The 2x16 dots (32 dots) above the horizontal blue line represent the blended status, as explained here. Those dots will always appear either red, orange, yellow, or green at the same time. This makes it very clear when a global outage or incident is currently in effect.

Right of the blue line

Next, the 11 dots to the right of the vertical blue line represent today's status impact of each individual component, as explained here. Each component is given one row of dots starting from the bottom. Each dot can appear either red, orange, yellow, or green independently.

A maximum of 13 components can be displayed at once, so the program will only display the first 13 components returned by the Statuspage v2 API.

Left of the blue line

Finally, the dots to the left of the vertical blue line represent the historical status impact of each individual component. The dot immediately to the left of the vertical blue line is the status from 1 day ago. The second dot to the left of the vertical blue line is the status from 2 days ago, etc.

A maximum of 14 days worth of historical status can be displayed at once.

Below the blue line

The black dots/spaces below the horizontal blue line represent no component and therefore have no status dots and no dividing line (i.e: no blue dot).

Interpreting githubstatus.com

From the example above, we can conclude the following:

  • All systems are currently operational (blended status)
  • All 11 components are operational today
  • Components 2, 4, 5, 6 had a major outage 11 days ago
  • Component 5 had a major outage 12 days ago

Requirements

  • A Unicorn Hat HD
  • RPi with a network connection
  • Raspios flashed and accessible
  • Python 3.9+

This was tested and developed on an RPi 2 B+ and WiPi wireless network adapter.

Note: The Unicorn HAT HD might be out of stock at Pimoroni, but it should available at Adafruit, Digi-Key, and others.

Getting started

Once the hardware is set up, you'll need to install some software.

DISCLAIMER: I can't be held responsible for your use or misuse of this software and documentation. I also can't support alternative uses, but I'm open to pull requests for improvements.

Install the unicornhathd and its dependencies

Follow these instructions, or do it manually:

sudo apt-get install python3-pip python3-dev python3-spidev
sudo pip3 install unicornhathd

Enable SPI

sudo raspi-config nonint do_spi 0
sudo reboot

Clone this git repo

git clone https://github.com/aw/hw-statuspage
cd hw-statuspage
pip3 install -r requirements.txt

Run the script

sudo ./statuspage.py "www.githubstatus.com www.37status.com"

How it works

Personal note: This is my first Python project, the code is far from optimal.

The script will run in an infinite loop, fetching status updates of one URL, then it will sleep for 60 seconds (SLEEP_TIMEOUT variable) before fetching the status updates of the next URL.

It will first fetch the summary from the summary.json URL to obtain the blended status of the site. It will cache the results in a temporary file in /tmp (FILE_PREFIX variable), and then update the current site status (above the horizontal blue line).

If the temporary file exists, it will check its age and use the existing file if it's less than 1 hour old (MAX_AGE_SUMMARY constant).

If the blended status is more than 5 minutes old (MAX_AGE_STATUS constant), it will fetch a new status from the status.json URL.

The summary data will then be used to update today's component status (right of the vertical blue line).

Next, the script will fetch the historical incident data from the incidents.json URL and update the historical component status (left of the vertical blue line). Similar to the summary.json, the file will be cached in a temporary location, but this time for up to 24 hours (MAX_AGE_INCIDENT constant). This is to prevent constantly hitting the API to obtain historical data that technically shouldn't change (unless someone has a time machine...).

Contributing

License

MIT License

Copyright (c) 2024~2025 Alexander Williams, https://a1w.ca