The Smell of Molten Projects in the Morning

Ed Nisley's Blog: Shop notes, electronics, firmware, machinery, 3D printing, laser cuttery, and curiosities. Contents: 100% human thinking, 0% AI slop.

Category: Recumbent Bicycling

Cruisin’ the streets

  • Isolated Internet Access for Guests

    We provide a camping spot for touring bicyclists riding through the Hudson Valley and, as you’d expect, most of them arrive toting netbooks, tablets, and other net-enabled doodads. While I’m a nice guy and they’re uniformly nice folks, I’d rather not hand them the keys to our house network, so I recently set up a WiFi Internet-only access point that’s firewalled from the LAN.

    The general idea:

    • Use a stock WiFi router to handle DHCP / DNS / WiFi for guests (192.168.2.x)
    • Add a second NIC to the file server as eth1 (192.168.3.1), connected to the router’s WAN port (192.168.3.2)
    • Forward packets between eth0 (house network 192.168.1.x) and eth1, except …
    • Use iptables to prevent router clients from seeing the house network

    The network layout:

    Guest Internet Access Overview
    Guest Internet Access Overview

    The parts came from the Big Box o’ Network Stuff:

    • Linksys / Cisco WRT54G router (Version 8, so OpenWRT won’t run)
    • NetGear 10/100 Mb/s Ethernet PCI card

    The router setup:

    • Static WAN at 192.168.3.2
    • Router base address 192.168.2.1
    • DHCP range 192.168.2.100 through .149, lease time 1 hour
    • DNS entries 4.2.2.1 (L3), 65.88.88.2 (NY Public Library), 129.250.35.250 (NTT)
    • WiFi access to the web admin page disabled (admin only via CAT5 in the Basement Laboratory)
    • Non-broadcast SSID, not that it matters very much
    • WPA2-PSK with an XKCD-style password

    The NIC Just Worked: the drivers come along with the kernel. Because it’s not a general-purpose network interface from the server side, eth1 setup doesn’t require much effort:

    ifconfig eth1 192.168.3.1 netmask 255.255.255.0
    

    I discovered the hard way that trying to define the eth1 interface with Network Manager caused no end of heartache & confusion, not least of which is that having two NICs somehow activates Ubuntu’s internal firewalling & port forwarding. Suffice it to say, just set the NM’s GUI to Ignore the eth1 NIC and do what needs to be done manually.

    With one NIC, Ubuntu runs iptables in “let it be” mode: everything’s allowed, nothing’s blocked, and all packets get forwarded. The tables are empty and the default ACCEPT policy passes everything.

    Adding a rule to the FORWARD chain prevents the router from sending packets to the house network:

    iptables -A FORWARD -i eth1 --destination 192.168.0.0/16 -j REJECT
    

    That still allows a ping response from the file server’s eth0 NIC at 192.168.1.2 back to the WiFi clients, because packets addressed to the server pass through the INPUT chain. This rule squelches those packets:

    iptables -A INPUT -i eth1 --destination 192.168.0.0/16 -j REJECT
    

    Although packet forwarding is enabled by default, another rule turns on the NAT machinery required to shuttle packets between the 192.168.3.x network and the outside world:

    iptables -A POSTROUTING -t nat -j MASQUERADE
    

    While fiddling with iptables rules that involve packet state tracking (which these do, at least implicitly, I think), you must reset the packet state memories to ensure new packets aren’t regarded as part of an established connection. Install the conntrack utilities, then reset the state as needed:

    sudo conntrack -F
    

    And then it Just Worked.

    Now, back in the day, you’d just put those configuration lines in /etc/rc.local and be done with it. Unfortunately, nowadays the upstart process kicks off rc.local well before the system is in a usable state: somewhat before eth0 is active, which means any automagic network-related activity falls flat on its face.

    So an upstart configuration script is in order… more on that later.

    Some useful, albeit occasionally befuddling references:

    One could, of course, buy dedicated hardware to do all that and more, but it’s nothing you couldn’t accomplish with a bit more configuration on a stock Linux box. Heck, you could even serve an Upside-Down-Ternet to anyone who deserves it; the original has some other suggestions that made the big time.

    A tip o’ the cycling helmet to Dragorn of Kismet for getting me started…

  • Gas Flareoff

    While I was on that ride, I found this at the bottom of a smoky pillar rising along the Hudson River:

    Turns out Central Hudson Gas & Electric has a pipeline under the Hudson at that point and I’d admired their spherical storage tank from ground level some years back:

    Gas Storage Tank
    Gas Storage Tank

    I don’t know what they’re flaring off, but it looks messier than, say, propane. There’s another flare nozzle just out of the picture on the lower left, both along the edge of the circular concrete pad left over from a cylindrical storage tank, so they do this often enough to have some permanent infrastructure.

  • Sloop Clearwater: Sailing on the Hudson River

    Back in the old days, the Hudson was clogged with sailing ships; now only a few carefully tended reproductions remain:

    Sailing ship under Walkway Over the Hudson
    Sailing ship under Walkway Over the Hudson

    That’s the Sloop Clearwater as seen from the middle of the Poughkeepsie Bridge on an overcast day that brings out the vignetting in the long telephoto image.

    A bit earlier I was westbound on the Walkway Over the Hudson while the Clearwater was headed northbound:

    Sloop Clearwater
    Sloop Clearwater

    Turns out they carry a GPS tracker (accessible from a link on their site):

    Sloop Clearwater Track - 2012-05-14
    Sloop Clearwater Track – 2012-05-14

    So do I:

    KE4ZNU-9 APRS Track - 2012-05-14
    KE4ZNU-9 APRS Track – 2012-05-14

    It was a fine day for a ride (or a sail) before the storm!

  • Kai and Yen: T2 Bicycle Trailer

    Kai and Yen stayed with us over the weekend; they’re about 18 months into a two-year trip around the world. Kai was pulling an interesting single-wheel T2 trailer. Unlike my BOB Yak, the rear wheel has what looks like an active torsion-spring suspension:

    T2 trailer suspension
    T2 trailer suspension

    They’re taking the northern route across the US and Canada on their way back to Taiwan:

    Kai and Yen - ready to roll
    Kai and Yen – ready to roll

    They make our bicycling adventures fade to pale gray… which is OK with us!

  • Wouxun KG-UV3D GPS Interface: First Ride

    That circuit works pretty well for APRS tracking, I’d say, based on a 23 mile out-and-back ride over the Walkway:

    KE4ZNU - Wouxun KG-UV3D - first ride
    KE4ZNU – Wouxun KG-UV3D – first ride

    Had I gone further westward along Rt 299, however, the track would end: the bluffs on the east side of the Wallkill River Valley block much of the RF and Illinois Mountain (just to the west of Poughkeepsie) finishes the job. Evidently, nobody runs an APRS iGate or digipeater anywhere within sight of New Paltz…

    FWIW, the Walkway’s hand-scrawled notice boards now entreat “Bicyclists: ride SLOW and YIELD to pedestrians.” OK, fair enough, but how about equal time: “WALKERS: keep RIGHT, remove earbuds, and PAY ATTENTION”. It’s amazing how four people can block nearly the entire width of a 25 foot path, then look startled after not hearing a bicycle bell that’s been dinging steadily for 15 seconds…

  • Wouxun KG-UV3D GPS Interface: First Light

    The robust wire I  used for the external battery connection required a bit of diagonal cutter work to enlarge the hole in the top plate, but eventually everything fit together and the GPS interface box latched neatly onto the radio:

    HT-GPS Case - cabled top view
    HT-GPS Case – cabled top view

    The skein of cables:

    • Antenna: reverse SMA to UHF adapter = RG58 coax
    • GPS: TTL serial data from Byonics GPS2 receiver = DB-9 (OK, DE-9)
    • Helmet: mic + earbud = repurposed USB cable
    • PTT: 3.5 mm jack = repurposed audio cable
    • External power: 18 gauge zip cord + Powerpoles = repurposed speaker cable

    All in all, it looks pretty good:

    HT-GPS Case - cabled and powered
    HT-GPS Case – cabled and powered

    After a few rides to verify that this whole affair works, I must print up another case with slightly modified dimensions, add a plastic window over those cheerful LEDs on the TinyTrak3+ board, and mush an epoxy putty blob over the earphone and mic connections on that bright yellow plug plate. I’ve given up on the idea of having a cover for the top part of the battery compartment; there just isn’t enough space for such a thing and it’d be an impossibly delicate shell.

    The radio seems happy enough being fed 9 V from a bench supply (to match the upconverted lithium packs I’ve been using on the bikes), rather than 7.4 V from its standard lithium pack. A freshly charged battery comes pretty close to 9 V, so they can’t be too fussy. It idles at about 100 mA, with periodic blips to 140 mA when (I think) the TinyTrak3+ tickles the GPS receiver, regardless of the supply voltage. Goosing it with 13.8 V surely wouldn’t have a happy outcome…

    Lashed up like that on the bench, with the GPS receiver hanging out the basement window and the coax hitched to a bicone scanner antenna sitting inside the window, it generated APRS spots and the audio sounds OK, so the innards look good, too.

    2012-04-11 20:09:08 EDT: KE4ZNU-9>APT311,WA2YSM-15,WIDE1*,WIDE2-1,qAR,K2MHV-6:>Ed - Bike PL100 UV3D
    

    One downside: the TinyTrak3+ blurts its initial ID message instantly after being powered on, but the radio takes a few seconds to haul itself to its feet. As a result, the ID message never reaches the antenna. So it goes…

  • Wouxun KG-UV3D GPS Interface: Radio Power Contacts

    After considerable stalling, I filed the heads of two brass 4-40 screws down to about 1 mm, leaving just a hint of the slots in place. They’re a bit over 5 mm in diameter, smaller than the 7 mm I wanted to use, but have the compelling advantage of being Close Enough to get the rest of the hardware working. The gap between the interface PCB and the case is 3 mm, which turns out to be just about exactly the thickness of a 4-40 nut and flat washer, so I soldered a pair of them together as threaded spacers:

    HT-GPS Case - radio battery contacts
    HT-GPS Case – radio battery contacts

    The soldering looks worse than it really is; they’re secured all the way around.

    For the external battery connectors on the top, I ran a #33 drill through a pair of miniature crimp ring lugs to get a slip fit, then soldered them atop a pair of nickel-plated nuts. In normal use they’d be captured by the nuts, but I can’t figure out how to assemble them inside the case:

    HT-GPS Case - external power lugs
    HT-GPS Case – external power lugs

    Those are stainless steel 4-40 screw cutoffs, which I used because solder doesn’t adhere to stainless… I tinned the nuts and connectors, clamped the screws in a small vise, heated the nuts with a soldering iron, and applied the contacts with a tweezer. They snapped right into place and the solder fillet wrapped neatly around the entire lug.

    The heat from the soldering iron relaxed the insulator sleeves enough to remove nearly all trace of the crimping.

    With all that in hand, I ran the brass screws through the case, into the spacer nut+washer combo, through the PCB, and into the battery contact nuts. A bit of tedious pliers work snugged the screws and got everything lined up, then I tightened the spacers against the PCB and battery nuts on the other side. That’s completely invisible inside the case, so there aren’t any pictures, but the idea is that the studs sit flush inside their case recesses and clamping the PCB between the nuts shouldn’t put any stress on the PCB. We shall see.

    HT-GPS Case - radio contacts in place
    HT-GPS Case – radio contacts in place

    The slots became so shallow that a screwdriver doesn’t get any traction…