The software was created with two control methods, one for use with theatrical lighting systems and the other for use with other systems.
Theatrical lighting systems use the DMX protocol to control lights. DMX transmits 512 channels of data that control aspects of lighting fixtures. DMX is usually sent over dedicated cables but can be sent over a network using the Artnet protocol. Within a DMX universe, lights can be detected and configured using the RDM protocol. While RDM is an optional component of DMX, adding support for this allows lighting consoles to automatically detect or edit the lights configuration, such as which channels within the DMX datastream it should use, without needing to use another configuration method.
For both Artnet and RDM the protocols are published publicly and simple enough that they can be implemented from scratch, which is useful as there were no premade libraries that looked suitable. The basic implementation of these was created with the first prototype and refined through the later prototypes. The Artnet and RDM code blocks were also designed so that they could be reused later in a different project without needing to rewrite much of the code. The stack light is setup to use four DMX channels, one for setting the brightness of each of the three light segments and one for the buzzer.
For use with things like status monitoring tools and to provide a user friendly configuration interface a web interface was used. The ESP32 has a good amount of available flash so a bootstrap template was used to create the user interface in order to provide a fairly nice looking user interface. A combination of static files and templated files were used to create the webpage. There isn't a templating library for the ESP32 so I created a basic one which replaces tags in the saved file with strings calculated by a separate function. Settings are set from the webpage via a series of API endpoints which accept post requests with the new settings and update the configuration as required.
With these interfaces functional, the stack light is ready to be put to use. While writing the firmware I identified several future feature additions that could be added to improve the lights functionality. To avoid the project ending up in a state of continual feature creep these have been added to the issues list and marked as potential enhancements that can be added in the future if they become useful. The last step before This project will be marked as completed is to create a software release and instructions to allow others to build, this should be appearing here in the near future.
The firmware for this project can be found on github.