# BlinkStick as MQTT receiver

**URL:** <https://forums.blinkstick.com/t/blinkstick-as-mqtt-receiver/80>\
**Category:** Projects\
**Created:** [January 8, 2015, 11:50am UTC](https://forums.blinkstick.com/t/blinkstick-as-mqtt-receiver/80 "2015-01-08T11:50:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![arvydas](https://forums.blinkstick.com/user_avatar/forums.blinkstick.com/arvydas/32/242_2.png) [@arvydas](https://forums.blinkstick.com/u/arvydas)\
**Post date:** [January 8, 2015, 11:50am UTC](https://forums.blinkstick.com/t/blinkstick-as-mqtt-receiver/80/1 "2015-01-08T11:50:42Z")

</div>

BlinkStick forum member @juzam76 [shared his implementation of BlinkStick Square as MQTT receiver](https://gist.github.com/juzam/ad9a252ac7608e3398eb). His setup involves a Raspberry Pi running Node-RED flows and a Windows machine with an [MQTT](http://mqtt.org/) receiver to show notifications on [BlinkStick Square](https://www.blinkstick.com/products/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](http://nodered.org/) already has [native implementation of BlinkStick](https://github.com/node-red/node-red-nodes/tree/master/hardware/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.

---

<div class="post-metadata">

**Author:** ![juzam76](https://forums.blinkstick.com/user_avatar/forums.blinkstick.com/juzam76/32/50_2.png) [@juzam76](https://forums.blinkstick.com/u/juzam76)\
**Post date:** [January 8, 2015, 1:53pm UTC](https://forums.blinkstick.com/t/blinkstick-as-mqtt-receiver/80/2 "2015-01-08T13:53:59Z")

</div>

@arvydas thanks 🙂 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.

---

<div class="post-metadata">

**Author:** ![arvydas](https://forums.blinkstick.com/user_avatar/forums.blinkstick.com/arvydas/32/242_2.png) [@arvydas](https://forums.blinkstick.com/u/arvydas)\
**Post date:** [January 8, 2015, 2:18pm UTC](https://forums.blinkstick.com/t/blinkstick-as-mqtt-receiver/80/3 "2015-01-08T14:18:47Z")

</div>

Thanks for further explanation 😃 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.

---

<div class="post-metadata">

**Author:** ![juzam76](https://forums.blinkstick.com/user_avatar/forums.blinkstick.com/juzam76/32/50_2.png) [@juzam76](https://forums.blinkstick.com/u/juzam76)\
**Post date:** [January 8, 2015, 2:28pm UTC](https://forums.blinkstick.com/t/blinkstick-as-mqtt-receiver/80/4 "2015-01-08T14:28:12Z")

</div>

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. 🙂

edit: [https://github.com/arvydas/blinkstick-python](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.
