-
1Step 1
8 SLOT BRAMBLE
For the 8 Slot STL, use your favorite slicer to create the files to print.
If you look within Sketchup, the 4 objects closest to the junction of the XYZ axes are all you have to print. The ones obviously for the Pi Zeros (Leaf and Cap) just get printed 8 times. The other two (rails and sides) get printed 2 times. There shouldn't be a lot of cleanup except for removing the brim after the print.
Glue up the mating blocks with super glue, so that the rails are top and bottom and use some blocks and weights to keep them lined up while the glue sets.
A Raspberry Pi Zero will JUST fit inside the fence of the Leaf and the slotted cap is a tight press-fit. It ain't coming out.
-
2Step 2
MODULAR BRAMBLE
The corner pieces are the ones with the one taller wall and the corner slot. Print those twice. They can flip 180 degrees to be top and bottom corners. They are very tight in the slot and are ideal as walls when you fit a leaf in them: if a leaf is to be a wall and a compute module, you will need to cut into the corner wall where the WIFI dongle would go or solder a usb - ethernet module). The dovetails WILL require cleanup, but will eventually slot into each other. I designed the dovetails so there is only one way to connect.
The rails for the middle Zeros are designed to simply print twice for top and bottom.
-
3Step 3
Install a known working wifi dongle by sticking in a USB OTG converter into the plug-in of the dongle.
Slot in an SD card that has been loaded with a Raspberry Pi (not Pi 2!) image that has SSH server available. Power up the Zero and run a scan on your network to find the new computer.
SSH into the computer and start configuring for clustered computing.
-
4Step 4
Once you have a Case you are happy with, build a cluster image for your Pi Zeros. If you follow the Instructable that Gigafide put together recently, you will be okay. Here is a line-by-line rundown to get the common image (before you have to go between node and head)
Install Jessie via NOOBS (you can get this from raspberrypi.org)
Install all extra packages needed for clustering and SSH, by using the following:
sudo raspi-config
Install image onto at LEAST a 4 GB sd card. For my setup, I will be using a 32GB card for the data, and 16GB cards for the head and nodes (leafs)
Hostnames will be:
rpi0
rpi1
rpi2
IP addresses in this case are 192.168.1.50[51 & 52]
For now, I will be using my home router, and later on will have a different subnet from my home subnet. I will be configuring the head to allow users from within my home network to connect to the head.
--------------------
INSTALL MPICH MASTER
--------------------
sudo apt-get update && sudo apt-get upgrade
mkdir mpich2
cd ~/mpich2
wget http://www.mpich.org/static/downloads/3.1/mpich-3.1.tar.gz
tar xfz mpich-3.1.tar.gz
sudo adduser mpi_user
sudo mkdir /home/mpi_user/mpi-install
sudo mkdir /home/mpi_user/mpi-build
cd /home/mpi_user/mpi-build
sudo apt-get install gfortran
sudo /home/mpi_user/mpich2/mpich-3.1/configure -prefix=/home/mpi_user/mpi-install
sudo make
sudo make install
-----------------
SETUP ENVIRONMENT
-----------------
nano ~/.bashrc
PATH=$PATH:/home/mpi_user/mpi-install/bin
sudo reboot
mpiexec -n 1 hostname
The above should return the hostname value of the head node.
-------------------------------
SETUP PYTHON TO MPI INTERPRETER
-------------------------------
sudo aptitude install python-dev
wget https://mpi4py.googlecode.com/files/mpi4py-1.3.1.tar.gz
/* YOU WILL GET SOME WARNINGS HERE */
tar -zxf mpi4py-1.3.1.tar.gz
cd mpi4py-1.3.1
sudo python setup.py build
sudo python setup.py install
export PYTHONPATH=/home/mpi_user/mpi4py-1.3.1
mpiexec -n 5 python demo/helloworld.py
since you're here now, you may as well create a file in the mpi_user home called machinefile. Populate it like this:
rpi0
rpi1
rpi2
At this point, you will be ready to create a common image. Now, here I disagree with the author, because he would have already expanded the filesystem in one of the first steps. I say, use a 4 GB SD card to make the minimal image, then copy, THEN expand the filesystem.
-
5Step 5
Follow the instructions on this link to get both the wired and wireless interfaces to work at the same time. I never knew that plugging in one would disable the other...
First, backup your network settings:
for i in `/etc/network/interfaces /etc/wpa*/wpa*`;do cp $i > $i.orig;done
Basically, edit your /etc/network/interfaces file to look like this:
source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
auto eth0
#iface eth0 inet manual
iface eth0 inet static
address 192.168.1.50
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
IF YOU'RE USING WIFI USE THE BELOW EXAMPLE
source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet manual
allow-hotplug wlan0
#iface wlan0 inet manual
iface wlan0 inet static
address 192.168.1.52
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
-------------------------------------------
And your /etc/wpa_supplicant/wpa_supplicant.conf, like this...
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="YOUR_ESSID"
psk="YOUR_NETWORK_PASSWORD"
}
-----------------------------------------------------
edit your /etc/hosts file
127.0.0.1 localhost
192.168.1.50 rpi0
192.168.1.51 rpi1
192.168.1.52 rpi2
-
6Step 6
Once you have your basic networking setup and checked out, it's time to move on the the meat and potatoes of this whole operation: SSH key-sharing. I'll warn you ahead of time; if you finish and during testing you get a key verification failure, you made a mistake during the key-share process.
MASTER NODE
log in as mpi_user
cd ~
ssh-keygen (take the defaults)
cd .ssh
cp *.pub $HOSTNAME
ssh mpi_user@192.168.1.51
ssh-keygen
cd .ssh
cp *.pub $HOSTNAME
scp 192.168.1.50:/hpme/mpi_user/.ssh/rpi0 .
cat rpi0 >> authorized_keys
exit
ssh mpi_user@192.168.1.52
ssh-keygen
cd .ssh
cp *.pub $HOSTNAME
scp 192.168.1.50:/hpme/mpi_user/.ssh/rpi0 .
cat rpi0 >> authorized_keys
exit
scp 192.168.1.51:/home/mpi_user/.ssh/rpi1 .
scp 192.168.1.52:/home/mpi_user/.ssh/rpi2 .
for i in "rpi1 rpi2";do cat $i >> authorized_keys;done
I didn't script the last 2 scp commands because if this is a brand new build, you will get prompted for passwords, and answer a request to transfer keys (haven't figured that part out why yet).
Given enough time, I will script this whole thing out for minimal hands-on, but for the purpose of this project, this works.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.