free web stats
Menu
How To Build A Raspberry Pi Zero PirateBox

How To Build A Raspberry Pi Zero PirateBox

The Raspberry Pi Zero is a very small, fully functional computer that fits into the palm of your hand... literally. Due to it's small size, and 12 hour run time on a 4000mAh battery pack, it's ideal for use as a Piratebox.

The darn thing is only 2.55" (65mm) x 1.18" (30mm) x 0.2" (5mm) and fits easily into an Altoids tin.

Over the past couple nights, I've turned the Raspberry Pi Zero into a very small Piratebox that boots up in about 15 seconds and provides an Ad Hoc (computer to computer) Wi-Fi network. The Pirate box offers chat functionality, file upload/download and 4Chan style forum, all done off-internet.

Since laptops and mobile devices connect to the Raspberry Pi Zero's ad-hoc network that's offline, and since neither the software or hardware tracks the devices that connect to it, the Piratebox is perfect for reasonably anonymous use by anyone within Wi-Fi range.

piratebox raspberry pi zero"PirateBox creates offline wireless networks designed for anonymous file sharing, chatting, message boarding, and media streaming. You can think of it as your very own portable offline Internet in a box!" - via Piratebox.cc

While anonymity isn't a concern for my purposes, I did find the piratebox a convenient solution to stream videos and music to other devices when out of Wi-Fi network, but my intent goes deeper as I'll expand upon below.

Because it also is a DHCP server, the Raspberry Pi Zero Piratebox works perfectly as a wi-fi hub for low-resource LAN games such as Minecraft where one of the computers is also running the Minecraft server (does anyone play Minecraft anymore?).

Right now, in our house there is one main Wi-Fi network that all our connected devices can reach the internet through. The purpose of the Piratebox is to create a subnetwork of offline devices, mostly consisting of Raspberry Pi's that are connected to our TV or sound systems where a single library of media can be accessed.

Besides for operating as a DHCP server, the Raspberry Pi Zero Piratebox is perfect for sharing digital files and media offline or chatting in an off network environment.

The Piratebox has a web interface that is accessed by any device that is connected to the Piratebox network via Ad Hoc Wi-Fi. This is an isolated network, and it cannot be accessed from the internet, making it perfect for wireless dead drops.

Here's How To Create Your Own Raspberry Pi Zero Piratebox

What You Need:

  • 1x Raspberry Pi Zero
  • 1x USB to MicroUSB OTG plug
  • 1x USB Wi-Fi Adapter
  • 1x 8GB or higher class 10 MicroSD card
  • Source of Power (2.1A minimum - Battery Pack, Wall Charger, Car Charger)
  • USB to MicroUSB charge / data cable

If you use an Android phone, you can easily use a 2.1 amp charger and it's charging cable for consistent power.

In the picture above, the Raspberry Pi Zero is enclosed in an Adafruit case as I wanted an additional layer of protection for the circuit board since this Piratebox will be in my backpack full time.

Let's talk storage.

The Raspberry Pi Zero doesn't have a hard drive. The operating system resides on a microSD card that is inserted into a slot on the bottom of the Zero.

While the Piratebox operating system can fit onto a 4GB card, if you want to have any real space for file uploads and storage, you'd better get something with extra space. I am using a 64GB Class-10 MicroSD card in my Raspberry Pi Zero.

The Raspberry Pi Zero has only one USB port. Since your Wi-Fi Adapter will need to use that USB port, you have two choices:

  1. All the storage space has to reside on the microSD card
  2. You need to get a powered USB hub and use a USB Drive for storage

The latter requires a second power supply and is not as portable as I want, so I am limited to the space on the card as storage. The Raspberry Pi, underneath it all, is a computer. It has been verified that certain 128GB MicroSD cards work, but there are reports that even 512GB cards can run the Operating System of choice for your Pi Zero.

Keep in mind that you want to have very fast read/write speeds. 40x or higher is sufficent, but if you're overclocking the pi (which can be done throught raspi-config configurations), then you should probably look into the extreme speed cards.

First things first: Where To Buy The Raspberry Pi Zero

Getting the Pi Zero can be tough. Since it only costs $5, when they're in stock, they go quick! Microcenter, Pimaroni and Adafruit carry the Zeros, but keep checking back if they're out, which they frequently are (at the time of this writing).

As I have said, the Pi Zero itself is only $5, but if you tack on shipping, expect to pay as much, if not a little more for that. 

Next: Make Sure To Buy The OTG adapter and Wi-Fi Adapter

I got both from Amazon in a single order. The OTG adapters came from China and took two weeks, but the price was right. The ones I got were $5.99 for a 5 pack (these things break easily). Product Listing via Amazon

I picked up some really cheap 802.11N WI-Fi adapters for $1.99 each on Amazon. They aren't the fastest or have the longest range, but they work for my purposes. These adapters have a range of about 30 feet indoors and about 150 feet outdoors with no obstructions.

I also have tested the Piratebox with a High-Gain Antenna ($12 on Amazon) that provides about 60 feet indoors and over 100 yards outdoors with no issues.

Depending on your needs, don't skimp on the Wi-Fi adapter. Cheap ones work OK for a small local network, but if you wanted to place the piratebox somewhere like a dead drop for public access, then you'll probably want to get something that has some range.

Installing Piratebox on the microSD Card

You will need a bittorrent client (Transmission or Deluge perhaps) to download the latest version of the OS. Make sure to get the one specifically built for the Raspberry Pi Zero (it's the first torrent link). Cut and paste the torrent link into your bittorrent downloader to get the file needed. 

Next, extract the piratebox_rpi*.zip file and follow the standard Raspberry Pi SD Card Setup procedures (OS X instructions) (Windows instructions) (Linux instructions) to install the image to your SD card.

Once the microSD card is done with the OS Installation, place the card into the Pi Zero (try to keep your hands that are shaking with excitement steady here ;D ), attach the OTG adapter and Wi-Fi and finally the power cable.

Wait until you see the "Piratebox - Share Freely" Wi-Fi network show up on your laptop or computer. This can take 2-3 minutes on first boot, but I've found that after the initial setup, it usually is up and running within 15 to 20 seconds.

Connect to the network. Keep in mind that since this is an offline, Ad Hoc network, you will not be able to access the internet or any internet dependent resource on your computer until you leave the Piratebox Wi-Fi.

While the Piratebox will work right out of the box at this point, there are additional configurations that should be completed before letting the whole coffeehouse know they can share files on your private network.

You'll find the complete instructions for the advanced configurations over on the main Raspberry Pi Piratebox page.

Once the Piratebox is setup the way you like it, it's ready to go on the road with you.

Over the past couple days, I've used mine to store music mainly. There are also several commonly used images that I use for blogging on the Piratebox, but since anyone within 100 feet could potentially connect to my piratebox while its running, I don't put ANY sensitive files or images that would give away my identity on the public side of the box. You could place sensitive files in a non publicly accessible part of the Piratebox, but why do that at all? That's what encrypted USB sticks are for, right?

When the Piratebox was originally created, it was designed to be an anonymous wi-fi dead drop. My uses are a bit out of the box, and the same thing could be accomplished in less cumbersome means.

Regardless, how cool is it to have a Piratebox? I wanted to build one as a small project, so it was fun and I found a real world purpose for it.

25-September-2016 UPDATE: The Piratebox also serves another function. Over the weekend, we took a road trip. I connected the kid's tablets to the Piratebox Wi-Fi network, and even though the network itself was not connected to the internet, the kids were able to play MinecraftPE in network mode. My oldest son started up the game and created the world, and the others then found the world in the "Friends" tab and were able to join that world. The reason that this works is that MincraftPE doesn't need internet to run. It does need a network in order for others to join, so that was the function of the piratebox this weekend.

back to top