By turns: tinker, engineer, husband, author, amateur raconteur, recumbent cyclist, father, ham radio geek. So many projects, so little time!


Dragonfly Eye Re-Re-Repair

After not quite seven years, the acrylic caulk holding our garden dragonfly’s eyeballs in place lost its grip. Some cleaning of marbles and scuffing of copper sockets later, two rings of JB Kwik should do the trick:

Garden Dragonfly Sculpture - eye repair
Garden Dragonfly Sculpture – eye repair

It’s a family tradition, is all I can say …


Leave a comment

Heavy Object. Team Lift Required

So says the label on a recent Amazon package:

Heavy Object Team Lift - foam floor mats
Heavy Object Team Lift – foam floor mats

It contains half a dozen foam floor mat sheets weighing a bit under a pound apiece.

I don’t begrudge anyone working in an Amazon warehouse a bit of humor …


Samsung EVO Pro 32 GB MicroSD Cards

Installing the Xiaomi Dafang Hacks firmware requires an MicroSD card in each camera and, my previous stock having run low, four more just arrived:

Samsung EVO Plus - 32 GB MicroSD
Samsung EVO Plus – 32 GB MicroSD

Prices have collapsed to the point where known-good (all four passed f3probe testing) cards direct from Samsung (as opposed to Amazon’s “commingled inventory” counterfeit situation) now cost $12-ish each with free shipping.

After I finish fiddling with the first camera, I’ll copy its card onto these four, unique-ify the IP addresses / hostnames /suchlike, and bring ’em all online.

Leave a comment

Xiaomi Dafang Hacks: Motion Detection

Given a camera running Xiaomi Dafang Hacks software, you can set up motion-triggered image capture and save the images either locally or on an FTP server. The latter makes sense, as it automatically plunks the images where they’re more generally available.

Define the FTP server parameters in config/motion.conf:

# Configure FTP snapshots and videos

The FTP server should have the Cam4 directory in place and shared for read-write access before attempting to plunk files therein. Ahem.

The camera’s Services menu leads to the motion configuration page:

Xiaomi Dafang - Motion Settings page
Xiaomi Dafang – Motion Settings page

Limiting the detection region to the lower-left corner cuts out all the waving-in-the-breeze foliage in the yard, while covering the driveway. High sensitivity detects squirrel-sized objects in the foreground, although your mileage will certainly differ.

The camera seems rate-limited at 5 s/image, which may come from FTP transfer overhead; I don’t know if the code includes a built-in delay or if it just works like that. The NAS drive requires upwards of 7 s to spin up if it hasn’t been used for a while, but afterwards the transfers don’t take that long.

Mounting the NAS drive’s CIFS shared directory from my desktop PC works as before:

sudo mount -v -o rw,credentials=/root/.nas-id,vers=1.0,uid=ed -t cifs // /mnt/part

Then view / edit / delete images as needed:

Xiaomi Dafang - IR motion capture - 15-04-2019_20.02.06
Xiaomi Dafang – IR motion capture – 15-04-2019_20.02.06

The camera has built-in IR LEDs, but they’re nowhere near powerful enough to illuminate the entire yard.

Motion detection works better in daylight:

Xiaomi Dafang - Daylight motion capture - 16-04-2019_09.53.51
Xiaomi Dafang – Daylight motion capture – 16-04-2019_09.53.51

Unlike the original Wyze firmware, the Xiaomi Dafang Hacks firmware & software keep all the images & metadata within my network and under my control.


Xiaomi Dafang Hacks: Timelapse Images

With the Wyze and Xiamoi Dafang cameras running the Xiaomi-Dafang Hacks firmware and software, I tried the timelapse functions on the yard camera.

The config/timelapse.conf file:

# Interval between snaps, in seconds
# Duration of the script should run, in minutes, set to 0 for unlimited
# Save dir config
# Enable compression

The images, named along the lines of 13-04-2019_191810_001.jpg, appear in the DCIM/timelapse directory, tucked into daily directories with names like 2019-04-13, a mismatch obviously in need of tweaking. There’s also a time_lapse directory which seems like cruft from an earlier revision; you can configure the target directory in scripts/

Start the script manually or from a crontab entry, wait until it’s done, then transfer the images to somewhere more convenient with a Bash one-liner:

find /system/sdcard/DCIM/timelapse/ -name \*jpg -exec curl -s -n -T {} \; 

The -s silences all curl output; omit it until you’re sure the lashup works as you expect. I always forget the backslash before the semicolon terminating the -exec command.

The -n pulls the userID and password from the ~/.netrc file you previously set up for manual ftp sessions:

login ftp-user-id
password secret-password

The IP address corresponds to my ancient NAS drive; your mileage may vary.

From my desktop box, mount the NAS drive:

sudo mount -t cifs -o "credentials=/root/.nas-id,vers=1.0,uid=ed" "//nasty/Timelapse" /mnt/part

The drive’s credentials aren’t particularly secret, but tucking them into /root/.nas-id means you could automount the drive with no hassle. The NAS drive requires the oldest possible CIFS version, of course.

Then view the pix:

Xiaomi Dafang - 15-04-2019_13.26.18
Xiaomi Dafang – 15-04-2019_13.26.18

You could set up the camera as an NFS share, but having all the cameras deposit their pix in a common location seems more convenient, particularly after I get around to automating the image transfer. Regrettably, the NAS drive doesn’t support subdirectories.


Sony NP-FM50 Battery Rebuild

With six new 18500 lithium cells in hand, I rebuilt the three weakest NP-FM50 packs.

The Sherline CNC mill setup for sawing around the midline:

Sony NP-FM50 battery - Sherline saw setup
Sony NP-FM50 battery – Sherline saw setup

Adjust the saw to cut along the seam, set X=0 at the surface, jog to about X+0.7 mm, jog the saw along the seam, then repeat for the other three sides. No real CNC involved, but it’s much easier than sawing or breaking through the seam by hand.

These two packs came with the camera:

Sony NP-FM50 battery - 2003-era cells
Sony NP-FM50 battery – 2003-era cells

The cells have only lot numbers, no manufacturer ID. Wikipedia sayeth Sony Fukushima started in 2000; perhaps these were early production units with no branding.

The center strap running the length of the pack didn’t seem long enough, because I mistakenly thought I’d straightened its end while unsoldering it. As it happens, the end was straight and secured to the PCB by structural solder:

Sony NP-FM50 battery - PCB center tab joint
Sony NP-FM50 battery – PCB center tab joint

Moral of the story: pay attention, dammit!

The other end of the center strap required a snippet of tin strip to reach the tabs:

Sony NP-FM50 battery - rebuilt center strap
Sony NP-FM50 battery – rebuilt center strap

Aligning the cells that way allowed me to just bend the other tabs over the PCB pads and solder them in place:

Sony NP-FM50 battery - rebuilt PCB contacts
Sony NP-FM50 battery – rebuilt PCB contacts

Then a strip of Kapton tape across the kerf holds the case together well enough to survive our gentle usage:

Sony NP-FM50 battery - Kapton belly band
Sony NP-FM50 battery – Kapton belly band

The battery packs require a brief stay in the charger to reset the PCB’s lockout circuitry, after which they work fine:

Sony NP-FM50 - 2019-04-12
Sony NP-FM50 – 2019-04-12

The two oldest batteries (OEM 2003 A and OEM 2003 B) have new identities to suit their new innards: 2019 E and 2019 F. The DOA eBay battery retains its 2019 D label after the rebuild, as there’s little room for confusion.

Admittedly, it’d be easier / cheaper / faster to buy third-party NP-FM50 packs directly from eBay or Amazon, but this way I know the cells aren’t complete crap and I get some Quality Shop Time™ out of the deal.

What’s not to like?

Leave a comment

Monthly Image: Terrifying Playground

The newly built Capital Region Welcome Center on the Thruway has a small playground for small children, featuring appropriately small signage:

NYS Thruway rest area playground
NYS Thruway rest area playground

Here’s the world we live in (clicky for more dots):

Playground warning sign - detail
Playground warning sign – detail

Fortunately, we lack a small child at risk of damage.

You (well, I) just can’t make this stuff up.