image/svg+xml Openclipart 2007-11-20T10:29:44 Some shapes from photos. http://openclipart.org/detail/8766/tree-silhouettes-by-chrisdesign-8766 Chrisdesign clip art clipart image media nature png public domain shape silhouette svg tree

zzolo

Lumiere 2.0

07 Feb 2022

This winter I spent some time re-engineering the Lumiere project — a project that lets anyone change the colors of the holiday lighting on our house through things like text messaging.

I built it from the ground-up. I learned a lot from the first version, and had a number of goals with this new version.

Screenshot of Lumiere web client

One of the main goals was to use web-sockets. This was driven by the fact that I wanted to be able to easily have multiple “nodes” (strings of lights attached to controllers), such as the inside Xmas tree and outside lighting, change at the same time. And I really wanted a more instant feel to the lights. Previously, I had used polling, which is just an interval to keep checking for updates; this previous decision had been driven a fair amount by the fact that I used an Arduino and there wasn’t really a way to use web-sockets on that platform. This also meant that my “node” platform choices this time around were a bit limited, and I ended up on the Raspberry Pi.

The Raspberry Pi is great on the software side but can be a bit lacking on the hardware side. Specifically the Raspberry Pi is a full computer and you can’t just unplug it willy-nilly like an Arduino, this means it either has to stay on the whole time or you have to figure out how to turn it off and on again, say on a timer. I actually ended up keeping it on all the time as we had kids outside our house waiting for the bus in the morning who enjoyed the lights.

Another need for this new version was that Meteor is no longer a thing, and so the code and architecture of the server for the previous version of Lumiere were defunct. So, it had to be rewritten from the ground up. I went with a simple Node/Express application.

The change in server code gave me an opportunity to create a web client that was not a part of the server application like had been the case with Meteor. I went with Svelte as the framework for the web client, which is always a pleasant experience.

I ran into some issues with the Raspberry Pi clients, specifically utilizing the Node libraries to control the lights on a Raspberry Pi 4 did not work and using it on an old Raspberry Pi ended up damaging my lights. This drove me to use Python on on the Raspberry Pi clients, which is a bit more “native” for Raspberry Pi, but was a bit new for me to do web-sockets in Python. This all turned out well, but notably I am just not as efficient or well-versed in Python so writing the animation code was a bit clunky.

I added or improved a couple fun bits. I added the ability to text an image and have the main colors of the image show up on the lights. I also added a whole of new color names and color combinations.

Plenty more to improve, but I am happy with how this turned out. Links below.