Cloud is expensive

To keep the costs low, my development or pre-prod setup, if we're speaking fancy, is using LAN computers. They work just fine and have been very reliable. A couple are quite beefy old low-medium end gaming machines, but most are very low-power dual-use Raspberry Pis (also for PiHole or music playback) or more modern tiny boxes.

By now, over a few years of tinkering, I've saved according to my ultra approximate calculations well over 500 euros that would have otherwise travelled into the pockets of Amazon & associates. Now only part of it travelled into the pockets of local electricity company, but I consider the larger server as heaters in the winter too, so it's not really that bad.

Overall I like my setup, although there are obvious glitches now and then where I'm trading time for money.

What are the most curious issues?

One fun issue is that quite a few of the low-end boxes or former desktop computers I have use some variation of RTL8821cu or similar chip. And oooooh does that not like to work properly with any Linux that I know of.

Problem 1 - it just won't work and needs a special driver

There are multiple custom drivers available and ONE of them usually works. Which one seems to be a matter of luck, but it is never the first one I try. If it's a really bad case, the driver works until the next OS update and then stops working. Sometimes until forcing a modprobe reload (no, a reboot won't do), but just as often fails permanently.

On a positive side, if it just won't work, it's a great reason to try out more Linux distributions. Sometimes luck smiles upon me and another distribution just works!

Problem 2 - it works, but... latency is insane for WiFi

My WiFi router is an Archer C7. Nothing super special, but a decent one. I have never had it die on me and from my laptop to the router the ping tends to be ~3.5ms or ~1.5ms, if I spin around with my laptop. I don't know why that makes the latency go down, but maybe it's something of interest to WiFi chip makers. More likely just some odd coincidence in the ether.

However, my most powerful computer with a ton of space that I use for local Docker Registry and NPM registry and some unsavoury experiments that require an old 2GB NVidia GPU that would probably cost 5000 dollars now with the AI fad and adjusting for inflation, had a latency between 450-1500ms. Yes...

Since that means exciting minutes of running npm install or docker push, it just couldn't stand. Also something had made me install the development database there (more like pre-prod), which is how I first noticed the latency. Requests that took 15ms on localhost started taking 1.5 seconds and that certainly wasn't the fault of Postgres.

The host was running Ubuntu 24.04 and it was otherwise fine, so after a bit of exploration it turned out that it's probably an issue with WiFi chip power management as it so often tends to be the case.

To turn it off, one can run

iwconfig <whatever your wifi device id is> power off

And that worked just fine until the next restart. Back in the day you could change the setting in /etc/NetworkManager/conf.d/some.conf, BUT THAT DOES NOT EXIST ANYMORE in Ubuntu 24.04! Because it was too old and not good enough!

The netplan declarative configuration system, that Ubuntu has moved to, does not seem to offer this option for configuration. That left only one option... The one that almost always works when something needs to be forced.

[Unit]
Description=Disables wifi power management to make the darn thing actually work
Requires=network-online.target
After=network-online.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=iwconfig <whatever your wifi device id is> power off

[Install]
WantedBy=multi-user.target

And now it works. I think...

Problem 3 - not wifi, but power

Since I live in the middle of nowhere, occasionally the power gets grumpy for no particular reason and I don't have a UPS. So, sometimes I need to go and press the power button of non-self-restarting machines. That excludes the Raspberry Pis and the larger machines with greater power supplies that seem to ignore the smaller power cuts.

Should I get a UPS? Probably. However, I view my electricity company a type of chaos monkey. It means I don't need to code one to have an occasional reliability test. All for free. Thank you electricity supply people!

Problem 4 - USB dongle will fail if it moves even a little

Yup... This one is one of the more annoying problems. The USB dongle sometimes shifts on its own. Maybe a spider climbs on it or something else, but it will fail to talk to the PC after that. A reboot won't help, only wiggling the USB dongle a bit makes it work.

Without this issue, all other problems are predictable. This one is unpleasant as it's always ambiguous whether the problem is with the dongle connection or something with the drivers, updates or wifi power failure.

In conclusion

I enjoy poking around weird technical issues, but I guess I'm getting old. I have run into issues with the RTL8821 chip & friends so many times now... Unfortunately a previously encountered solution never seems to work, so I cannot automate the problems away. Maybe one day I'll look into the drivers, but it's a rather different bit of code from my usual. Complicated too. I'm amazed by people who write the drivers as a hobby. They rock in the best sense of the word.

Considering it's pretty much the only chip that I've had problems with on Linux (and on Windows), I suspect there must be something very special about that chip. I'd avoid it, but half the time it's not even clear which WiFi chip is in the device when buying. Alas, no great conclusion on what to do on the cheap. Just a summary of my struggles and setup.

  • Heidi (Founder)