BlinkStick as MQTT receiver

BlinkStick forum member @juzam76 shared his implementation of BlinkStick Square as MQTT receiver. His setup involves a Raspberry Pi running Node-RED flows and a Windows machine with an MQTT receiver to show notifications on BlinkStick Square. The neat feature is that his setup allows controlling of any number of BlinkStick devices and it’s not only limited to BlinkStick Square boards.

Node-RED already has native implementation of BlinkStick, but @juzam76 wanted to show notifications on a remote machine. Worth noting that Node-RED implementation currently supports only single LED BlinkStick devices or BlinkStick Square and BlinkStick Strip in WS2812 mirror mode. It can control multi LED BlinkSticks, but only controls the first LED on the device. I’m planning to support all new multi LED features in near future.

@arvydas thanks :slight_smile: I’ll clarify another bit of my setup:

  • raspberry pi: here’s where the mqtt broker and node-red are
  • windows laptop: cygwin + blinkstick debug cli + mqtt-launcher (written in python, see the previously linked gist)

so mqtt-launcher subscribes to the topics that node-red publishes to, and reacts as the config specify launching blinkstick.exe to set the various leds.

Anyway, let me know if there’s something to explain further.

Thanks for further explanation :smiley: mqtt-launcher looks like is implemented with Python. Might be interesting to see if it’s possible to control BlinkStick directly from Python in order to avoid the command line utility. I suspect it’s a bit slow, because it needs to initialize every time it’s started.

Yes mqtt-launcher is written in python. I didn’t try to control the stick directly with python, but that should not be a big problem i think.

My setup just uses what I’ve already used in the past, is ready available and working with just a bit of config.

Not elegant, or efficient, but it works. :slight_smile:

edit: https://github.com/arvydas/blinkstick-python maybe can replace the “native” command line utility. but i’ll stick to mqtt-launch to trigger something external, for maximum flexibility
edit2: the python command line utility cited in the previous edit can’t be used with cygwin’s python, because it depends on psutils python package that fails to install with pip directly or via “pip install blinkstick”

   Downloading/unpacking psutil
   Running setup.py egg_info for package psutil
   platform cygwin is not supported
   Complete output from command python setup.py egg_info:
   platform cygwin is not supported

that’s because there’s no setuptools package for cygwin python as far as i know.