PiHole with DNS-over-HTTP: Revised

More than a year later, the PiHole continues to work fine, but the process for installing the Cloudflare DoH machinery has evolved.

(And, yes, it’s supposed to be DNS-over-HTTPS. So it goes.)

To forestall link rot, the key points:

cd /tmp ;  wget https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-linux-arm.tgz
tar -xvzf cloudflared-stable-linux-arm.tgz 
sudo cp cloudflared /usr/local/bin
sudo chmod +x /usr/local/bin/cloudflared
sudo cloudflared -v
sudo useradd -s /usr/sbin/nologin -r -M cloudflared
sudo nano /etc/default/cloudflared
----
CLOUDFLARED_OPTS=--port 5053 --upstream https://1.1.1.1/dns-query --upstream https://1.0.0.1/dns-query 
----
sudo chown cloudflared:cloudflared /etc/default/cloudflared
sudo chown cloudflared:cloudflared /usr/local/bin/cloudflared
sudo nano /etc/systemd/system/cloudflared.service
----
[Unit]
Description=cloudflared DNS over HTTPS proxy
After=syslog.target network-online.target

[Service]
Type=simple
User=cloudflared
EnvironmentFile=/etc/default/cloudflared
ExecStart=/usr/local/bin/cloudflared proxy-dns $CLOUDFLARED_OPTS
Restart=on-failure
RestartSec=10
KillMode=process

[Install]
WantedBy=multi-user.target
----
sudo systemctl enable cloudflared
sudo systemctl start cloudflared
sudo systemctl status cloudflared

Then aim PiHole’s DNS at 127.0.0.1#5053. It used to be on port #54, for whatever that’s worth.

Verify it at https://1.1.1.1/help, which should tell you DoH is in full effect.

To update the daemon, which I probably won’t remember:

wget https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-linux-arm.tgz
tar -xvzf cloudflared-stable-linux-arm.tgz
sudo systemctl stop cloudflared
sudo cp ./cloudflared /usr/local/bin
sudo chmod +x /usr/local/bin/cloudflared
sudo systemctl start cloudflared
cloudflared -v
sudo systemctl status cloudflared

And then It Just Works … again!

Garden Hose Valve Wrench: Reinforced

After five gardening seasons, my simple 3D printed wrench broke:

Hose Valve Knob - fractured
Hose Valve Knob – fractured

Although Jason’s comment suggesting carbon-fiber reinforcing rods didn’t prompt me to lay in a stock, ordinary music wire should serve the same purpose:

Hose Valve Knob - cut pins
Hose Valve Knob – cut pins

The pins are 1.6 mm diameter and 20 mm long, chopped off with hardened diagonal cutters. Next time, I must (remember to) grind the ends flat.

The solid model needs holes in appropriate spots:

Hose Valve Knob - Reinforced - Slic3r
Hose Valve Knob – Reinforced – Slic3r

Yes, I’m going to put round pins in square holes, without drilling the holes to the proper diameter: no epoxy, no adhesive, just 20 mm of pure friction.

The drill press aligns the pins:

Hose Valve Knob - pin ready
Hose Valve Knob – pin ready

And rams them about halfway down:

Hose Valve Knob - pin midway
Hose Valve Knob – pin midway

Close the chuck jaws and shove them flush with the surface:

Hose Valve Knob - pins installed
Hose Valve Knob – pins installed

You can see the pins and their solid plastic shells through the wrench stem:

Hose Valve Knob - assembled
Hose Valve Knob – assembled

Early testing shows the reinforced wrench works just as well as the previous version, even on some new valves sporting different handles, with an equally sloppy fit for all. No surprise: I just poked holes in the existing model and left all the other dimensions alone.

The OpenSCAD source code as a GitHub Gist:

Monthly Science: USB Current Testers vs. NP-BX1 Batteries

Having some interest in my Sony HDR-AS30 helmet camera’s NP-BX1 battery runtime, I’ve been measuring and plotting recharge versus runtime after each ride:

USB Testers - Charge vs Runtime
USB Testers – Charge vs Runtime

The vertical axis is the total charge in mA·h, the horizontal axis is the discharge time = recorded video duration. Because 1 A = 1 coulomb/s, 1 mA·h = 3.6 C.

The data points fall neatly on two lines corresponding to a pair of cheap USB testers:

USB Testers
USB Testers

When you have one tester, you know the USB current. When you have two testers, you’re … uncertain.

The upper tester is completely anonymous, helpfully displaying USB Tester while starting up. The lower one is labeled “Keweisi” to distinguish it from the myriad others on eBay with identical hardware; its display doesn’t provide any identifying information.

The back sides reveal the current sense resistors:

USB Testers - sense resistors
USB Testers – sense resistors

Even the 25 mΩ resistor drops enough voltage that the charger’s blue LED dims appreciably during each current pulse. The 50 mΩ resistor seems somewhat worse in that regard, but eyeballs are notoriously uncalibrated optical sensors.

The upper line (from the anonymous tester) has a slope of 11.8 mA·h/minute of discharge time, the lower (from the Keweisi tester) works out to 8.5 mA·h/minute. There’s no way to reconcile the difference, so at some point I should measure the actual current and compare it with their displays.

Earlier testing suggested the camera uses 2.2 W = 600 mA at 3.7 V. Each minute of runtime consumes 10 mA·h of charge:

10 mA·h = 600 mA × 60 s / (3600 s/hour)

Which is in pretty good agreement with neither of the testers, but at least it’s in the right ballpark. If you boldly average the two slopes, it’s dead on at 10.1 mA·h/min; numerology can produce any answer you need if you try hard enough.

Actually, I’d believe the anonymous meter’s results are closer to the truth, because recharging a lithium battery requires 10% to 20% more energy than the battery delivered to the device, so 11.8 mA·h/min sounds about right.

Memo to Self: Trust, but verify.

Robin Nest: Construction

A pair of robins picked the best place for their nest:

Garage Robin Nest
Garage Robin Nest

I disabled the remote control for those spotlights, as we won’t be using them for a while.

Although I’m sure it’s a wonderful nest, robins certainly leave plenty of debris around their construction site:

Garage Robin Nest - overview
Garage Robin Nest – overview

I can’t figure how to mount a camera close enough for a good view and keep it out of their landing pattern.

Soaker Hose End Plug

One of the soaker hoses in Mary’s Vassar Farms garden split lengthwise near one end:

Soaker Hose Plug - hose split
Soaker Hose Plug – hose split

Although the hose is fully depreciated, I thought it’d be worthwhile to cut off the damaged end and conjure an end cap to see if a simple plug can withstand 100 psi water pressure.

A pair of Delrin (because I have it) plugs with serrations fill the hose channels, with the outer clamp squishing the hose against them:

Soaker Hose Plug - channel plugs - side view
Soaker Hose Plug – channel plugs – side view

In real life, they’ll be pushed completely into the hose, with a generous layer of silicone snot caulk improving their griptivity.

I started with 8 mm plugs, but they didn’t quite fill the channels:

Soaker Hose Plug - channel plugs - 8 mm test fit
Soaker Hose Plug – channel plugs – 8 mm test fit

Going to 8.5 mm worked better, although there’s really no way to force the granulated rubber shape into a snug fit around a cylinder:

Soaker Hose Plug - channel plugs test fit
Soaker Hose Plug – channel plugs test fit

Fortunately, they need not be leakproof, because leaking is what the hose does for a living. Well, did for a living, back before it died.

The clamps have a solid endstop, although it’s more to tidy the end than to hold the plugs in place:

Soaker Hose End Plug - Slic3r
Soaker Hose End Plug – Slic3r

The clamps need aluminum backing plates to distribute the stress evenly across their flat sides:

Soaker Hose Plug - installed
Soaker Hose Plug – installed

Those are 8-32 stainless steel screws. The standard 1 inch length worked out exactly right through no fault of my own.

The OpenSCAD source code as a GitHub Gist:

The original doodle, with dimensions vaguely related to the final model:

Soaker Hose End Plug - hose dimensions
Soaker Hose End Plug – hose dimensions

There is, as far as I can tell, no standardization of dimensions or shapes across manufacturers, apart from the threaded hose fittings.

Kenmore 158 Sewing Machine: More Deglaring

My first pass at deglaring the shiny metal parts on Mary’s brightly lit Kenmore 158 used translucent mailing labels on the “hand hole cover” in front of the needle:

Kenmore 158 - non-glare cover plate
Kenmore 158 – non-glare cover plate

That worked surprisingly well for surprisingly long, but the edges eventually came loose and, after far too long, I deployed the Tiny Sandblaster™:

Kenmore 158 - matte cover plate - feet
Kenmore 158 – matte cover plate – feet

The mottled matte effect isn’t quite what I expected, but it’s better-looking in person and we deemed it Good Enough™ for the purpose.

You saw the foot on the left in the previous effort:

Kenmore 158 - matte cover plate - feet - detail
Kenmore 158 – matte cover plate – feet – detail

The rounded plate directly under the needle sits far enough back to not reflect any of the LEDs toward her normal operating position, so we decided it didn’t need sandblasting.

She now has plenty of light where she needs it, with no glare from the metal bits.