iot, coding, raspberry pi, python, redis,

Cheerlights with MQTT and Redis Streams

Simon Prickett Simon Prickett 1 min read
Cheerlights with MQTT and Redis Streams

CheerLights is a global network of synchronised lights that can be controlled by anyone. Tweeting a colour to the CheerLights Twitter account and talking to a bot on its Discord server are a couple of examples of ways that anyone can change the colour of all CheerLights installations globally to one of the several supported colours.

I decided to write my own small CheerLights display using the Pimoroni Unicorn Hat LED matrix connected to a Raspberry Pi. CheerLights provides different methods to get the latest colour information - I chose to use their MQTT server and store colour history in a Redis Stream.

Screenshot from my live stream showing the Cheerlights project working
Cheerlights via MQTT and Redis Streams displaying on a Pimoroni Unicorn Hat.

This was the third project in my Things on Thursdays IoT live streaming series.

Enjoying this article? Please consider buying me a coffee on Ko-Fi.
Your support helps to fund future projects!

In this project, I showed how to show and track the current CheerLights colour on a Pimoroni Unicorn Hat connected to a Raspberry Pi. I subscribed to a topic on the CheerLights MQTT server, put the latest colour into a Redis Stream and consumed it on the Pi. The code is all in Python.

Main photograph by Tony Hisgett on Wikimedia Commons.

Simon Prickett
Written by Simon Prickett
Hugely Experienced Developer Relations Leader.