In my quest to make use of all my single board computers, there was one project that just needed a bit of modernization. Back in 2014, I created a Quake 3 server using a BeagleBone Black (BBB). This little machine traveled with me for quite a while, but it was taking up extra space in my already stuffed backpack and so it got added to the pile of SBCs in my closet.
I began by making an rsync backup of the existing eMMC drive to another system. I then downloaded the latest Stretch IoT version and burned it to a micro SD card using Etcher. Then, I consulted a few different sources to get the new image flashed to the eMMC correctly. Contrary to the documentation, after following the flashing procedure and waiting a long time, my system had all four LEDs off. I left it untouched for a very long time in the hope that they would come on, but they never did. I didn't have much hope for success, but when I removed the SD card, and pushed the reset button it booted right up. I checked that I didn't still have the previous version, but this was definitely the latest.
cat /etc/debian_version 9.5
I skipped the usual boot-with-the-USB-plugged-into-a-computer-and-go-to-the-webpage procedure and just powered up the system and used SSH to connect. It took me a while to figure out the default username and password because there are different values documented. Turns out they were "debian" and "temppwd", respectively. I changed the debian user password, disabled root SSH logins, and created a new account for myself with sudo rights so I didn't have to use either default account.
Since the BBB is described as
a low-cost, community-supported development platform for developers and hobbyists. Boot Linux in under 10 seconds and get started on development in less than 5 minutes with just a single USB cable.
There are a lot of services enabled by default, and I need as much space as possible of the available 4GB eMMC for Quake 3. So, I disabled a bunch of services and removed a bunch of pre-installed packages and files:
sudo systemctl disable bonescript.socket sudo systemctl disable bonescript.service sudo systemctl stop bonescript.socket sudo systemctl stop bonescript.service sudo systemctl disable bonescript-autorun.service sudo systemctl stop bonescript-autorun.service sudo systemctl disable cloud9.service sudo systemctl stop cloud9.service sudo apt remove bone101 bonescript c9-core-installer doc-beaglebone-getting-started
Moved Apache back to port 80:
sudo vi /etc/apache2/ports.conf sudo vi /etc/apache2/sites-enabled/000-default.conf
Disable USB mounting and network:
sudo vi /etc/default/bb-boot (Uncomment the following) USB_IMAGE_FILE_DISABLED=yes USB_NETWORK_DISABLED=yes
Also gathering dust in my closet was a ChronoDot, which I bought years ago to give the BBB a real time clock that didn't reset to 1970 whenever the system was shutdown. I primarily followed directions in a post by Lemoneer to get the clock recognized and setup. There were a few differences between the article and the process I had to follow. First, I had to run i2cdetect on a different bus number:
i2cdetect -y -r 2
Then, I had to change the i2c devices echo similarly:
echo ds3231 0x68 > /sys/bus/i2c/devices/i2c-2/new_device
I also had to configure locale and add a timezone to get the clock offset correct:
ln -s /usr/share/zoneinfo/America/New_York localtime
Then, I had to solder the ChronoDot in to the case. I had done all the test wiring with a Beagle Bone Proto, but I didn't want to solder directly to the Proto in case I need it in the future. Also, the ChronoDot was too tall to fit in my case when it was sitting on top of the Proto cape. So, I just decided to mount the ChronoDot on top of the case and wire it directly to a few header pins so I could wire to pins 1,3 and 19,20 as pairs. I drilled a hole for each leg of the ChronoDot and soldered wires to the pins. I was having a hard time with getting wires soldered to the pins and found this excellent YouTube video with a technique I had not seen before. Now the BBB can be shut off and will have the correct time on restart.
The idea behind this server is that I can bring it anywhere I want to go, plug it in to an ethernet port, power it up, and play Quake 3. I have always been worried about disk corruption when I pull the power plug. The BBB has a power and reset button, but they are hidden inside the case. I noticed in the pin diagram that there is a power output at pin 9, and I had a push button switch in my pile. There were already a few holes in my case, what's one more? I wired up the shutdown switch and tested that it will stop and start the BBB. I like that it is recessed and you have to use a pen or similar to access it. I was concerned that it was just cutting power, but system logs indicate it is actually performing a clean shutdown:
root@beaglebone:~# last -x | grep shutdown ... shutdown system down 4.14.67-ti-r73 Mon Sep 17 17:15 - 19:00 (-6834+-21:-15) ...
Finally, I did the Quake 3 server installation, but there's already an blog entry about that.
Now, I'm back to a modernized, portable Quake 3 server with a couple extra bells and whistles. I can take with me when I want to play some Quake 3 with friends. This particular system does have one last wrinkle in my SBC project, though. I want to be able to mount all of these devices in a way that includes a power source, and now I need to add an network switch with ethernet ports to the installation.