The Raspberry Pi has become the darling child of computer hobbyists everywhere. With prices ranging from $20-35, it’s hard to resist purchasing one and taking it for a spin.
Designed as a teaching aid for Computer Science courses, this computer — no bigger than a playing card — has many other applications. Media server, web server, Ethernet shield — if your computer could do something eight years ago odds are this machine can do it too. The Model B version has two USB ports, HDMI, component, and an audio out port, as well as an SD card slot and an Ethernet jack. It has 256 MB of RAM, which is more than enough to run headless software.
I thought it might be fun to put a few Pi’s together and and try to create a mesh network that can be rapidly deployed and powered by battery. The following posts will be a build log of my experience; my instructions are not intended for the beginner, but should provide enough detail for an experienced linux user to get a mesh network up and running.
You need more than just a board to create a mesh network. I also purchased:
After some Googling around I found a few potential candidates for the software. There weren’t any clear build instructions for computers, but there were several options for wireless routers. I opted to go with the Pi instead because it would have more power and flexibility for future projects. Here is some of the software I will be experimenting with:
- BATMAN ADV
- Project Byzantium (This project looked most promising — especially the fact that you can connect to the mesh network and connect to the same node using a single wifi card. However, the list of software they use and their configurations are not readily available.)
- CoovaChilli (DNS Redirect to capture traffic and drive it to an internal website.)
There have been some issues reported regarding the power output of the Pi USB ports, so I wasn’t sure if I would be able to make a quick and dirty mobile mesh network in the first place. But before I could find out, I had to install an operating system on the board. I chose Arch Linux because it was easy to configure and contained a minimal amount of software packages.
Fortunately, the stock Arch image was very easy to setup, and comes with sshd running. Here are the steps to get the base system running; it is not yet clear how the shift to systemd will work on ARM architecture:
- Install the Arch Image to the Pi SD Card:
# dd bs=1M if=img of=dev
- Grow the partition to use the entire SD card using Gparted or a similar tool.
- Boot up the system, and ssh in. Run
# pacman -Syuand update pacman.
- Because you are ssh’ing in, you need to generate entropy when you create the pacman PGP key. Install haveged, and generate the key:
# pacman -S haveged && haveged -w 1024 && pacman-key --init && pkill haveged && pacman -Rs haveged
- Install some useful packages:
# pacman -S dialog wireless_tools netcfgNOTE: You may need to reboot in order for the usb wifi dongle to show up in iwconfig.
- Edit rc.conf to your liking:
# nano /etc/rc.conf
- If you wish to setup a web server on the Pi, follow the instructions here.
The first steps were quite successful; I got a full web server up and running with mysqld in under 80MB RAM and a rootfs under 800 MB. What is more, the wifi dongle was recognized out of the box, and was fully powered by the board! In my next post, I will begin installing mesh networking software onto the Pi, and post my build instructions and configurations.