Archive for category Recumbent Bicycling

Bulk-renaming Video Snapshots

For reasons that should be obvious by now, I review the helmet camera video from (some of) our bike rides and extract snapshots of interesting events. VLC auto-names the snapshots along these lines:

-rw-rw-r-- 1 ed ed  4.0M 2016-09-16 16:15 vlcsnap-2016-09-16-16h15m43s49.png
-rw-rw-r-- 1 ed ed  3.2M 2016-09-16 16:15 vlcsnap-2016-09-16-16h15m59s181.png
-rw-rw-r-- 1 ed ed  2.7M 2016-09-16 16:18 vlcsnap-2016-09-16-16h18m58s125.png
-rw-rw-r-- 1 ed ed  3.7M 2016-09-16 18:40 vlcsnap-2016-09-16-18h40m22s7.png
-rw-rw-r-- 1 ed ed  3.5M 2016-09-16 18:40 vlcsnap-2016-09-16-18h40m58s132.png
-rw-rw-r-- 1 ed ed  3.5M 2016-09-16 18:41 vlcsnap-2016-09-16-18h41m29s181.png
-rw-rw-r-- 1 ed ed  3.9M 2016-09-16 18:41 vlcsnap-2016-09-16-18h41m42s60.png
-rw-rw-r-- 1 ed ed  3.8M 2016-09-16 18:41 vlcsnap-2016-09-16-18h41m54s146.png
-rw-rw-r-- 1 ed ed  3.8M 2016-09-16 18:42 vlcsnap-2016-09-16-18h42m22s206.png
-rw-rw-r-- 1 ed ed  3.7M 2016-09-16 18:42 vlcsnap-2016-09-16-18h42m38s58.png

The gap in the timestamp after the first three files reveals a random errand.

First, convert to JPG format, place the results in another directory and, en passant, mash them to a reasonable size:

mkdir /some-useful-directory/Road\ Repair/"Rt 82 and CR 29"
for f in  vlcsnap-2016-09-16* ; do convert $f -density 300 -define jpeg:extent=200KB /some-useful-directory/Road\ Repair/"Rt 82 and CR 29"/${f%%.*}.jpg ; done
cd /some-useful-directory/Road\ Repair/"Rt 82 and CR 29"

Replace the first part of the VLC-generated names with relevant identification:

rename 's/vlcsnap-/Rt 82 - /' vlcsnap-2016-09-16-16*
rename 's/vlcsnap-/CR 29 - /' vlcsnap*

The directory now contains these files:

-rw-rw-r-- 1 ed ed 193K 2016-09-19 11:36 CR 29 - 2016-09-16-18h40m22s7.jpg
-rw-rw-r-- 1 ed ed 192K 2016-09-19 11:36 CR 29 - 2016-09-16-18h40m58s132.jpg
-rw-rw-r-- 1 ed ed 193K 2016-09-19 11:36 CR 29 - 2016-09-16-18h41m29s181.jpg
-rw-rw-r-- 1 ed ed 193K 2016-09-19 11:36 CR 29 - 2016-09-16-18h41m42s60.jpg
-rw-rw-r-- 1 ed ed 194K 2016-09-19 11:36 CR 29 - 2016-09-16-18h41m54s146.jpg
-rw-rw-r-- 1 ed ed 196K 2016-09-19 11:36 CR 29 - 2016-09-16-18h42m22s206.jpg
-rw-rw-r-- 1 ed ed 196K 2016-09-19 11:36 CR 29 - 2016-09-16-18h42m38s58.jpg
-rw-rw-r-- 1 ed ed 195K 2016-09-19 11:36 Rt 82 - 2016-09-16-16h15m43s49.jpg
-rw-rw-r-- 1 ed ed 194K 2016-09-19 11:36 Rt 82 - 2016-09-16-16h15m59s181.jpg
-rw-rw-r-- 1 ed ed 194K 2016-09-19 11:36 Rt 82 - 2016-09-16-16h18m58s125.jpg

These bursts of Perl regex line noise replace the snapshot timestamp on those files with an ascending sequence number, with separate sequences for each group:

i=1 ; for f in CR* ; do rename -v "s/-1[68]h..m..s\d{1,3}/ - $(( i++ ))/" "$f" ; done
i=1 ; for f in Rt* ; do rename -v "s/-1[68]h..m..s\d{1,3}/ - $(( i++ ))/" "$f" ; done

And then the files make sense:

-rw-rw-r-- 1 ed ed 193K 2016-09-19 13:51 CR 29 - 2016-09-16 - 1.jpg
-rw-rw-r-- 1 ed ed 192K 2016-09-19 13:51 CR 29 - 2016-09-16 - 2.jpg
-rw-rw-r-- 1 ed ed 193K 2016-09-19 13:51 CR 29 - 2016-09-16 - 3.jpg
-rw-rw-r-- 1 ed ed 193K 2016-09-19 13:51 CR 29 - 2016-09-16 - 4.jpg
-rw-rw-r-- 1 ed ed 194K 2016-09-19 13:51 CR 29 - 2016-09-16 - 5.jpg
-rw-rw-r-- 1 ed ed 196K 2016-09-19 13:51 CR 29 - 2016-09-16 - 6.jpg
-rw-rw-r-- 1 ed ed 196K 2016-09-19 13:51 CR 29 - 2016-09-16 - 7.jpg
-rw-rw-r-- 1 ed ed 195K 2016-09-19 13:51 Rt 82 - 2016-09-16 - 1.jpg
-rw-rw-r-- 1 ed ed 194K 2016-09-19 13:51 Rt 82 - 2016-09-16 - 2.jpg
-rw-rw-r-- 1 ed ed 194K 2016-09-19 13:51 Rt 82 - 2016-09-16 - 3.jpg

The hard part, this time around, involved figuring a regex for the timestamp. The trick was to specify a single digit for the milliseconds part, with a repetition count allowing for one-to-three digits.

The Perl regex cheat sheet helped.

The double quotes around the rename search parameter allows the shell to expand the $(( i++ )) gibberish. The double quotes around the file name keep the blank-separated parts together.

At some point I must figure out how to produce leading-zero-filled sequence numbers, which will probably involve a printf.

The ride covered some roads with “2 to 4 foot” shoulders, which seems overly optimistic:

Rt 82 - 2016-09-16 - 3

Rt 82 – 2016-09-16 – 3

NYSDOT and DCDPW both believe a homeopathic strip of asphalt will cover faults in the travel lane and don’t care that the right side of the strip puts an abrupt ledge along the middle of the minimal and fissured shoulder:

Rt 82 - 2016-09-16 - 1

Rt 82 – 2016-09-16 – 1

Ah, well, it was a lovely day for a ride …


APRS iGate KE4ZNU-10: Southern Coverage

A pleasant Friday morning ride with several stops:

KE4ZNU-9 - APRS Reception - 2016-09-09

KE4ZNU-9 – APRS Reception – 2016-09-09

KE4ZNU-10 handled the spots near Red Oaks Mill, along parts of Vassar Rd that aren’t hidden by that bluff, and along Rt 376 north of the airport.

The KB2ZE-4 iGate in the upper left corner caught most of the spots; it has a much better antenna in a much better location than the piddly mobile antenna in our attic.

Several of the spots along the southern edge of the trip went through the K2PUT-15 digipeater high atop Mt. Ninham near Carmel, with coverage of the entire NY-NJ-CT area.

The APRS-IS database filters out packets received by multiple iGates, so there’s only one entry per spot.

All in all, KE4ZNU-10 covers the southern part of our usual biking range pretty much the way I wanted.


Road Conditions: Rt 376 SB Near Maloney Rd

NYSDOT seems oddly reluctant to perform routine brush clearing along Rt 376 from Red Oaks Mill to the Hamlet of New Hackensack, despite the obvious hazard presented by the bushes:

Rt 376 SB shoulder overgrowth - 2016-09

Rt 376 SB shoulder overgrowth – 2016-09

I’ve reported this situation several times over the years, but, as you’ve seen in other situations, that has no effect.

If it were a pleasant back-country lane, rather than our main route to the Dutchess Rail Trail, perhaps having the greenery take over the shoulder wouldn’t matter quite so much:

Rt 376 SB - semitrailer

Rt 376 SB – semitrailer

Turns out the shoulder just north of Maloney has developed lethal cracks as the pavement subsides into the adjoining section of the Mighty Wappinger Creek. A bit more clearance would still be nice.


No Turning Back, Vehicular Division

We were in the Arlington Square exit, waiting to cross Rt 44 into Adams:

Rt 44 Plaza Exit - 2016-08-02 - 0

Rt 44 Plaza Exit – 2016-08-02 – 0

If we both line up on the traffic signal sensor loop, it seems to detect us; Mary’s on the right side of the loop, I’m rolling along the left side. This seems to be an old-school dipole loop, not a quadrupole.

Despite the fact that the mall entrance lane is to our left, across that substantial median strip and exactly where you’d expect it, a driver turned left from Rt 44 into the mall exit:

Rt 44 Plaza Exit - 2016-08-02 - 1

Rt 44 Plaza Exit – 2016-08-02 – 1

He obviously intended to use the lane we were occupying, because it’s the right-hand lane from his direction (where we were obviously not supposed to be), but veered away at the last moment:

Rt 44 Plaza Exit - 2016-08-02 - 2

Rt 44 Plaza Exit – 2016-08-02 – 2

Which was a good thing for all parties concerned, including the car approaching us in the proper lane:

Rt 44 Plaza Exit - 2016-08-02 - 3

Rt 44 Plaza Exit – 2016-08-02 – 3

Elapsed time: five seconds.

The driver then turned right, head-on against cars exiting from the parking lot and parallel-broadside with a pickup entering in the proper lane, and somehow didn’t collide with anybody or anything.

From where we sat, there was absolutely nothing we could do but watch death roll toward us.


Red Oaks Mill APRS iGate: KE4ZNU-10

APRS coverage of this part of the Mighty Wappinger Creek Valley isn’t very good, particularly for our bicycle radios (low power, crappy antennas, lousy positions), so I finally got around to setting up a receive-only APRS iGate in the attic.

The whole setup had that lashed-together look:

KE4ZNU-10 APRS iGate - hardware

KE4ZNU-10 APRS iGate – hardware

It’s sitting on the bottom attic stair, at the lower end of a 10 °F/ft gradient, where the Pi 3’s onboard WiFi connects to the router in the basement without any trouble at all.

After about a week of having it work just fine, I printed a case from Thingiverse:

KE4ZNU-10 APRS iGate - RPi TNC-Pi case

KE4ZNU-10 APRS iGate – RPi TNC-Pi case

Minus the case, however, you can see a TNC-Pi2 kit atop a Raspberry Pi 3, running APRX on a full-up Raspbian Jessie installation:

RPi TNC-Pi2 stack - heatshrink spacers

RPi TNC-Pi2 stack – heatshrink spacers

You must solder the TNC-Pi2 a millimeter or two above the feedthrough header to keep the component leads off the USB jacks. The kit includes a single, slightly too short, aluminum standoff that would be perfectly adequate, but I’m that guy: those are four 18 mm lengths of heatshrink tubing to stabilize the TNC, with the obligatory decorative Kapton tape.

The only misadventure during kit assembly came from a somewhat misshapen 100 nF ceramic cap:

Monolithic cap - 100 nF - QC failure

Monolithic cap – 100 nF – QC failure

Oddly, it measured pretty close to the others in the kit package. I swapped in a 100 nF ceramic cap from my heap and continued the mission.

The threaded brass inserts stand in for tiny 4-40 nuts that I don’t have. The case has standoffs with small holes; I drilled-and-tapped 4-40 threads and it’ll be all good.

The radio, a craptastic Baofeng UV-5R, has a SMA-RP to UHF adapter screwed to the cable from a mobile 2 meter antenna on a random slab of sheet metal on the attic floor. It has Kenwood jack spacing, but, rather than conjure a custom plug, I got a clue and bought a pair of craptastic Baofeng speaker-mics for seven bucks delivered:

Baofeng speaker-mic wiring

Baofeng speaker-mic wiring

For reference, the connections:

Baofeng speaker-mic cable - pins and colors

Baofeng speaker-mic cable – pins and colors

Unsoldering the speaker-mic head and replacing it with a DE-9 connector didn’t take long.

The radio sits in the charging cradle, which probably isn’t a good idea for the long term. The available Baofeng “battery eliminators” appear to be even more dangerously craptastic than the radios and speaker-mics; I should just gut the cheapest one and use the shell with a better power supply.

I initially installed Xastir on the Pi, but it’s really too heavyweight for a simple receive-only iGate. APRX omits the fancy map displays and runs perfectly well in a headless installation with a trivial setup configuration.

There are many descriptions of the fiddling required to convert the Pi 3’s serial port device names back to the Pi / Pi 2 “standard”. I did some of that, but in point of fact none’s required for the TNC-Pi2; use the device name /dev/serial0 and it’s all good:

serial-device /dev/serial0 19200 8n1 KISS
callsign $mycall # callsign defaults to $mycall
tx-ok false # transmitter enable defaults to false
telem-to-is false # set to 'false' to disable

Because the radio looks out over an RF desert, digipeating won’t be productive and I’ve disabled the PTT. All the received packets go to the Great APRS Database in the Cloud:


An APRS reception heat map for the last few days in August:

KE4ZNU-10 Reception Map - 2016-08

KE4ZNU-10 Reception Map – 2016-08

The hot red square to the upper left reveals a peephole through the valley walls toward Mary’s Vassar Farms garden plot, where her bike spends a few hours every day. The other hotspots show where roads overlap the creek valley; the skinny purple region between the red endcaps covers the vacant land around the Dutchess County Airport. The scattered purple blocks come from those weird propagation effects that Just Happen; one of the local APRS gurus suggests reflections from airplane traffic far overhead.

An RPi 3 is way too much computer for an iGate: all four cores run at 0.00 load all day long. On the other paw, it’s $35 and It Just Works.


Wasp Flyby

I didn’t notice this at the time:

This slideshow requires JavaScript.

The camera runs at 60 frame/s, so the entire show spans a bit more than half a second: zzzzzip!

I think it’s a member of the Yellow Jacket wasp family, noted for their in-your-face attitude and repeat-fire stinger. They’re highly capable flying machines, that’s for sure…

We were pulling out of the local “health food” store with fresh-ground nut butters in the packs, nearing the end of a 17 mile loop on a fine Sunday morning.



Skeuomorphism Gone Wild

This truck’s home base seems to be south of Maloney on Rt 376 and it occasionally passes me on the road:

Farmers and Chefs Food Truck

Farmers and Chefs Food Truck

My eye-blink reaction that it was a junker turns out to be completely wrong, as it sports a really great paint job (vinyl wrap?):

Farmers and Chefs Food Truck - Detail

Farmers and Chefs Food Truck – Detail

The junker aspect may not be quite what they expected…

I’m not sure that’s skeuomorphic, but I don’t know the proper term.