A friend who works at Dreamhack asked me if I had any 24 led Neopixel-rings in my large store of good-to-have stuff. Unfortunately I didn’t, I could only find 12 led ones.
In the crew area for the tech/network crew at Dreamhack in Jönköping they have had a display that show the number of active alerts per team. So anyone easily could see if any area had problems, or if everything was green.
The display consisted of four 24-led Neopixel rings that either was green for no active alerts, or show spinning red leds, one for each concurrent alert.
That display was once created by Soundgoof, but it was lost after the last event and now they needed a replacement. You can see it in action here: https://youtu.be/JtTPRrnrXdo?t=18 .
I didn’t have any led rings large enough, but I found a couple of 32×32 LED RGB panels and an idea was formed. So after grabbing a Raspberry PI from the shelf and a variable power supply it was off to the races.
After some googling I found this repo (that even had a wiring diagram!) and to my total amazement it compiled without problems! But when I tried displaying some text I only got some random lines. Apparently the wiring diagram wasn’t made for my panels (or just wrong) so by using my multimeter I painstakingly mapped each pin AND IT WORKED!
Then I started with a javascript program to show the stats, since I had quite a lot more LEDs available compared to Soundgoof I decided to show the amount of errors up to 99 and the team names at the bottom. And using stuff from the scrap pile a quick-and-dirty panel was carpented to hold the panels with the RPI behind them and the powerbrick stylishly just hanging around on top.
The main feature is to show the number of alerts for each team. The alerts are sent via HTTP-POST from AlertManager once a minute and there is a heartbeat signal sent every 10 seconds. If the display sees more than two missing heartbeats the background behind the team names starts blinking black and yellow (as in the picture above). There is also a small blue heart displayed in the top left each time a heartbeat arrives.
The first version ran both the webserver (Fastify) and the matrix-code in the same process which caused some flickering, ghosting and artifacts at just a couple of http-connections per second. So instead of optimizing and doing hard work, I opted for splitting it into two processes that communicate via a named pipe. So the web-part accepts the alert notifications from the AlertManager and keep the count in an internal state, and once every second it writes the state to the fifo which is picked up by the matrix controller process which redraws the led-panels every 200ms.
The final version (for this event) shows alert numbers up to 99, then just a sad face emoji. And if you want to try it yourself you can find it here: https://github.com/dhtech/alertsquarer