led

How to Build Your Own Raspberry Pi Cluster ('Bramble')

Rasbperry Pi Dramble

One of the first questions I'm asked by those who see the Dramble is, "How do I build my own?" Since I've been asked the question many times, I put together a detailed parts list, and maintain it on the Dramble's project wiki on GitHub: Raspberry Pis and Accessories.

For a little over $400, you can have the exact same setup, with six Raspberry Pi 2s, a network switch, a rack inside which you can mount the Pis, microSD cards for storage, a 6-port USB power supply, and all the required cables and storage!

Raspberry Pi RGB LED boards

Controlling PWR and ACT LEDs on the Raspberry Pi

All Raspberry Pi models have a few built-in LEDs; the earlier models had PWR, ACT, and networking status LEDs all lined up on the board itself; for the B+ and model 2 B, the networking LEDs moved onto the network jack itself, leaving just two LEDs; PWR (a red LED) and ACT (a green LED).

Normally, whenever the Pi is powered on—except if the power supply dips below something like 4.5VDC—the red PWR LED remains lit no matter what. If you wanted to 'disable' the LED, you'd have to put a piece of tape or something else over the LED, or get out a soldering iron and modify the hardware a bit.

Raspberry Pi model 2 B, B+ and A+ (and beyond)

Luckily, with the Pi 2 model B, B+, A+, and Zero, you can control the LEDs in software, in a few different ways. The simplest way to change the way these LEDs work is to modify the trigger for each LED by setting it in /sys/class/leds/led[LED_ID]/trigger, where you replace [LED_ID] with 0 for the green ACT LED, and 1 for the red PWR LED.

For example:

Ansible deployments Visualized with a Raspberry Pi cluster

Raspberry Pi Dramble - cluster of Raspberry Pi computers

For the past few weeks, I've been building a cluster of six Raspberry Pis to test and demonstrate Ansible playbooks for Drupal deployment at upcoming events (like MidCamp and DrupalCon LA).

I added an RGB LED to each of the Raspberry Pis that can be controlled via software (for example, here's a Python script to turn on one individual color on the LED), and as part of the demonstration, I'm using the LEDs to indicate which server Ansible is currently working with.