Just before Christmas, I purchased my first Raspberry Pi. I say first, because I do plan on getting a couple more, but that will have to wait as funds are being directed to a more important project, my wedding. But this will be the first in a series of articles about some of the projects I will be doing with my Raspberry Pi.
Photo Rich Lawrence
This time out I was torn on what I wanted to do between a telnet BBS or a Pirate Box. After a long debate, the Piratebox won and I set off on gathering what I needed. For those not sure what a Piratebox is, it’s a self contained file server that has no connection to the Internet. So when you connect to it, all requests are redirected to the box itself, which has a web interface using lighthttpd web server. You can upload and download files to and from it using a simple interface. But that interface is a basic one, and I think it can be improved on. I’ll cover that later. These settings also setup the device for WiFi access, which is the original design of the box, but you can also made some mods to make it workable over a wired network connection.
But before I could do anything I had to know how to set it up and a lot of what I was finding was for building it into a router, like a Linksys. I finally found a wiki that had the basics for an Rπ Pirate box, so I grabbed them and I set off!
I had already installed Raspbian-Wheezy on a 16gb SD card, so the Rπ was ready to go. Once I had it booting successfully, which is easy to do if you follow the instructions, I went to the wiki I found, and began using apt-get to install all the needed files.
- # sudo apt-get update
- # sudo apt-get -y install lighttpd
- # sudo /etc/init.d/lighttpd stop
- # sudo update-rc.d lighttpd remove
- # sudo apt-get -y install dnsmasq
- # sudo /etc/init.d/dnsmasq stop
- # sudo update-rc.d dnsmasq remove
- # sudo apt-get -y install hostapd
- # sudo /etc/init.d/hostapd stop
- # sudo update-rc.d hostapd remove
- # sudo apt-get -y install iw
- # sudo rm /bin/sh
- # sudo ln /bin/bash /bin/sh
- # sudo chmod a+rw /bin/sh
Those files install the services that are required for the basic functions of the Pirate Box. Once those files are installed, I then grabbed the Piratebox config files, and moved them into place.
- # wget https://github.com/downloads/MaStr/PirateBoxScripts_Webserver/piratebox-ws_0.3.1.tar.gz
- # tar xzf piratebox-ws_0.3.1.tar.gz
- # cd piratebox
- # sudo mkdir -p /opt
- # sudo cp -rv piratebox /opt
- # cd /opt/piratebox
- # sed ‘s:DROOPY_USE_USER=”yes”:DROOPY_USE_USER=”no”:’ -i /opt/piratebox/conf/piratebox.conf
- # sudo ln /opt/piratebox/init.d/piratebox /etc/init.d/piratebox
- # sudo update-rc.d piratebox defaults
- # sudo /etc/init.d/piratebox start
- # sudo touch /opt/piratebox/conf/init_done
Now, the last file, the init_done file seemed to cause the box to not start the services properly. So I removed it after I created it, when I forgot to do it the first time. Pirate Box didn’t create the file itself, so I’m not exactly sure what that files does. But while troubleshooting some wifi issues, I discovered it helps the start up script get everything running.
Screen Grab from PirateBox
After those preceding steps, plug in a wifi USB dongle and reboot. The Pirate Box will start right up and be ready for a connection. To connect, just go into your WiFi connection manager and find pirate box in the list and connect. From here you ‘ll be able to upload files, chat in the shoutbox, as well as see what files others have uploaded already. Since mine has yet to be deployed, there is only the files I have put on it. If you find you’re having issues connecting, make sure to check and see if the wifi dongle you are using is compatible and if it needs a powered hub to work properly. Remember, the Raspberry Pi is a low power device, and some devices may make a bigger demand for power then what the USB ports on the Pi can give. But essentially, check the Piratebox forum for troubleshooting info. It’s a great resource. There is also a chat room on Freenode, #piratebox, that you can go to for unofficial support.
Once you have yours up and going, the next step is to get it out there for folks to try. Some people are hooking batteries to them so they can run without having to plug into an outlet. This makes it much easier to keep it out of sight while still allowing it to do it’s job. Take it to a coffee shop, or a library. Any where there is a lot of people. You may even be able to hide it somewhere for a short while and then come back a few hours later or even a day or so later to retrieve it and see what was uploaded. The trick would be letting people know it’s out there. Maybe a twitter account that tweets a general area for people to look for it? Or maybe throw up a few stickers in an area you are going to deploy it, kind of in the same thinking as war chalking. Some other tips would be to find a case or something to put it into to keep it safe. All it’ll take is one person to drop it from a desk or shelf and you’re out $35 for a new Pi. And also, plan out your steps for doing this project. Don’t go off the cuff like I did, because it’ll save you a bunch of time.
As I try some new things, I’ll also post updates to this series, as I would like to get some input for readers on their build and what they have done to mod it or getting it out there. Remember: “Sharing is Caring. Not Illegal”