Skip to content
Simon Leiner edited this page Dec 1, 2016 · 9 revisions

Paths

The general scheme is led/{sys_name}/show/{show_name}/{command}

What the MQTT controller does

The MQTT controller listens for the commands start, stop and brightness for all shows. Any other commands (all except for start, stop and brightness) are up to the individual lightshow.

start

The MQTT controller stops (see below) any running show. Then it checks if the given parameters (the JSON payload of the MQTT start message) are valid by invoking show.parameters_valid(parameters). If the show calls the parameters valid, the controller starts a new process where show.run(strip, conf, parameters).

stop

The MQTT controller asks the lightshow process kindly to join and after a timeout (usually less than a second) terminates the lightshow process if still running. Then the controller clears the LED strip buffer (without invoking strip.show())

brightness

The MQTT controller sets the brightness prefix (0 to 31) for all the LEDs in the strip and then invokes strip.show()

What lightshows can do

As each lightshow gets the global conf object it can itself subscribe to MQTT messages and respond to them.

Clone this wiki locally