Pot Lid Repair

For reasons not relevant here, we (temporarily) have a set of pots with glass lids. One of lids had a remarkable amount of crud between the glass and the trim ring under the knob, which turned out to be corrosion falling off the screw. Trying to remove the screw produced the expected result:

CKC Pot Lid - broken screw in handle

CKC Pot Lid – broken screw in handle

For whatever reason, they used an ordinary, not stainless, steel screw:

CKC Pot Lid - corroded screw

CKC Pot Lid – corroded screw

I figured I could mill the stub flat, drill out the remainder, install a new insert, and be done with it. The knob has a convex surface and, even though this looked stupid, I tried clamping it atop a wood pad:

CKC Pot Lid - precarious clamping

CKC Pot Lid – precarious clamping

Two gentle cutter passes convinced me it was, in fact, a lethally stupid setup.

Soooo, I poured some ShapeLock pellets into a defunct (and very small) loaf pan, melted them in near-boiling water, and pressed the knob into the middle, atop some stretchy film to prevent gluing the knob in place:

CKC Pot Lid - ShapeLock bedding

CKC Pot Lid – ShapeLock bedding

That’s eyeballometrically level, which is good enough, and the knob sits mechanically locked into the room-temperature plastic slab. Clamping everything down again makes for a much more secure operation:

CKC Pot Lid - clamped ShapeLock fixture

CKC Pot Lid – clamped ShapeLock fixture

A few minutes of manual milling exposes the original brass insert molded into the knob, with the steel screw firmly corroded in the middle:

CKC Pot Lid - screw stub milled flat

CKC Pot Lid – screw stub milled flat

Center-drill, drill small-medium-large, and eventually the entire insert vanishes in  a maelstrom of chips and dust:

CKC Pot Lid - OEM insert removed

CKC Pot Lid – OEM insert removed

Run a 10-32 stud into an insert, grab in drill chuck, dab JB Kwik around the knurls, press in place while everything’s still aligned in the Sherline, pause for curing, re-melt the ShapeLock, and the insert looks like it grew there:

CKC Pot Lid - new insert installed

CKC Pot Lid – new insert installed

Wonder to tell, a 1 inch 10-32 screw fit perfectly through the pot lid into the knob, with a dab of low-strength Loctite securing it. Reassemble everything in reverse order, and it’s all good:

CKC Pot Lid - repaired knob

CKC Pot Lid – repaired knob

Well, apart from those cracks. I decided I will not borrow trouble from the future: we’ll let those problems surface on their own and, if I’m still in the loop, I can fix them.

,

Leave a comment

Raspberry Pi vs. Avahi

It turns out that the various Avahi daemons performing the magick between whatever.local names and dotted-quad 192.168.1.101 addresses for Raspberry Pi descend into gibbering madness when confronted with:

  • One name corresponding to multiple IP addresses
  • One IP address used for multiple MAC addresses
  • Multiple names for one IP address
  • Multiple names for one MAC address
  • Multiple IP addresses for one MAC address
  • Multiple MAC addresses for one IP address
  • Any and all combinations of the above at various times

The least of the confusion involved an incorrect IP address linked to a familiar name pulled from deep history by a baffled daemon doing the best it can with what it thinks it know. Despite what I concluded, rather early in the process, there’s no real error, other than what amounted to a self-inflicted fast-flux nameserver attack.

Anyhow, I devoted the better part of an afternoon to sorting out the mess, which involved labeling all the streaming radio players with their MAC addresses and rebooting them one-by-one to allow all the daemons time to recognize the current situation:

Raspberry Pi 3 - WiFi MAC address

Raspberry Pi 3 – WiFi MAC address

That label corresponds to the Pi 3’s on-board WiFi adapter.

For Pi 2 boxen, the MAC address travels with the WiFi adapter jammed into a USB port:

SunFounder WiFi Adapter - MAC address

SunFounder WiFi Adapter – MAC address

I didn’t label the (unused) Ethernet jacks, figuring I’d solve that problem after it trips me up.

,

2 Comments

Raspberry Pi Streaming Radio Player: Room Customization

Sometimes you (well, I) want a bit of late-night music, which is now one button press away. However, I initially set things up so the Raspberry Pi’s startup code executed a Python script on a network share from the file server in the basement, which shuts down around midnight after the daily backup.

Keeping a local copy meant having to update that copy whenever I tweak the code, a nuisance not to be tolerated. This Bash (or whatever) code in /etc/rc.local figures out if the server is up and, if so, updates the local copy from the server. If the server isn’t up, then it just runs with what it has:

#!/bin/sh
# was !/bin/sh -e

... snippage ...

server=192.168.1.4

ping -c 1 $server
if [ $? -eq 0 ]
then
  mount -o ro ${server}:/mnt/bulkdata/Project\ Files/Streaming\ Media\ Player/Firmware/ /mnt/part
  rsync -auv /mnt/part/Streamer.py /home/pi
  umount /mnt/part
fi

sudo -u pi sh -c 'python /home/pi/Streamer.py any' &

N.B.: you must remove the -e from the shebang, because otherwise the script jams to a stop when the ping fails. Took me a while to figure that out, yup.

Use raspi-config to force the startup sequence to wait until the network is available. Turns out that the DHCP process can stall for half a minute, so fixed timeouts don’t work.

Hardcoding the server IP address eliminates a whole bunch of mysterious failures apparently due to whatever handles the translation from mollusk.local to the dotted quad. Maybe that’s not really a problem, but I’ll run with it.

Now the streamers fetch the Latest and Greatest version whenever they’re on during the day and run their local copy, with the room parameter telling it where it lives.

Life is good!

,

10 Comments

Raspberry Pi Streaming Radio Player: Command Line Parsing

Some experience suggested different default stations & volume settings for the streamers in various rooms, so the Python code now parses its command line to determine how to configure itself:

import argparse as args

cmdline = args.ArgumentParser(description='Streaming Radio Player',epilog='KE4ZNU - http://softsolder.com')
cmdline.add_argument('Loc',help='Location: BR1 BR2 ...',default='any',nargs='?')
args = cmdline.parse_args()

I should definitely pick a different variable name to avoid the obvious clash.

With that in hand, the customization takes very effort:

CurrentKC = 'KEY_KP7'
MuteDelay = 8.5         # delay before non-music track; varies with buffering
UnMuteDelay = 7.5       # delay after non-music track
MixerVol = '15'         # mixer gain

Location = vars(args)['Loc'].upper()
print 'Player location: ',Location
logging.info('Player setup for: ' + Location)

if Location == 'BR1':
  CurrentKC = 'KEY_KPDOT'
  MixerVol = '10'
elif Location == 'BR2':
  MuteDelay = 6.0
  UnMuteDelay = 8.0
MixerVol = '5'

The Location = vars() idiom returns a dictionary of all the variables and their values, of which there’s only one at the moment. The rest of the line extracts the value and normalizes it to uppercase.

Now we can poke the button and get appropriate music without having to think very hard.

Life is good!

The Python source code, which remains in dire need of refactoring, as a GitHub Gist:

,

1 Comment

Kenmore 158 Sewing Machine: Another Foot Pedal Rebuild

The pedal on Mary’s most recent Kenmore 158 lost its low-speed control, which meant I must add a few more graphite / carbon disks to the stacks:

Kenmore 158 - carbon disks

Kenmore 158 – carbon disks

The contacts needed a bit of attention, too:

Kenmore 158 - carbon contact plates - detail

Kenmore 158 – carbon contact plates – detail

Contrary to what I found in the previous rheostats, these stacks end with a double-thick graphite disk backed up by a disk of brass shimstock, all of which needed cleaning, too. No broken disks, none severely eroded, no debris, just a general shortening of the stacks; I think the disks gradually turn into carbon dioxide.

Each stack has 42 graphite disks that average 0.79 mm thick, the double-thick disks measure 1.5 mm, and the brass shims are 0.30 mm = 12 mil. The punched contacts on those brass plates stand 0.95 mm proud of the surface.

With the big graphite plugs in place, the ceramic housing had 37 mm deep holes for the disk stacks. Subtracting the 0.95 mm contact leaves about 36 mm and, seeing as how the stacks add up to just under 36 mm overall, there’s barely room for one additional disk. I added one to each stack, buttoned the pedal up, and it works perfectly again.

Good thing I have a bag of those disks from the crash test dummy machine!

,

4 Comments

Read-Only MicroSDHC Card

I iterated this sequence three times before I caught on:

  • ssh into Raspberry Pi
  • Edit /etc/rc.local, save changes
  • Reboot, observe the changes had no effect
  • cat /etc/rc.local shows no changes

Then I:

  • Edited / saved
  • Listed the file to verify the changes
  • Rebooted, observe no effect from changes
  • Listed the file again: the changes were gone

Huh.

Defunct 8 GB MicroSDHC card

Defunct 8 GB MicroSDHC card

It turns out the card went read-only without warning, so I was displaying the contents of the file cache buffers after the edit, not the data stored on the card. Rebooting started with empty caches, read the previous file contents, and behaved accordingly.

The F3 utilities now live in the Ubuntu repository and no longer require compiling from source. The result:

sudo f3probe --time-ops /dev/sdb
F3 probe 6.0
Copyright (C) 2010 Digirati Internet LTDA.
This is free software; see the source for copying conditions.

WARNING: Probing normally takes from a few seconds to 15 minutes, but
         it can take longer. Please be patient.

Probe finished, recovering blocks... Done

Bad news: The device `/dev/sdb' is damaged

Device geometry:
	         *Usable* size: 0.00 Byte (0 blocks)
	        Announced size: 7.35 GB (15415296 blocks)
	                Module: 8.00 GB (2^33 Bytes)
	Approximate cache size: 0.00 Byte (0 blocks), need-reset=no
	   Physical block size: 512.00 Byte (2^9 Bytes)

Probe time: 164.4ms
 Operation: total time / count = avg time
      Read: 107.1ms / 4098 = 26us
     Write: 56.6ms / 2049 = 27us
     Reset: 0us / 0 = 0us

That card has been kicking around for a while and started out as a no-name generic in some random gadget. Of course, those fancy Sony MicroSD cards weren’t shining examples of durability, either.

I’m mildly astonished the streaming player worked perfectly with what amounts to a read-only filesystem, but that’s what caching is all about: there was no need to write the data to “disk”.

,

5 Comments

USB Gooseneck Extension Innards

The bandsaw needs more light on the blade, but a fixed lamp will certainly get in the way of something. Pondering the solution space of available parts suggests a COB LED on a flexible gooseneck, which led to some 30 cm USB extenders, then smashing one of the connectors to reveal the wiring inside:

USB Gooseneck Extender - disassembled

USB Gooseneck Extender – disassembled

It was (probably) assembled by soldering the USB terminals to the wires, mounting it in a fixture, then injection-molding the shell around everything. The injected plastic fills the end of the gooseneck and immobilizes the wires.

I’d like slightly longer wire ends, although they’re workable if I don’t make any further mistakes. Perhaps I can heatsink the gooseneck, slit 10 mm of the metal sheath with an abrasive wheel, and peel off the pieces without damaging the wires. It could happen!

Speaking of mistakes, wiring an ordinary USB connector with +12 VDC for an LED seems fraught with peril…

Leave a comment