Skip to content

Instantly share code, notes, and snippets.

@juzam
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juzam/ad9a252ac7608e3398eb to your computer and use it in GitHub Desktop.
Save juzam/ad9a252ac7608e3398eb to your computer and use it in GitHub Desktop.
BlinkStick Square mqtt-launcher https://github.com/jpmens/mqtt-launcher config on Windows (cygwin, requires python, paho-mqtt and blinkstick debug command line util: https://www.blinkstick.com/system/releases/windows/blinkstick-command-line.zip)
logfile = 'mqtt-launcher.log'
mqtt_broker = '192.168.0.1' # default: 'localhost'
mqtt_port = 1883 # default: 1883
mqtt_clientid = 'mqttlauncher-1'
mqtt_username = 'username'
mqtt_password = 'password'
topiclist = {
"blinkstick/serialn/0" : {
None : [ '/usr/local/bin/blinkstick.exe', '--index', '0', '--set-color', '@!@' ]
},
"blinkstick/serialn/1" : {
None : [ '/usr/local/bin/blinkstick.exe', '--index', '1', '--set-color', '@!@' ]
},
"blinkstick/serialn/2" : {
None : [ '/usr/local/bin/blinkstick.exe', '--index', '2', '--set-color', '@!@' ]
},
"blinkstick/serialn/3" : {
None : [ '/usr/local/bin/blinkstick.exe', '--index', '3', '--set-color', '@!@' ]
},
"blinkstick/serialn/4" : {
None : [ '/usr/local/bin/blinkstick.exe', '--index', '4', '--set-color', '@!@' ]
},
"blinkstick/serialn/5" : {
None : [ '/usr/local/bin/blinkstick.exe', '--index', '5', '--set-color', '@!@' ]
},
"blinkstick/serialn/6" : {
None : [ '/usr/local/bin/blinkstick.exe', '--index', '6', '--set-color', '@!@' ]
},
"blinkstick/serialn/7" : {
None : [ '/usr/local/bin/blinkstick.exe', '--index', '7', '--set-color', '@!@' ]
},
}

Simple mqtt-launcher setup.

install python and paho-mqtt (pip install paho-mqtt) in your cygwin environment. dowload the blinkstick debug client and unzip it in your desired directory (/usr/local/bin in the example)

the topic structure in the example is this:

blinkstick/serialn/pixelindex

where serialn is the serial number of your blinkstick device.

you can find your blinkstick serial number with the command:

blinkstick --info

if you need to address different blinksticks you need to add '-d', 'serialn' (specifying the serial number of your device) to the commands provided e.g.:

None : [ '/usr/local/bin/blinkstick.exe', '--index', '0', '-d', 'serialn', '--set-color', '@!@' ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment