A member on
BlinkStick forums asked for some guidance on how it would be possible to use BlinkStick to display Internet connectivity status. Loved the idea so I build a quick sample script in Python to accomplish this.
Script works by checking connectivity to Google DNS server’s IP address. This approach avoid errors when DNS is not available, but the Internet connection is still up and running. When connection can be established, BlinkStick will light up green. When connection is not available, BlinkStick will start pulsing red and will turn green back again when connection is reestablished. Script tries to connect to Google DNS server every second so the notification is almost instant.
I tried to make the script as compact as possible and also documented most of the code to make it easier to understand and change.
Example: Display Internet connectivity status
There does not seem to be much info, but this project looks quite interesting and worth keeping an eye on! An
LED lit frame showing colour based on current room temperature with front mounted 7 segment display and BlinkStick Square inside an enclosure, of course!
Athom Sfere shared his video on how to use BlinkStick with Python on Windows
BlinkStick Python package now fully supports Windows OS. It currently has been tested only with Python 2.7. The documentation on the BlinkStick Python website describes how to install pip package for all popular operating systems:
One more additional feature has been introduced. Library now automatically restores USB device handles if BlinkStick was removed and the reinserted into any of the USB ports.
If you already have all prerequisites for your operating system, then installation is very simple:
sudo pip install blinkstick
If you have older version of blinkstick module installed, run the following command:
sudo pip install blinkstick --upgrade
Be sure to check out this great blog post by
Dmitri Popov and his neat way to get a BlinkStick notification whenever somebody visits his photo gallery running on a Raspberry Pi!
I’m using BlinkStick with
Pygmyfoto running on my Raspberry Pi. Every time someone visits the gallery, BlinkStick blinks with random color.
Read the full blog post over here:
Using BlinkStick with Raspberry Pi and let’s get his BlinkStick blinking!
Chris Hannam shared a video of how he uses BlinkStick to indicate moisture. He is using an Arduino hygrometer sensor to change the color of a BlinkStick if it’s not damp enough.
Now even your plants can have fun with BlinkStick! 🙂 Well done Chris!
You can find the bit of code that does the magic on Github:
Python module reference documentation is going to be always available here:
There are also plenty Python code examples in the Wiki:
Python BlinkStick package has been updated to 0.5.0.
Rob Berwick has done an amazing job and created color animations for BlinkStick Python API. They are covered with 3 main functions:
blink – blinks the specified color
pulse – pulses the specified color
morph – morphs from current color to the specified color
Continue reading →
MQTT is a machine-to-machine (M2M)/”Internet of Things” connectivity protocol. It was designed as an extremely lightweight publish/subscribe messaging transport.
Checkout full example of how to set everything up for
BlinkStick and MQTT integration on Github.
Thanks to Andrew D Lindsay
@andrewdlindsay for coming up with this idea!
Now there are even more ways to control your BlinkStick remotely! Remote control is a neat little feature, that allows your BlinkStick to become internet enabled device once connected to a computer.
There are currently 4 ways to connect BlinkStick to the web service:
Using the BlinkStick Client application (Windows)
Using command line tool from Python package (Linux, Mac OS X)
Writing code for Python (Linux, Mac OSX)
Writing code for Node.js (Linux, Mac OSX)
Head over to the
tutorials section to find out more.
Would you like to control your BlinkStick with any other language or OS? No problem! Just
contact me and I will make it happen! 🙂