BlinkStick as an Internet connectivity status indicator

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

Python package updated to 0.7.0

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:

https://github.com/arvydas/blinkstick-python

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

Your Projects: Blink when there is a visitor

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!

Your Projects: BlinkStick and Moisture Detection

https://www.youtube.com/watch?v=6JUfzMMyTWE

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:

https://gist.github.com/bassdread/5619506

Python package updated to 0.5.0

Python BlinkStick package has been updated to 0.5.0.

https://pypi.python.org/pypi/BlinkStick/

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

More ways to control your BlinkStick remotely

5

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