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: Software

General-purpose computers doing something specific

  • Closing the Dmesg Audit Firehose

    I’m not entirely clear what’s being audited in the Manjaro Linux boxes I’ve recently set up, nor what the difference between res=success and res=failed might mean for the x11vnc unit:

    [   98.632347] audit: type=1131 audit(1594859418.419:110): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=x11vnc comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
    [   98.632348] audit: audit_lost=46 audit_rate_limit=0 audit_backlog_limit=64
    [   98.632349] audit: kauditd hold queue overflow
    [   98.649743] audit: type=1130 audit(1594859418.433:111): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=x11vnc comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'
    [   98.649745] audit: audit_lost=47 audit_rate_limit=0 audit_backlog_limit=64
    [   98.649746] audit: kauditd hold queue overflow
    [  100.515527] audit: type=1101 audit(1594859420.299:112): pid=843 uid=1000 auid=1000 ses=2 msg='op=PAM:accounting grantors=pam_unix,pam_permit,pam_time acct="ed" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/0 res=success'

    That’s the better part of two seconds in the life of the box and, later on, the pace picks up. Casual searching suggests nobody else knows what’s going on, either, apart from the fact than that it obviously has something to do with systemd and, thus, is just the way things are these days.

    Add audit=off to the default kernel command-line parameters by editing /etc/default/grub thusly:

    GRUB_CMDLINE_LINUX_DEFAULT="quiet resume=UUID=whatever udev.log_priority=3 audit=off"

    Then update the bootloader:

    sudo grub-mkconfig -o /boot/grub/grub.cfg 

    Whereupon dmesg becomes all quiet and (mostly) meaningful to this civilian.

  • Copying All! The! Files! (Except Some)

    All our data files spin around on a nearly full 1 TB drive in a “file server”, a grandiosely overqualified and dirt-cheap off-lease Dell Optiplex desktop sitting in the basement. It’s been running headless and unattended for the last half-dozen years and is badly in need of replacement, so I must copy all its files to a newer, even more overqualified, and equally cheap off-lease Optiplex.

    Copying the files from the /mnt/music collection on the existing server to the identically named directory on the new server proceeds thusly:

    sudo mount -o ro fileserver.local:/mnt/music /mnt/nfs
    sudo rsync -ahu --progress --log-file=/tmp/music.log \
     --exclude="/lost+found" \
     --exclude=".Trash*" \
     --exclude=".dtrash*" \
     --delete \
     /mnt/nfs/ /mnt/music

    Mount the existing collection (from the old server) in read-only mode to avoid heartache subsequent to confusion. It could happen.

    The first time through, add a -n option for a dry run, then inspect the log file for surprises.

    The various --exclude options avoid copying trashed-but-not-yet-deleted files from the various trash directories maintained by various file handlers. In the process of sorting this out, I learned the DigiKam photo manager creates a .dtrash directory holding deleted files for each of its Album listings, appearing down near the bottom of the top-level album wherein you’ve quasi-deleted photos via “Move to Trash”.

    The --delete option removes files on the destination (new disk) if they’re not on the source (old disk). I started this migration earlier this year, before the world fell apart, and have moved / consolidated / renamed various directories & files in the interim, so deleting the previous copies from their old locations makes the destination match the source.

    So far, so good …

  • Bathroom Door Retainer: Bigger and Stronger

    Bathroom Door Retainer: Bigger and Stronger

    After three years, the retainer holding the front bathroom door open against winds blowing through the house on stormy days finally fractured, right at the top of the towel rack where you’d expect it:

    Bathroom Door Retainer - fractured
    Bathroom Door Retainer – fractured

    I was all set to add reinforcing pins and whatnot, then came to my senses and just made the whole thing a few millimeters larger:

    Bathroom Door Retainer - stronger
    Bathroom Door Retainer – stronger

    Customer feedback indicates white blends better with the background.

    I made a few minor tweaks to the original design, including slightly larger bumps to hold it against the towel bar that, regrettably, put corresponding gouges into the bar. Who knew they used such soft plastic back in the day?

    The OpenSCAD source code as a GitHub Gist:

    // Bathroom Door Retainer
    // Ed Nisley KE4ZNU – May 2017
    // 2020-07 beef up, particularly at top of bar
    Layout = "Show"; // [Show, Build]
    //——-
    //- Extrusion parameters must match reality!
    /* [Hidden] */
    ThreadThick = 0.20;
    ThreadWidth = 0.40;
    HoleWindage = 0.2;
    Protrusion = 0.1; // make holes end cleanly
    function IntegerMultiple(Size,Unit) = Unit * ceil(Size / Unit);
    //——-
    // Dimensions
    /* [Dimensions] */
    TowelBarSide = 20.5; // towel bar across flat side
    TowelBarAngle = 45; // rotation of top flat from horizontal
    BumpOD = 2.0; // retaining ball
    DoorOffset = 14.0; // from towel bar to door
    DoorThick = 37.0;
    WallThick = 8.0; // minimum wall thickness
    PlateThick = 4.0; // … slab
    RetainerDepth = 15.0; // thickness of retaining notch
    NumSides = 6*4;
    CornerRad = WallThick;
    BarClipOD = TowelBarSide*sqrt(2) + 2*WallThick;
    BarClipRad = BarClipOD/2;
    OAH = RetainerDepth + PlateThick;
    module LatchPlan() {
    union() {
    linear_extrude(height=OAH,convexity=4)
    difference() {
    union() {
    circle(d=BarClipOD,$fn=NumSides);
    hull()
    for (i=[0,1], j=[0,1])
    translate([i*(BarClipRad + DoorOffset + DoorThick + WallThick – CornerRad),j*(BarClipRad – CornerRad)])
    circle(r=CornerRad,$fn=4*4);
    }
    rotate(TowelBarAngle) // towel bar shape
    square(size=TowelBarSide,center=true);
    translate([0,-TowelBarSide/sqrt(2)]) // make access slot
    rotate(-TowelBarAngle)
    square(size=[2*TowelBarSide,TowelBarSide],center=false);
    }
    for (a=[0:180:360])
    rotate(a + TowelBarAngle)
    translate([TowelBarSide/2,0,OAH/2])
    rotate([90,0,45])
    sphere(d=BumpOD,$fn=4*3);
    }
    }
    module Latch() {
    difference() {
    LatchPlan();
    translate([BarClipRad + DoorOffset,-BarClipRad/2,-Protrusion])
    cube([DoorThick,BarClipOD,RetainerDepth + Protrusion],center=false);
    }
    }
    //——-
    // Build it!
    if (Layout == "Show") {
    Latch();
    }
    if (Layout == "Build") {
    translate([0,0,OAH])
    rotate([180,0,0])
    Latch();
    }

    Done!

  • Manjaro Linux vs. Dell Latitude E7250 Bluetooth

    Manjaro Linux vs. Dell Latitude E7250 Bluetooth

    Although the Dell Latitude E7250 allegedly had Bluetooth capability and the Blueman applet tried connecting to my Bluetooth headsets, the connection aways failed and nothing worked. There’s a WLAN module stuck in an M.2 socket inside the laptop providing both WiFi and Bluetooth:

    Dell E7250 - DW1560 card in place
    Dell E7250 – DW1560 card in place

    A bit of searching suggested the driver wasn’t loading properly, which became obvious after I knew where to look:

    dmesg | grep -i blue
    … snippage …
    [    5.678610] Bluetooth: hci0: BCM20702A1 (001.002.014) build 1572
    [    5.678851] bluetooth hci0: Direct firmware load for brcm/BCM20702A1-0a5c-216f.hcd failed with error -2
    [    5.678853] Bluetooth: hci0: BCM: Patch brcm/BCM20702A1-0a5c-216f.hcd not found
    [   10.854607] Bluetooth: RFCOMM TTY layer initialized
    [   10.854613] Bluetooth: RFCOMM socket layer initialized
    [   10.854619] Bluetooth: RFCOMM ver 1.11

    Without having the proper firmware / patch loaded, the module won’t work, even though the TTY / socket layers know it’s present, which explains why Blueman did everything except actually connect to the headsets.

    More searching suggested you must extract the firmware HEX file from the Windows driver. Feeding the Service Tag into the Dell support site, then feeding “Bluetooth” and “Windows 8.1, 64-bit” (preinstalled on the laptop) into the Drivers & Downloads tab gets you the relevant EXE file: Dell Wireless 1550/1560 Wi-Fi and Bluetooth Driver. It turns out to be a self-extracting ZIP file (in Windows, anyway), so unzip it all by yourself:

    unzip Network_Driver_5DFVH_WN32_6.30.223.262_A03.EXE

    This produces a blizzard of HEX files in the newly created Drivers/production/Windows8.1-x64 directory. Each firmware HEX file is keyed to the USB Product Code identifying the unique USB gadget, found with lsusb:

    lsusb
    … snippage …
    Bus 002 Device 003: ID 0a5c:216f Broadcom Corp. BCM20702A0 Bluetooth
    … snippage …

    The DW1560 apparently has a USB RAM interface, with the specific HEX file identified in the CopyList stanza of the INF file corresponding to that USB Product Code:

    grep -i -A 5  ramusb216f.copylist Drivers/production/Windows8.1-x64/bcbtums-win8x64-brcm.inf
    [RAMUSB216F.CopyList]
    bcbtums.sys
    btwampfl.sys
    BCM20702A1_001.002.014.1443.1572.hex
    … snippage …

    However, the Linux firmware loader needs a different file format with a different name, mashed together from the HEX file, USB Vendor, and USB Product codes:

    hex2hcd -o BCM20702A1-0a5c-216f.hcd BCM20702A1_001.002.014.1443.1572.hex

    The converted firmware file goes where the loader expected to find it:

    sudo cp BCM20702A1-0a5c-216f.hcd /lib/firmware/brcm/

    Whereupon next reboot sorted things out:

    dmesg | grep -i blue
    [    6.024838] Bluetooth: Core ver 2.22
    [    6.024868] Bluetooth: HCI device and connection manager initialized
    [    6.024872] Bluetooth: HCI socket layer initialized
    [    6.024874] Bluetooth: L2CAP socket layer initialized
    [    6.024881] Bluetooth: SCO socket layer initialized
    [    6.100796] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
    [    6.100800] Bluetooth: BNEP filters: protocol multicast
    [    6.100804] Bluetooth: BNEP socket layer initialized
    [    6.157114] Bluetooth: hci0: BCM: chip id 63
    [    6.158125] Bluetooth: hci0: BCM: features 0x07
    [    6.176119] Bluetooth: hci0: BCM20702A
    [    6.177114] Bluetooth: hci0: BCM20702A1 (001.002.014) build 0000
    [    7.031228] Bluetooth: hci0: BCM20702A1 (001.002.014) build 1572
    [    7.047177] Bluetooth: hci0: DW1560 Bluetooth 4.0 LE
    [   13.141854] Bluetooth: RFCOMM TTY layer initialized
    [   13.141865] Bluetooth: RFCOMM socket layer initialized
    [   13.141872] Bluetooth: RFCOMM ver 1.11

    The firmware may be in one of the myriad Bluetooth packages not installed by default, so perhaps identifying & installing the proper package would sidestep the hocus-pocus.

    Maybe next time?

    Now I can wear my Bose Hearphones in Zoom sessions with the E7250, because my Pixel 3a phone heats up almost to the gets-bendy level while thrashing its battery to death.

  • JPG Recovery From a Camera FAT Filesystem

    JPG Recovery From a Camera FAT Filesystem

    You can do it by hand, as I used to, or use recoverjpeg:

    dmesg | tail
    cd /tmp
    sudo dcfldd if=/dev/sde1 of=pix.bin bs=1M count=100
    recoverjpeg pix.bin 
    ristretto image00*
    

    Nothing prizewinning, but better than no picture at all:

    Garage Robin - recovered image
    Garage Robin – recovered image

    Note that you start by copying a reasonable chunk of the partition from the Memory Stick / (micro)SD Card first, to prevent a bad situation from getting worse.

    Now I can remember the easy way the next time around this block …

  • Solid Modeling: Support Puzzle

    Solid Modeling: Support Puzzle

    I’ve been putting this type of support structure inside screw holes & suchlike for years:

    Browning Hi-Power Magazine Block - solid model - Generic 1 - support detail
    Browning Hi-Power Magazine Block – solid model – Generic 1 – support detail

    It’s basically a group of small rectangles rotated around the hole’s axis and about one thread thickness shorter than the overhanging interior.

    I’ve found that incorporating exactly the right support structure eliminates Slic3r’s weird growths, eases removal, and generally works better all around.

    So doing this for the baseplate of the Glass Tile frame came naturally:

    Glass Tile Frame - octagonal support
    Glass Tile Frame – octagonal support

    This OpenSCAD snippet plunks one of those asterisks in each of four screw holes:

      if (Support)
        color("Yellow")
          for (i=[-1,1], j=[-1,1])
            translate([i*InsertOC.x/2,j*InsertOC.y/2,0])
              for (a=[0:45:135])
                  rotate(a)
                    translate([0,0,(Screw[LENGTH] - ThreadThick)/2])
                      cube([Screw[OD] - 2*ThreadWidth,2*ThreadWidth,Screw[LENGTH] - ThreadThick],center=true);

    The “cubes” overlap in the middle, with no completely coincident faces or common edges, so it’s 2-manifold. Slic3r, however, produces a weird time estimate whenever the model includes those structures:

    Slic3r - NaN time estimate
    Slic3r – NaN time estimate

    NaN stands for Not A Number and means something horrible has happened in the G-Code generation. Fortunately, the G-Code worked perfectly and produced the desired result, but I’m always uneasy when Something Seems Wrong.

    Messing around with the code produced a slightly different support structure:

    Glass Tile Frame - quad support
    Glass Tile Frame – quad support

    The one thread thick square on the bottom helps glue the structure to the platform and four ribs work just as well as eight in the octagonal hole:

      Fin = [Screw[OD]/2 - 1.5*ThreadWidth,2*ThreadWidth,ScrewRecess - ThreadThick];
      if (Inserts && SupportInserts)
        color("Yellow")
          for (i=[-1,1], j=[-1,1])
            translate([i*InsertOC.x/2,j*InsertOC.y/2,0]) {
              rotate(180/8)
                cylinder(d=6*ThreadWidth,h=ThreadThick,$fn=8);
              for (a=[0:90:360])
                  rotate(a)
                    translate([Fin.x/2 + ThreadWidth/2,0,(ScrewRecess - ThreadThick)/2])
                      cube(Fin,center=true);
            }

    Which changed the NaN time estimates into actual numbers.

    One key difference may be the small hole in the middle. The four ribs (not two!) now overlap by one thread width around the hole, so they’re not quite coincident and Slic3r produces a tidy model:

    Glass Tile Frame - quad support - Slic3r
    Glass Tile Frame – quad support – Slic3r

    The hole eliminates a smear of infill from the center, which may have something to do with the improvement.

    In any event, I have an improved copypasta recipe for the next screw holes in need of support, even if I don’t understand why it’s better.

  • Glass Tiles: Matrix for SK6812 PCBs

    Glass Tiles: Matrix for SK6812 PCBs

    Tweaking the glass tile frame for press-fit SK6812 PCBs in the bottom of the array cells:

    Glass Tile Frame - cell array - openscad
    Glass Tile Frame – cell array – openscad

    Which looks like this with the LEDs and brass inserts installed:

    Glass Tile - 2x2 array - interior
    Glass Tile – 2×2 array – interior

    The base holds an Arduino Nano with room for wiring under the cell array:

    Glass Tile Frame - base - openscad
    Glass Tile Frame – base – openscad

    Which looks like this after it’s all wired up:

    Glass Tile - 2x2 array - wiring
    Glass Tile – 2×2 array – wiring

    The weird colors showing through the inserts are from the LEDs. The red thing in the upper left is a silicone insulation snippet. Yes, that’s hot-melt glue holding the Arduino Nano in place and preventing the PCBs from getting frisky.

    Soak a handful of glass tiles overnight in paint stripper:

    Glass Tiles - paint stripper soak
    Glass Tiles – paint stripper soak

    Whereupon the adhesive slides right off with the gentle application of a razor scraper. Rinse carefully, dry thoroughly, and snap into place.

    Tighten the four M3 SHCS and it’s all good:

    Glass Tile - 2x2 array - operating
    Glass Tile – 2×2 array – operating

    So far, I’ve had two people tell me they don’t know what it is, but they want one:

    Glass Tile - various versions
    Glass Tile – various versions

    The OpenSCAD Customizer lets you set the array size:

    Glass Tile Frame - 3x3 - press-fit SK6812 LEDs
    Glass Tile Frame – 3×3 – press-fit SK6812 LEDs

    However, just because you can do something doesn’t mean you should:

    Glass Tile Frame - 6x6 cell array - openscad
    Glass Tile Frame – 6×6 cell array – openscad

    Something like this might be interesting:

    Glass Tile Frame - 2x6 cell array - openscad
    Glass Tile Frame – 2×6 cell array – openscad

    In round numbers, printing the frame takes about an hour per cell, so a 2×2 array takes three hours and 3×3 array runs around seven hours. A 6×6 frame is just not happening.

    The OpenSCAD source code as a GitHub Gist:

    // Illuminated Tile Grid
    // Ed Nisley – KE4ZNU
    // 2020-05
    /* [Configuration] */
    Layout = "Build"; // [Cell,CellArray,MCU,Base,Show,Build]
    Shape = "Square"; // [Square, Pyramid, Cone]
    Cells = [2,2];
    CellDepth = 15.0;
    Inserts = true;
    SupportInserts = true;
    /* [Hidden] */
    ThreadThick = 0.25;
    ThreadWidth = 0.40;
    HoleWindage = 0.2;
    function IntegerMultiple(Size,Unit) = Unit * ceil(Size / Unit);
    Protrusion = 0.1; // make holes end cleanly
    ID = 0;
    OD = 1;
    LENGTH = 2;
    Tile = [25.0 + 0.1,25.0 + 0.1,4.0];
    WallThick = 4*ThreadWidth;
    FloorThick = 3.0;
    Flange = [2*ThreadWidth,2*ThreadWidth,0]; // ridge supporting tile
    Separator = [3*ThreadWidth,3*ThreadWidth,Tile.z – 1]; // between tiles
    Screw = [3.0,6.0,3.5]; // M3 SHCS, OD=head, LENGTH=head
    Insert = [3.0,4.2,8.0]; // threaded brass insert
    ScrewRecess = Screw[LENGTH] + 4*ThreadThick;
    LEDPCB = [9.6,9.6,2.9]; // round SK6812, squared-off sides
    LED = [5.0 + 2*HoleWindage,5.0 + 2*HoleWindage,1.3];
    LEDOffset = [0.0,0.0,0.0]; // if offset from PCB center
    CellOAL = [Tile.x,Tile.y,0] + Separator + [0,0,CellDepth] + [0,0,FloorThick];
    ArrayOAL = [Cells.x*CellOAL.x,Cells.y*CellOAL.y,CellOAL.z]; // just the LED cells
    BlockOAL = ArrayOAL + [2*WallThick,2*WallThick,0]; // LED cells + exterior wall
    echo(str("Block OAL: ",BlockOAL));
    InsertOC = ArrayOAL – [Insert[OD],Insert[OD],0] – [WallThick,WallThick,0];
    echo(str("Insert OC: ",InsertOC));
    TapeThick = 1.0;
    Arduino = [44.0,18.0,8.0 + TapeThick]; // Arduino Nano to top of USB Mini-B plug
    USBPlug = [15.0,11.0,9.0]; // USB Mini-B plug insulator
    USBOffset = [0,0,5.0]; // offset from PCB base
    WiringSpace = 3.5;
    WiringBay = [(Cells.x – 1)*CellOAL.x + LEDPCB.x,(Cells.y – 1)*CellOAL.y + LEDPCB.x,WiringSpace];
    PlateOAL = [BlockOAL.x,BlockOAL.y,FloorThick + Arduino.z + WiringSpace]; // allow wiring above Arduino
    echo(str("Base Plate: ",PlateOAL));
    echo(str("Screw length: ",(PlateOAL.z – ScrewRecess) + Insert.z/2," to ",(PlateOAL.z – ScrewRecess) + Insert.z));
    LegendRecess = 1*ThreadThick;
    //————————
    module PolyCyl(Dia,Height,ForceSides=0) { // based on nophead's polyholes
    Sides = (ForceSides != 0) ? ForceSides : (ceil(Dia) + 2);
    FixDia = Dia / cos(180/Sides);
    cylinder(d=(FixDia + HoleWindage),h=Height,$fn=Sides);
    }
    //———————–
    // Base and optics in single tile
    module LEDCone() {
    hull() {
    translate([0,0,CellDepth + Tile.z/2])
    cube(Tile – 2*[Flange.x,Flange.y,0],center=true);
    if (Shape == "Square") {
    translate([0,0,LEDPCB.z/2])
    cube([Tile.x,Tile.y,LEDPCB.z] – 2*[Flange.x,Flange.y,0],center=true);
    }
    else if (Shape == "Pyramid") {
    translate([0,0,LEDPCB.z/2])
    cube(LEDPCB,center=true);
    }
    else if (Shape == "Cone") {
    translate([0,0,LEDPCB.z/2])
    cylinder(d=1.0*LEDPCB.x,h=LED.z,center=true);
    }
    else {
    echo(str("Whoopsie! Invalid Shape: ",Shape));
    cube(5);
    }
    }
    }
    // One complete LED cell
    module LEDCell() {
    difference() {
    translate([0,0,CellOAL.z/2])
    cube(CellOAL + [Protrusion,Protrusion,0],center=true); // force overlapping adjacent sides!
    translate([0,0,CellOAL.z – Separator.z + Tile.z/2])
    cube(Tile,center=true);
    translate([0,0,LEDPCB.z])
    LEDCone();
    // cube([LED.x,LED.y,CellOAL.z],center=true);
    translate(-LEDOffset + [0,0,-CellOAL.z/2])
    rotate(180/8)
    PolyCyl(LEDPCB.x,CellOAL.z,8);
    }
    }
    // The whole array of cells
    module CellArray() {
    difference() {
    union() {
    translate([CellOAL.x/2 – Cells.x*CellOAL.x/2,CellOAL.y/2 – Cells.y*CellOAL.y/2,0])
    for (i=[0:Cells.x – 1], j=[0:Cells.y – 1])
    translate([i*CellOAL.x,j*CellOAL.y,0])
    LEDCell();
    if (Inserts) // bosses
    for (i=[-1,1], j=[-1,1])
    translate([i*InsertOC.x/2,j*InsertOC.y/2,0])
    rotate(180/8)
    cylinder(d=Insert[OD] + 2*WallThick,h=Insert[LENGTH],$fn=8);
    }
    if (Inserts) // holes
    for (i=[-1,1], j=[-1,1])
    translate([i*InsertOC.x/2,j*InsertOC.y/2,-Protrusion])
    rotate(180/8)
    PolyCyl(Insert[OD],Insert[LENGTH] + FloorThick + Protrusion,8);
    }
    difference() {
    translate([0,0,CellOAL.z/2])
    cube(BlockOAL,center=true);
    translate([0,0,CellOAL.z])
    cube(ArrayOAL + [0,0,2*CellOAL.z],center=true);
    }
    }
    // Arduino bounding box
    // Origin at center bottom of PCB
    module Controller() {
    union() {
    translate([0,0,Arduino.z/2])
    cube(Arduino,center=true);
    translate([Arduino.x/2 – Protrusion,-USBPlug.y/2,USBOffset.z + TapeThick – USBPlug.z/2])
    cube(USBPlug + [Protrusion,0,0],center=false);
    }
    }
    // Baseplate
    module BasePlate() {
    difference() {
    translate([0,0,PlateOAL.z/2])
    cube(PlateOAL,center=true);
    translate([PlateOAL.x/2 – Arduino.x/2 – 2*WallThick,0,FloorThick])
    Controller();
    translate([PlateOAL.x/2 – Arduino.x/2 – 2*WallThick,0,FloorThick + PlateOAL.z/2])
    cube([Arduino.x – 2*2.0,WiringBay.y,PlateOAL.z],center=true); // cutouts beside MCU
    translate([0,0,PlateOAL.z – WiringBay.z + PlateOAL.z/2 – Protrusion])
    cube([PlateOAL.x – 2*WallThick,WiringBay.y,PlateOAL.z],center=true); // cutout above MCU
    translate([0,0,PlateOAL.z – WiringBay.z + PlateOAL.z/2 – Protrusion])
    cube([WiringBay.x,PlateOAL.y – 2*WallThick,PlateOAL.z],center=true); // cutout above MCU
    if (Inserts)
    for (i=[-1,1], j=[-1,1])
    translate([i*InsertOC.x/2,j*InsertOC.y/2,-Protrusion])
    rotate(180/8) {
    PolyCyl(Screw[ID],2*PlateOAL.z,8);
    PolyCyl(Screw[OD],ScrewRecess + Protrusion,8);
    }
    cube([45,17.0,2*LegendRecess],center=true);
    }
    linear_extrude(height=2*LegendRecess) {
    translate([0,1])
    rotate(-0*90) mirror([1,0,0])
    text(text="Ed Nisley",size=6,font="Arial:style:Bold",halign="center");
    translate([0,-6.5])
    rotate(-0*90) mirror([1,0,0])
    text(text="softsolder.com",size=4.5,font="Arial:style:Bold",halign="center");
    }
    Fin = [Screw[OD]/2 – 1.5*ThreadWidth,2*ThreadWidth,ScrewRecess – ThreadThick];
    if (Inserts && SupportInserts)
    color("Yellow")
    for (i=[-1,1], j=[-1,1])
    translate([i*InsertOC.x/2,j*InsertOC.y/2,0]) {
    rotate(180/8)
    cylinder(d=6*ThreadWidth,h=ThreadThick,$fn=8);
    for (a=[0:90:360])
    rotate(a)
    translate([Fin.x/2 + ThreadWidth/2,0,(ScrewRecess – ThreadThick)/2])
    cube(Fin,center=true);
    }
    }
    //———————–
    // Build things
    if (Layout == "Cell")
    LEDCell();
    else if (Layout == "CellArray")
    CellArray();
    else if (Layout == "MCU")
    Controller();
    else if (Layout == "Base")
    BasePlate();
    else if (Layout == "Show") {
    translate([0,0,3*PlateOAL.z])
    CellArray();
    BasePlate();
    translate([PlateOAL.x/2 – Arduino.x/2 – 2*WallThick,0,FloorThick])
    color("Orange",0.3)
    Controller();
    }
    else if (Layout == "Build") union() {
    translate([0,0.6*BlockOAL.y,0])
    CellArray();
    translate([0,-0.6*BlockOAL.x,0])
    rotate(90)
    BasePlate();
    }