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.

Tag: Repairs

If it used to work, it can work again

  • GIMP 3.0 vs. XSane vs. gimp-xsanecli

    GIMP 3.0 vs. XSane vs. gimp-xsanecli

    For reasons I do not profess to understand, GIMP 3.0 does not work with plugins written for GIMP 2.0, including the XSane plugin that handles scanning. This seems like an obvious oversight, but after three months it also seems to be one of those things that’s like that and that’s the way it is.

    Protracted searching turned up gimp-xsanecli, a GIMP 3.0 plugin invoking XSane through its command-line interface to scan an image into a temporary file, then stuff the file into GIMP. Unfortunately, it didn’t work over the network with the Epson ET-3830 printer / scanner in the basement.

    It turns out gimp-xsanecli tells XSane to output the filename it’s using, then expects to find the identifying XSANE_IMAGE_FILENAME string followed by the filename on the first line of whatever it gets back:

    if result != 'XSANE_IMAGE_FILENAME: ' + png_out:
      Gimp.message('Unexpected XSane result: ' + result)
      return Gimp.ValueArray.new_from_values([GObject.Value(Gimp.PDBStatusType, Gimp.PDBStatusType.EXECUTION_ERROR)])
    
    

    The font ligature that may or may not mash != into is not under my control.

    Protracted poking showed the scanner fires a glob of HTML through proc/stdout into gimp-xsanecli before XSane produces its output, but after the scan completes:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN "
    "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    … snippage …
    </head>
    <body><noscript>Enable your browser's JavaScript setting.</noscript></body></HTML>XSANE_IMAGE_FILENAME: /tmp/out.png
    

    Complicating the process:

    • The HTML glob only appears on the first scan, after which XSane produces exactly what gimp-xsanecli expects
    • There is no newline separating the glob from the expected output on the last line

    So …

    Insert a while loop into the main loop to strip off the HTML glob line by line by line:

            while True:
                    # Wait until XSane prints the name of the scanned file, indicating scanning is finished
                    # This blocks Python but that is ok because GIMP UI is not affected
    
                    # discard HTML header added by scanner to first scan
                    while True :
    
                            result = proc.stdout.readline().strip()
    
                            if r'</body>' in result :
                                    result = result.partition(r'</HTML>')[-1]
                            #        Gimp.message('Found end of HTML: ' + result)
                                    break
    
                            elif 'XSANE_IMAGE_FILENAME:' in result :
                            #        Gimp.message('Found filename: ' + result)
                                    break
    
                            else :
                            #        Gimp.message('Discarding: ' + result)
                                    continue
    
                    if result == '':
                            # XSane was closed
                            break
    
                    if result != 'XSANE_IMAGE_FILENAME: ' + png_out:
                            Gimp.message('Unexpected XSane result: ' + result)
                            return Gimp.ValueArray.new_from_values([GObject.Value(Gimp.PDBStatusType, Gimp.PDBStatusType.EXECUTION_ERROR)])
    
                    # Open image
                    image = Gimp.file_load(Gimp.RunMode.NONINTERACTIVE, Gio.File.new_for_path(png_out))
                    Gimp.Display.new(image)
    
                    # Remove temporary files
                    os.unlink(png_out)
    
                    if not SCAN_MULTIPLE:
                            proc.terminate()
                            break
    
            os.rmdir(tempdir)
    
            return Gimp.ValueArray.new_from_values([GObject.Value(Gimp.PDBStatusType, Gimp.PDBStatusType.SUCCESS), GObject.Value(Gimp.Image.__gtype__, image)])
    
    

    While it’s tempting to absorb the whole thing in one gulp with proc.stdout.read().strip(), that doesn’t work because nothing arrives until the XSane subprocess terminates, which is not what you want.

    A scan to show It Just Works™ :

    I expect it doesn’t work under a variety of common conditions, but … so far so good.

  • Newmowa NP-BX1: Three Years Later

    Newmowa NP-BX1: Three Years Later

    A pair of the 2022 batch of Newmowa NP-BX1 lithium batteries for the Sony AS-30V helmet camera no longer survive a typical hour-long bike ride:

    NP-BX1 - Newmowa 2022 in 2025-06
    NP-BX1 – Newmowa 2022 in 2025-06

    The best four have a capacity down 14% from the good old days and the weakest pair are down 29%.

    The camera uses 1.9 W, so a battery with 2.5 W·hr capacity should last 78 minutes, but about 400 mV of voltage depression causes the camera to give up before using its full capacity.

    So they have a useful lifetime of maybe two years in our regular bike riding schedule and I should have bought replacements last year. I hope the next batch isn’t New Old Stock or recycled cells.

  • Screen Door Handle Repositioning

    Screen Door Handle Repositioning

    For unknown reasons, the handle on the porch screen door was installed less than one finger width from the frame, so I conjured a pair of plastic plates shifting it far enough to prevent finger pinches and avoid the screws for the outside handle:

    Porch door handle repositioning
    Porch door handle repositioning

    The original holes now have M4 threaded wood inserts and the holes in the ¼ inch acrylic have M4 heat-staked brass inserts, mostly because I had everything on hand.

    This was part of a project to trim the bottom of the door to clear the porch floor boards, which evidently continued warping after they trimmed the door to fit:

    Porch door trimming
    Porch door trimming

    That thin blue line suggests the highest part of the floor was once near the bottom of the picture, but it’s now the lowest part. The highest part is now near the hinge side near the top of the picture, firmly jamming the door in place.

    Works great now!

  • Pepper Mill: End of Life

    Pepper Mill: End of Life

    So I finally took our pepper mill apart to see why it was having trouble grinding peppercorns:

    Pepper mill wear
    Pepper mill wear

    It was a wedding present and, nigh onto half a century later, it’s all worn out.

    Its replacement surely won’t survive so long, even with ceramic innards, but I may not notice.

  • SJCAM M50 Trail Camera: Power Supply FAIL

    SJCAM M50 Trail Camera: Power Supply FAIL

    The power supply converting the battery’s raw 6 V into whatever voltage is required by my troublesome SJCAM M50 trail camera failed, despite the replaced wire between the battery and the camera remaining intact. The camera continued to work with 5 V power supplied through its USB-C jack, so I think it can accomplish most of its goals with a USB battery pack nearby.

    Unfortunately, the USB-C jack isn’t accessible with the case closed, so I decided to repurpose the battery compartment’s external 6 V input jack.

    I removed the 000 (0 Ω) SMD “resistor” connecting the battery + terminal to the power supply circuitry and soldered one end of a wire to that pad:

    SJCAM M50 - battery input pad
    SJCAM M50 – battery input pad

    The adjacent 000 “resistor” connects the battery - input terminal to the circuit, so it remains in place.

    The other end of the wire goes to the high side of the +5 V filter caps for the USB-C input:

    SJCAM M50 - USB power input pad
    SJCAM M50 – USB power input pad

    The battery pack produced 6 V from two parallel-ish banks of four AA cells or an external source arriving through a 3.5 / 1.35 mm coaxial power plug, with a Schottky diode dropping 250 mV before reaching the BAT connector in the first picture. The camera seems happy to run from slightly under 5 V.

    Unfortunately, “happy to run” means the camera remains in Setup mode, ready to dump its stored images through the USB port, and won’t take pictures regardless of the switch normally controlling such things. It seems I must either troubleshoot the switching regulator generating the internal power supply voltage(s)or junk the camera.

    I’m not red-hot pleased with the several SJCAM cameras I’ve used, as they seem to feature under-designed durability for their intended use. The fact that SJCAM cameras seem to be on the better side of a bad lot is not comforting.

    I did the probing & doodling during a Squidwrench remote meeting and was assured I would not regret directly applying five volts to the circuit, said with the intonation of this meme:

    You will certainly not regret 67 amps
    You will certainly not regret 67 amps

    Nah, I’ve never done anything like that …

  • HQ Sixteen: Chin Light Failure

    HQ Sixteen: Chin Light Failure

    The COB LED module I stuck under the HQ Sixteen’s chin worked well at first:

    HQ Sixteen Chin Light - results
    HQ Sixteen Chin Light – results

    Last month it began to flicker and I eventually caught it in the act:

    HQ Sixteen Chin Light - first failure
    HQ Sixteen Chin Light – first failure

    That’s taken with the phone’s selfie camera from the quilt’s viewpoint, which is much too close for the camera’s focus, but you get the general idea.

    Pulling it off, putting it on the bench, applying 12 V, and letting it heat up produced this:

    HQ Sixteen Chin Light - hot failure
    HQ Sixteen Chin Light – hot failure

    That’s with the voltage backed off to 8 V to avoid burning out the exposure.

    Letting it cool a bit:

    HQ Sixteen Chin Light - cool failure
    HQ Sixteen Chin Light – cool failure

    You may recall I stuck the aluminum backing plate to the HQ Sixteen’s case aluminum body with some heatsink tape and the thing ran just warm to the touch, so I suspect the initial failure had little-or-nothing to do with overheating and a lot to do with buying stuff from eBay.

    That suspicion is supported by having two more of those in the drawer with their failed chips circled.

    So a better design is in order …

  • Sears Humidifier: Lid Hinge Re-repair

    Sears Humidifier: Lid Hinge Re-repair

    The longsuffering Sears Humidifier that Came With The House once again has functioning hinges:

    Sears Humidifier - lid hinge gluing setup
    Sears Humidifier – lid hinge gluing setup

    That’s the gluing “fixture” with enough steel piled on the lid to keep it from moving and machinist vises pushing / holding the hinge fragments in place.

    I used the same technique as before, with duct tape aligning the loose pieces and JB Plastic Bonder sticking them together:

    Sears Humidifier - right hinge outboard
    Sears Humidifier – right hinge outboard

    The other side of that hinge shows the broken section at the end of the molded void:

    Sears Humidifier - right hinge inboard
    Sears Humidifier – right hinge inboard

    The other hinge has a 3D printed replacement end:

    Sears Humidifier - left hinge inboard
    Sears Humidifier – left hinge inboard

    The other side shows there’s not much of the original hinge left:

    Sears Humidifier - left hinge outboard
    Sears Humidifier – left hinge outboard

    I very carefully installed the lid on the newly cleaned humidifier in the Basement Shop, where it flips up and down like anything.

    At the start of this year’s humidification season, I will very carefully carry the lid up the basement stairs to the Sewing Room and we’ll see how long it survives in actual use.