Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install blinkstick

How to install BlinkStick

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install blinkstick
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
Windows (64-bit)
Mac OS X (10.5+)
0.5.0 Available View build log
Linux (32-bit)
0.5.0 Available View build log
Linux (64-bit)
0.5.0 Available View build log
 
License
LICENSE.txt
Imports
Lastest release
version 0.5.0 on May 9th, 2013

BlinkStick Python interface to control devices connected to the computer.

What is BlinkStick? It's a DIY USB RGB LED device. More info about it here:

http://www.blinkstick.com

Requirements

  • Python
  • BlinkStick pip module
  • Libusb for Mac OSX

Requirements Installation

Linux

Install requirement for websocket-client package:

sudo apt-get install python-dev

Note: Replace python-dev with python2.7-dev if you are installing on Raspberry Pi.

Install pip (Python package management software):

sudo apt-get install python-pip
Mac OS X

Install libusb with homebrew:

sudo brew install libusb

Install pip

sudo easy_install pip

BlinkStick package Installation

Install blinkstick Python package with pip:

sudo pip install blinkstick

Description

Together with the Python module an additional command line tool is installed to control BlinkSticks. Use the following command to see all available options:

blinkstick -h
Usage: blinkstick [options]

Options:
  -h, --help            show this help message and exit
  -i, --info            display BlinkStick info
  -s SERIAL, --serial=SERIAL
                        select device by serial number. If unspecified, action
                        will be performed on all BlinkSticks.
  --inverse             control BlinkSticks in inverse mode
  --set-color=COLOR     set the color for the device. The value can either be
                        a named color, hex value, 'random' or 'off'.
                        CSS color names are defined
                        http://www.w3.org/TR/css3-color/ e.g. red, green,
                        blue.Specify color using hexadecimal color value e.g.
                        '#FF3366'
  --duration=DURATION   Set duration of transition in milliseconds (use with
                        --morph and --pulse).
  --delay=DELAY         Set time in milliseconds to light LED for (use with
                        --blink).
  --repeats=REPEATS     Number of repetitions (use with --blink and --pulse).
  --blink               Blink LED (requires --set-color, and optionally
                        --delay)
  --pulse               Pulse LED (requires --set-color, and optionally
                        --duration).
  --morph               Morph to specified color (requires --set-color, and
                        optionally --duration).
  --set-infoblock1=INFOBLOCK1
                        set the first info block for the device.
  --set-infoblock2=INFOBLOCK2
                        set the second info block for the device.
  --cpu-usage           Use BlinkStick to display CPU usage.
  --connect=ACCESS_CODE
                        Connect to blinkstick.com and control the device
                        remotely.
  -v, --verbose         Display debug output
  --add-udev-rule       Add udev rule to access BlinkSticks without root
                        permissions. Must be run as root.

Command Line Examples

Set random color all BlinkSticks:

blinkstick --set-color random

Set blue color for the blinkstick with serial number BS000001-1.0:

blinkstick --serial BS000001-1.0 --set-color blue

Blink red color twice

blinkstick --set-color red --blink --repeats 2

Blink pulse green color three times

blinkstick --set-color green --pulse --repeats 2

Morph to red, green and blue

blinkstick --set-color red --morph
blinkstick --set-color gree --morph
blinkstick --set-color blue --morph

Connect to blinkstick.com with access_code available on the device details page:

blinkstick --connect access_code

Use BlinkStick to display CPU usage:

blinkstick --cpu-usage

Code Examples

Code examples are available in the wiki:

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

Permission problems

If the script returns with an error

Access denied (insufficient permissions)

You can either run the script with sudo, for example:

sudo blinkstick --set-color random

Or you can add a udev rule to allow any user to access the device without root permissions with this single command.

sudo blinkstick --add-udev-rule

There is also another equivalent command that does exactly the same thing:

echo "SUBSYSTEM==\"usb\", ATTR{idVendor}==\"20a0\", ATTR{idProduct}==\"41e5\", MODE:=\"0666\"" | sudo tee /etc/udev/rules.d/85-blinkstick.rules

Reboot computer after you have added the command and all users will have permissions to access the device without the need of root permissions.

Maintainers

Subscribe to package updates

Last updated May 9th, 2013

Download Stats

Last month:2

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.