Using BlinkStick with Raspberry Pi
Hooking up LEDs to Raspberry Pi's GPIO pins and controlling them using Python scripts is a great and fun way to learn the ropes. For more advanced projects, you might want to consider investing in BlinkStick, an open source USB LED kit that works with Raspberry Pi, or any other machine for that matter. BlinkStick plugs directly into a USB port, which eliminates the need for a breadboard and wires and makes the setup more tidy. The accompanying software can control multiple BlinkSticks, which you can hook up to a USB hub. More importantly, BlinkStick supports a long list of options, and you can put it to a variety of practical and not-so-practical-but-fun uses.
To get started with BlinkStick on Raspberry Pi, you need to install the BlinkStick Python interface first. To do this, run the following commands:
sudo apt-get install python-dev python-pip sudo easy_install pip sudo pip install blinkstick
Run then the sudo blinkstick -h command. If everything works properly, you should see a list of all available options. By default, you have to execute blinkstick commands with root permissions. To fix that, run the following command and reboot Raspberry Pi:
sudo blinkstick --add-udev-rule
So what can you actually do with BlinkStick? For starters, you can use it to visualize CPU usage, and the blickstick command has a dedicated option for that. Run the blinkstick --cpu-usage command, and BlinkStick will change its color depending on the CPU usage (Green = 0%, Amber = 50%, Red = 100%).
Of course, you can put BlinkStick to other uses, too. I'm using BlinkStick with Pygmyfoto running on my Raspberry Pi. Every time someone visits the gallery, BlinkStick blinks with random color. This solution consists of a simple Bash shell script which controls BlinkStick and logs visitor access to the blinkstick.log file:
#!/bin/bash blinkstick --set-color random --blink --repeats 3 blinkstick --set-color random DATE=$(date "+%F %T") echo "Yay! Someone visited your site on" $DATE >> blinkstick.log
The shell_exec ( './blinkstick.sh > /dev/null 2>/dev/null &' ) command embedded into the index.php page triggers the script.comments powered by Disqus
Carnegie Mellon researchers say 3 million pages could fall down the phishing hole in the next year.
The US government rolls new best-practice rules for protecting SSH.
Klaus Knopper announces the latest version of his iconic Live Linux system.
All websites that use these popular CMS tools could be vulnerable to denial of service attacks if users don't install the updates.
According to a report, many potential victims of the Heartbleed attack have patched their systems, but few have cleaned up the crime scene to protect themselves from the effects of a previous intrusion.
DARPA and NICTA release the code for the ultra-secure microkernel system used in aerial drones.
Should you trust an online service to store your online passwords?
New B+ board lets you build cool things without the complication of a powered USB hub.
Redmond rushes in to root out alleged malware haven.
New initiative will bring futuristic virtual reality effects to the web surfing experience.