CPU script not working

Hi, I’ve been attempting to get my BlinkStick CPU script running on my Raspberry Pi following this guide, the script will run fine and show 'displaying CPU usage… Press Ctrl + C to exit" but the BlinkStick never lights up during it.

The BlinkStick will work using ‘set color’ but not using this script.

Any help is greatly appreciated.

What model of RPi are you using and what OS do you have installed on the SD card? Would be very helpful for me to reproduce the issue.

Hi, I’ve tried this on both an Intel NUC running Ubuntu 14.04 and a original Raspberry Pi running the latest version of Raspbian. The script.

I’m downloading Ubuntu 14.04 now to test in the VM.

Hey Nathaniel,

you say printing the “displaying…” line works well?
In my eyes the example is for python < 3.0. Afaik since python 3.0 ‘print’ has been changed to print().
Example: print(“Hello World”). Can the missing braces break off the script somehow?

Try to copy the example one to one, set the braces for the print lines and try again.

It did work fine yes. I’ve done some testing to show what does and doesn’t work; all the values are returned as can be seen here, it just doesn’t light uo

The problem was with the last line of the example script. Please change it to:

bstick.set_color(red=intensity, green=255 - intensity, blue=0)

Doing this on a fresh install of Ubuntu 14.04. Full instructions:

sudo apt-get install python-pip python-dev
sudo pip install blinkstick psutil
sudo blinkstick --add-udev-rule

Reboot computer.

Create a file cpu.py in the home directory just copying and pasting from the example found here:

I’ve updated the last line of the script in the wiki.

Then run:

python cpu.py

Hope this helps :smiley:

It works perfectly now; thank you!

Glad to hear it’s working for you now :smiley: Happy hacking!