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: PC Tweakage

Remembering which tweaks worked

  • Huion Tablet USB Cable Realignment

    Huion Tablet USB Cable Realignment

    The Huion tablet on my desk has its USB cable sticking straight out of the left side, whereupon it must loop around to burrow under the shelf under my monitor on its way to the port on the back of the PC case. The loop snagged on all the clutter atop the desk and I finally got around to Fixing That Problem:

    Huion tablet - rerouted USB cable
    Huion tablet – rerouted USB cable

    Of course, it wasn’t quite that simple.

    Right angle USB Mini-B connectors are still a thing:

    Huion tablet - USB angle adapters
    Huion tablet – USB angle adapters

    Which is a “left angle” adapter and which is a “right angle” adapter depends on which supplier you ask and how much you trust their descriptions / product photos, so you should get a set containing both: it’s the only way to be sure.

    The one on the right (a “right angle”) shows a bit of carving, which came after the completely unsurprising discovery that the stylin’ curves on the side of the tablet collided with the rectangular adapter:

    Huion tablet - misfit adapter
    Huion tablet – misfit adapter

    Some diligent X-Acto knife work carved away enough of both the adapter and the tablet case to snugly join them:

    Huion tablet - plastic surgery
    Huion tablet – plastic surgery

    The hackery over on the far right fits around the USB cable’s molded connector. I simply cut away any parts that touched until the adapter seated firmly in the USB socket and the cable exited parallel to the edge.

    Part of this involved not carving deeply enough into the adapter or cable connector to expose the internal wiring. I assumed the tablet didn’t have anything vital immediately inside that fancy curve, so that’s where I dug deepest.

    Stick adapter + cable to the tablet with good-quality electrical tape and now the cable points directly to where it should go.

    Declare victory and move on!

  • Raspberry Pi: WLAN to Wired Network

    Raspberry Pi: WLAN to Wired Network

    The CNC-3018XL and MPCNC machines each have a Raspberry Pi feeding G-Code into an Arduino clone controlling the stepper motors. The former grew a USB WiFi interface in place of its internal WiFi hardware when it seemed to have difficulty connecting to the house router, while the latter pretty much worked. Of late, however, I’ve been trying to reduce the number of WiFi devices cluttering the airwaves, with the result of wiring both machines to an old Ethernet switch from the Box o’ Network Stuff:

    LinkSys Switch for CNC machines
    LinkSys Switch for CNC machines

    The blue puck is the KVM button to select one of the machines for the keyboard / mouse / monitor on the bench.

    One key point I generally screw up: the WiFi IP address cannot become the wired IP address without rebooting everything else on the network. Instead, just change the IP addresses and be done with it.

    Collecting all the pieces in one place:

    Disable the both internal WiFi hardware and Bluetooth in /boot/config.txt, thereby eliminating the need to force the WiFi down in /etc/rc.local:

    dtoverlay=pi3-disable-wifi
    dtoverlay=pi3-disable-bt
    

    Define the static IP address in /etc/dhcpcd.conf:

    interface eth0
    static ip_address=192.168.1.34/24
    static routers=192.168.1.1
    static domain_name_servers=192.168.1.2
    

    Kill IPV6 activity in /etc/sysctl.conf:

    net.ipv6.conf.all.disable_ipv6=1
    

    I very much doubt this information is either complete or correct, but it serves the purpose as of early 2022.

  • XFCE: Remote Desktop via X11vnc Through an SSH Tunnel

    For the first time in a loooong time I (had to) set up remote desktop sharing, starting from an existing SSH login through a single-port pinhole in an immutable router firewall.

    The remote PC runs Xubuntu 20.4 LTS and I verified it already had x11vnc installed. If that’s not the case, make it so.

    In order to share / control the desktop of a different user (hereinafter known as kay), I must SSH into that PC as kay. My SSH session uses public key authentication and kay has no need for outbound SSH, so just use my PC’s public key in kay‘s authorized_keys file. On the remote PC, where I am signed in as me:

    cd ~
    sudo mkdir /home/kay/.ssh        # kay does not have a public key
    sudo cp .ssh/authorized_keys /home/kay/.ssh     # so just copy mine
    sudo chown -R kay:kay /home/kay/.ssh     # transfer ownership
    sudo chmod go-rwx /home/kay/.ssh     # set proper permissions
    

    From my local PC, I can now SSH into the remote PC as kay and start x11vnc through the SSH tunnel:

    ssh -v kay@remote.address -L 5900:localhost:5900 "x11vnc -display :0 -noxdamage -ncache 10 -ncache_cr -nopw"
    

    Still on my PC, aim a VNC client at the local end of the tunnel:

    novnc localhost:5900
    

    Using novnc presents the remote desktop as a web page in a browser, although you may prefer something more traditional.

    Somewhat to my surprise, It Just Worked™.

  • Clearing the Noto Font Clutter: Again

    Installing Atkinson Hyperlegible reminded me to clear out the Noto font clutter in this (relatively nerecentw) Manjaro installation. Of course fonts now appear in slightly different locations with slightly different names, so this remains just a serving suggestion:

    cd /usr/share/fonts/noto
    sudo chmod a-w NotoSans-*
    sudo chmod a-w NotoSansMono*
    sudo chmod a-w NotoSansDisplay*
    sudo chmod a-w NotoSansMath*
    sudo chmod a-w NotoSansSymbol*
    sudo chmod a-w NotoSerif-*
    sudo chmod a-w NotoSerifDisplay*
    sudo chmod a-w NotoMusic*
    sudo chmod a-w NotoMath*
    sudo find . -perm /u=w -name \*ttf -delete
    

    Get rid of some other clutter:

    cd ../TTF
    sudo chmod a-w DejaVu*
    sudo chmod a-w Inconsolata-*
    sudo find . -perm /u=w -name \*ttf -delete
    cd ../droid
    sudo chmod a-w DroidSans-Bold.ttf 
    sudo chmod a-w DroidSans.ttf 
    sudo chmod a-w DroidSansFallback*
    sudo chmod a-w DroidSansMono.ttf 
    sudo chmod a-w DroidSerif-*
    cd ../adobe-source-han-sans
    sudo rm *otf
    

    For unknown reasons, we now have two font cache updaters:

    sudo fc-cache -v -f
    sudo fc-cache-32 -v -f
    

    Now font selection in, say, LibreOffice doesn’t involve paging through a myriad fonts in languages I cannot recognize, let alone read. Admittedly, Inconsolata does have more variations than I’ll ever use.

  • Naming Is Hard

    A recent update to the X Windowing System (or whatever it’s called) once again changed the names of its monitors / displays / output devices, so that my startup script no longer confined the tablet to the landscape display.

    In mostly reverse chronological order, here are various commands I’ve puzzled out:

    #xsetwacom --verbose set "HUION Huion Tablet stylus" MapToOutput "DP1-8"
    xsetwacom --verbose set "HUION Huion Tablet stylus" MapToOutput "DP-1-8"
    #xsetwacom --verbose set "HUION Huion Tablet Pen stylus" MapToOutput "DP-1"
    #xsetwacom --verbose set "Wacom Graphire3 6x8 Pen stylus" MapToOutput "DP-1"
    #xsetwacom --verbose set "Wacom Graphire3 6x8 Pen stylus" MapToOutput "HEAD-0"
    #xsetwacom --verbose set "Wacom Graphire3 6x8 Pen eraser" MapToOutput "DP-1"
    #xsetwacom --verbose set "Wacom Graphire3 6x8 Pen eraser" MapToOutput "HEAD-0"
    

    Over the last two years, the display name changed from DP-1 to DP-1-8 to DP1-8, and back to DP-1-8. I grew accustomed to this with the Wacom tablet (HEAD-0‽)and now know where to look, but I still have no idea of the motivation.

    Aaaand the tablet’s stylus name? The Wacom names were stable, but the Huion names apparently come from the Department of Redundancy Department.

  • KeyboardIO Atreus: LED Diffuser

    KeyboardIO Atreus: LED Diffuser

    After staring at the RGB LED I installed in my Atreus keyboard for a while, I converted the stub of a ¼-20 nylon screw into a light diffuser:

    Atreus keyboard - LED diffuser
    Atreus keyboard – LED diffuser

    It stands slightly proud of the surface plate so I can extract it without dismantling the whole keyboard again:

    Atreus keyboard - LED diffuser installed
    Atreus keyboard – LED diffuser installed

    I’ll eventually make a better-looking diffuser from a recently arrived translucent acrylic rod, but this will reduce the accumulation of fuzz inside the keyboard until the matching Round Tuit arrives.

  • KeyboardIO Atreus: RGB LED Installation

    KeyboardIO Atreus: RGB LED Installation

    Having scouted out the territory inside the KeyboardIO Atreus, adding an LED requires taking it completely apart to drill a hole in the aluminum faceplate:

    Atreus keyboard - panel drilling
    Atreus keyboard – panel drilling

    Reattaching the plate to the PCB with only three screws allows marking the hole position on the PCB, which is much easier than pretending to derive the position from first principles:

    Atreus keyboard - LED marking
    Atreus keyboard – LED marking

    Despite appearances, I traced the hole with a mechanical pencil: black graphite turns shiny silvery gray against matte black soldermask. Also, the PCB trace is off-center, not the hole.

    Overlay the neighborhood with Kapton tape to protect the PCB from what comes next:

    Atreus keyboard - Kapton tape

    Snip a WS2812 RGB LED from a strip, stick it in place with eyeballometric alignment over the target, and wire it up:

    Atreus keyboard - LED wiring
    Atreus keyboard – LED wiring

    Despite the terrible reliability of WS2812 RGB LEDs mounted on PCB carriers, a different set on a meter of high-density flex tape have worked reasonably well when not thermally stressed, so I’ll assume this one arrived in good order.

    Aligning the LED directly under the hole required a few iterations:

    Atreus keyboard - LED positioning
    Atreus keyboard – LED positioning

    The iridescent green patch is a diffraction pattern from the controller chip’s internal circuitry.

    The data comes from MOSI, otherwise known as B2, down in the lower left corner:

    Atmel 32U4 - JTAG pins
    Atmel 32U4 – JTAG pins

    Actually lighting the LED now becomes a simple matter of software QMK firmware.