For the Raspberry Pi cluster I wanted to make sure that they are neatly stored to keep them easy to reach.
Why nicely storing them is important
Each Raspberry Pi requires a power and network cable. When using a single raspberry pi the cables are not an issue but I am planning to use five as a baseline for my cluster. These cables can quickly start to become messy and make the cluster hard to reach.
Stacking the Raspberry Pi’s
Therefore I have selected a solution that would allow me to stack the Raspberry Pi’s on top of each other.
This case allows excess heat to be vented through the sides which many case designs do not account for. Since I plan to be using the Pi’s extensively they will likely be running quite hot.
I plan to stack six raspberry Pi’s on top of each other so I have purchased three of these (two stacked) products.
If when running vcgencmd on a raspberry pi you get VCHI initialization failed then you need to add the video group to your user. The vcgencmd tool requires you have this group role so without it, it will give VCHI initialization failed.
To add the user group to your user you can run:
sudo usermod -aG video <username>
Where <username> is the user you want to run the vcgencmd command with. This command adds the video group to the the user you specify.
Once you have ran the command any new logins will run the command successfully. Logging out and back into the pi will let you use the command.
Why this problem occurs
This issue happens when you try and use the vcgencmd command with a user that isn’t a member of the video group. This typically happens when you create a new user for the raspberry pi and don’t give it the same groups that the pi user has.
The solution above fixes this by adding the correct video group to the created user.
Today’s blog marks the official start of my Raspberry Pi cluster project. Here I will be documenting the process of assembling, building, and running a small cluster. This blog will include both code snippets, hardware diagrams and the results of various projects using the cluster.
Aims of the project
The Raspberry Pi cluster will be looking into distributed computing from both a hardware and software perspective. Some of the smaller projects planned include:
Youtube playlist syncing and download
Dynamic task management and distribution
MD5 hash calculators
Realtime Reddit thread analysis
But why a Raspberry Pi when it lacks power/ram/etc
Many of the tasks I am planning for the raspberry pi can be run faster and more easily on a single computer. My (5 year old) laptop will have more RAM and processing power than the initial cluster. If I was going for pure power I would run these tasks on a GPU. However the cluster is to experiment with the process of writing and working with a distributed environment.
Part of the reason why I have chosen a raspberry pi is that it is readily available, relatively cheap, and there is a lot of support for it to run Linux. I am planning on running Raspbian Jessie PIXEL to begin with with the possibility of switching to full on Debian or Fedora later.
First steps to a Raspberry Pi Cluster
Already I have one Raspberry Pi 1 Model B Rev 2 which I am going to start developing software for while I collect the other parts. During this time I will search around for a number of raspberry Pi’s. My preference will be for the older versions so that I may purchase more of them cheaply.
Powering them is going to be an investigative point as I dont want to power them using multiple Raspberry Pi cables as these are costly in larger numbers and will occupy lots of power sockets.
As I am expecting to buy a couple different Raspberry Pi versions I am going to look for Micro SD cards which come with adapters. This is because Raspberry Pi 1 B models take a SD card and later models take a Micro SD card.
A IRC client lets you connect to a IRC server enabling you to join chatrooms on that server. IRC servers do not by default store logs while you are not logged in. This can be annoying if you wish to keep informed of whats going in on the chatroom.
One solution to this is to never log out of the chat room. However this relies on constant access to the internet. Since I have a laptop this isnt feasible.
irssi and screen to the rescue
The solution for me was to install irssi on my raspberry pi and use that. irssi is a command line IRC client which means i can access it over SSH. This also means I can run it all the time on my raspberry pi and connect to it from wherever I am.
However, when you exit a ssh session it normally kills all the processes you are running, which means that irssi would stop.
To solve this, you can use a program called screen. This starts a new “screen” which can be detached and it will continue running even if you exit the ssh connection. This means you can run irssi all the time even when you are not connected.
On a raspberry pi (or any Debian type system) screen and irssi can be installed with the following command
sudo apt-get install screen irssi
Screen is relatively easy to use, to launch an instance you run “screen”. When you run screen you send commands to it by using ctrl-a and then pressing a third key. You can use screen like any terminal.
To disconnect from screen and keep it running in the background press ctrl-a d. To resume this you can type screen -r then press tab to get a list of all current screen sessions. Typing in the correct one will let you resume. Here screen will be used to keep irssi open when I disconnect from SSH.
When both have been installed you can run screen and then irssi from inside your new screen instance. Once irssi has been launched you can use it to join your IRC server. For full details of how to use irssi view the irssi website.
During Christmas I got a raspberry pi and I have been waiting to start playing around with it for ages. Finally I decided to order the remaining pieces for it such as the power cable and SD card.
Since I didn’t have a HDMI TV around I decided to plug it into the router and see if it worked, luckily the latest version of the OS has DHCP and ssh enabled by default, which meant I didn’t even need to plug it into a screen to start using it.
I plan on looking at installing apache and icinga onto it to play around with and probably will run an instance of irssi as well.
The first things I installed were git and vim. Vim is very useful when there is no full UI because of its many features and excellent code highlighting, I plan to use git to centralise some of my code that I plan to run on the pi.