Build your derby!
UPDATE: After some discussion with @deviantollam we've decided to make Hack My Derby, Part of the Hack Your Derby contest! Check his Hack Your Derby site for more information.
We've been doing this for 3 years now, and we've got the concept of compute in a hat down. Feel free to use our formula to build a derby for DerbyCon!
To get you started, we're releasing a parts list, and some information on how to assemble things.
- A Derby
- A Raspberry Pi Zero W
- A MicroSD card (we recommend a minimum of 16gb, though, we're testing on a 32)
- A Winstar weh001602 series 16x2 oled. You can get them at Adafruit, or Other locations
- A USB battery pack
- A battery Controller
- A small internal battery
The required parts will get you a basic contestant. Get that Pi and Screen mounted in the derby! Rig up the USB power, wire the display according to the table below. We'll be providing a custom built raspbian image pre-built to get you started. The display functionality will be built in to that image.
The optional parts will let you add something like UPS to your contestant. In the 2016 model, I was able to attain pretty close to 99% uptime during DerbyCon because the USB battery pack was powering a smaller battery inside the derby. When the USB pack died, I swapped it out. No downtime!
Client install Instructions
Download this custom built Raspbian Image.
I plan to make a video detailing this, but it's not here yet
- Download the image, linked above
- Decompress the image, and write it to your SD Card
- Pop the sdcard into your derby
That gets your OS installed, now we have a config step or two. The image we provide is configured to set your Pi up in USB Gadget Mode, and present an ethernet adapter. Thats how you'll configure it. Here's how that works.
- Connect your Pi to your computer using a USB A to Micro-A cable. The same sort of cable you might use for your Cell phone. I've found that this requires a good quality cable. Cheaper cables that might be good for power, aren't great for data. Some cables provided with phones werent even up to the task. If it seems flaky, try a better cable. Connect the Data micro-usb port on you pi-zero to a USB port on your computer. This is the port on the pi you'd normally conenct a USB hub, or external devices to NOT the power plug.
- A few seconds later, your computer should recognise a USB Ethernet adapter (presented by the Pi). You'll need to configure this adapter with the static IP information that follows. Yes we realize there are better ways to handle this dynaically, we ran out of time. IP: 192.168.7.1/24 (thats a 255.255.255.0 mask for you non-network folks).
- Once the Pi boots up, your screen should come on, and display a message about client info being missing. That's good! it means you're almost ready to go. Just keep in mind that the bootup process could actually take a few minutes, before the display shows anything. Now you'll need an SSH client, if you're on a mac or linux system you're already covered, as OpenSSH is included, if you're on windows, you'll need to find an ssh terminal. PuTTY is simple, self contained, and easy to use.
- SSH to 192.168.7.2, the user is pi, the password is HMD2017. This password can (and should) be changed once you're logged in.
- Once you're conneted, the MOTD should tell you what to do next. It boils down to this: run the command "larva-init.py". It will ask you a question or two to get you up and running. WARNING running larva-init will erase any client data on your derby. It's meant to be run once, if you need to reset your derby for some reason, re recommend re-imaging it. Again, we're out of time
- Once this completes, your derby will go into a special mode, where its purpose in life is to find a master, and register. You can shut down the Pi, and get it connected to whatever power source you intend to run it on during the conference. Unless there's a problem, you shouldn't need to connect to it over ssh again. If you want to do any hardening of the system, you're welcome to.
If you're planning on taking any steps to harden your system, keep the following in mind:
- The system depends on its ability to run docker, don't do anything that prevents this from working
- Much automation runs as the pi user, don't delete him unless you want to delve into moving that automation to a diffeent user
- SSH should already be locked down to only that management IP above, but you're welcome to firewall it. If you do decide to add a firewall (there isnt one out of the box) iptables should be at your disposal. Do not block ports 5000-5050 as they are the ports we're exposing containers on
- Other contestants depend on connecting to your derby's AP to interact, hostapd needs to be running, and it will be out of the box
- This AP also depends on DHCP, your derby runs DHCP, dont stop it or block it
These OLED disaplays can get into an odd state sometimes. If you see garbage on the display, you can _usually_ resolve it by shutting the whole system down, removing the power, and letting it sit for a few minutes. We've had pretty good luck with the display. The person testing for us however, had some issues. We're hoping they're isolated.