Saturday, November 21, 2026

Lifeline: ensuring reliable uplink through mulitiple Wi-Fi connections

I have a collection of devices on an ethernet network where the uplink is through WiFi. Some devices are laptops with both an ethernet controller and WiFi, and connect to the internet though Wi-Fi.  A few others are ethernet-only Raspberry Pi machines.  I want to have the laptops connect via Wi-Fi, and advertise an uplink for any ethernet-only devices.

If you have a single laptop, this is trivial to do, you set up a DHCP server, and accept traffic on ethernet from the Pis.  However, I have more than one laptop, and want to handle the loss of a single laptop, as other laptops are likely connected through WiFi and should route the packets instead.

For a while I managed this through a set of hacky shell scripts. Recently, I rewrote this in Python, so it works on all architectures and is more reliable.  The resulting system is called 'lifeline', as it provides a very reliable uplink for Ethernet-only machines.

The software works by first waiting for the Wifi device to connect. If it has a reliable Wi-Fi uplink, it checks over ethernet to see if any DHCP server is active. If so, it sets itself up as a secondary DHCP server, routinely polling to see if the primary server is down.  If the primary server goes down, a single secondary takes over, providing reliable uplink to the ethernet-only devices.  As a bonus, if you have flaky old Wifi adapters, running lifeline on it will ensure that the Wifi+ethernet device stays online as far as at least one functioning Wifi uplink exists,  This resilience allows you to ssh into the buggy machine to fix it.

It's a simple project, but quite useful to me. It has been running for a while and I would consider it reliable enough for broader usage. It is designed for Ubuntu 26.04 and up devices.  It handles tunneled traffic (like VMWare or Tailscale), and provides X11 indicator messages on state changes.  It works alongside systemd, NetworkManager and dnsmasq, and has a clean status message through 'lifelinectl status'.  There are man pages as well, and a lot of comments in the config files and the Python source. There are packaging scripts to create a self contained .deb for distribution.  This software can work on Arch, Nix, and other distributions with little effort.  The ethernet-only devices don't need this software, as they'll just request network configuration on DHCP, so they can be any machine, including Mac and Windows.

Released under GPLv3, improvements are welcome.




Sunday, October 18, 2026

I created an SDK for the Anbernic RG DS Plus

Computing hardware has come a long way.  With the rise of ARM-based SoC chips like Rockchip, you can now purchase a fully functional computer with a screen, a battery, basic gaming controls (dpad, A/B/X/Y, shoulder+trigger) for under $100.

It's even more incredible that all of these run Linux out of the box.  In 2026, Linux support for devices has changed completely.  Decades ago, you'd have to jailbreak a device, put effort into understanding the system, download some proprietary compiler toolchain, reverse-engineer an sdk, and then painfully write programs by hand. Nowadays, these systems run Linux natively.  The system image can be mounted on a Linux desktop, and you can modify files directly on the system image. You have root on the machine, you can do whatever is interesting to you. Since it runs linux, standard libraries will work on it, you can cross-compile tools and utilities, and the usual knowledge of programming from Linux carries over.

 These are originally meant to run retro games, and they work great for that purpose. When you look under the hood, you realize these are amazingly versatile devices.


One of the popular devices this year is the Anbernic RG DS Plus, which is a dual-screen device, which looks similar to the Nintendo DS.  This is meant to run Nintendo DS games, but it also is a fully functioning Linux machine with two screens that you can use to program your own games or utilities.  The RG DS+ has network, and supports USB host mode.  It has two SD card slots for storage, and a good selection of buttons, a single analog stick, and a touchscreen.

I've created an SDK for the Anbernic RG DS Plus, which can be used to create custom utilities.  It is programmed in C, using libX11 for drawing windows.  The lower screen is a 10-input multi-touch display, and one of the examples shows how to read all the 10 pointer values.  The other included example shows how to read all the buttons.  The SDK drives both displays and is well documented so you (or your LLM buddy) can write programs targetting this device.  The repository also has code for two utilities that I created for this device, a pomodoro-style timer for tracking focus at work, and a metronome for tracking focus off work.  The SDK works on the native system image for the RG DS+. The device is too new for custom firmware to be available, but should be very easy to modify the SDK if Knulli, or Rocknix support this device, as the hardware behavior stays the same.