Archive for category PC Tweakage

Kinesis Freestyle2 Keyboard: Linux Fix

Someone who found my original post about the Freestyle2’s dysfunctional media keys came up with a fix:

Kinesis Freestyle2 Media Keys

Kinesis Freestyle2 Media Keys

Some notes for the next time this comes up:

After doing sudo modprobe uinput, lsmod | grep uinp returns nothing at all (Xubuntu 16.04), but evtest seems perfectly happy:

sudo evtest /dev/input/event17
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x58f product 0x9410 version 0x0
Input device name: "KB800 Kinesis Freestyle"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 113 (KEY_MUTE)
    Event code 114 (KEY_VOLUMEDOWN)
    Event code 115 (KEY_VOLUMEUP)
    Event code 140 (KEY_CALC)
Testing ... (interrupt to exit)
Event: time 1518199358.454619, type 1 (EV_KEY), code 113 (KEY_MUTE), value 1
Event: time 1518199358.454619, -------------- SYN_REPORT ------------
Event: time 1518199358.454638, type 1 (EV_KEY), code 113 (KEY_MUTE), value 0
Event: time 1518199358.454638, -------------- SYN_REPORT ------------
Event: time 1518199361.014681, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 1
Event: time 1518199361.014681, -------------- SYN_REPORT ------------
Event: time 1518199361.014699, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 0
Event: time 1518199361.014699, -------------- SYN_REPORT ------------
Event: time 1518199361.654701, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 1
Event: time 1518199361.654701, -------------- SYN_REPORT ------------
Event: time 1518199361.654721, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 0
Event: time 1518199361.654721, -------------- SYN_REPORT ------------
Event: time 1518199362.294715, type 1 (EV_KEY), code 140 (KEY_CALC), value 1
Event: time 1518199362.294715, -------------- SYN_REPORT ------------
Event: time 1518199362.294733, type 1 (EV_KEY), code 140 (KEY_CALC), value 0
Event: time 1518199362.294733, -------------- SYN_REPORT ------------

And the keys work without any special configuration on my part. Apparently they’re already built into XFCE, despite the sound keys not showing up in the Keyboard Shortcuts control panel where you assign programs to keys.

This is wonderful work!

I’ve never seen so many calculators before! Oops.

There should be some udev-rule-ish way to automagically figure out which /dev/hidraw? device to use and symlink to a suitable alias, so the program could use it without knowing the actual device. A casual search turns up:

With which I’d produce /dev/input/kinesis0 and kinesis1, then use:

/home/ed/bin/kinesis/kfreestyle2d /dev/input/kinesis1

If only the Kinesis Fn key was momentary, rather than a push-on / push-off toggle. Le sigh. I can cope.


Leave a comment

Epson R380: Re-re-routed CISS Tubing

Alas, what seemed like a better tube route didn’t work any better and, in fact, the generous loop snagged crosswise between the print head box and the R380’s frame. So I deployed the big diagonal cutters and a nasty end cutter to chop a channel through the side of the box:

Epson R380 - modified print head box

Epson R380 – modified print head box

As far as I can tell, the thin section above the reinforcing gridwork exists specifically to get in the way of routing CISS tubes, but I suppose it could be just for pretty.

With the tubes coming directly off the top of the tanks and folding neatly as the print head moves under the frame, I could rearrange the supports to hold the tubes in a nearly straight line throughout their motion:

Epson R380 - straight CISS tube route

Epson R380 – straight CISS tube route

So far, so good.

Although the yellow ink now feeds properly and all the nozzles appear up on the test page, the printer output has an overall cyan tinge that gave the Annual Christmas Letter a gloomy aspect. Maybe the latest bottle of cheap Light Cyan ink isn’t quite as light as it should be?



MPCNC: GCMC Configuration

The default GCMC prolog(ue) spits out some G-Codes that GRBL doesn’t accept, requiring tweaks to the incantation.

A first pass at a useful prolog, minus the offending codes:

cat ~/.config/gcmc/prolog.gcmc 
(prolog begins)
G17 (XY plane)
G21 (mm)
G40 (no cutter comp)
G49 (no tool length comp)
G80 (no motion mode)
G90 (abs distance)
G94 (units per minute)
(prolog ends)

Including any of the usual “end of program” M-Codes in the epilog(ue) causes GRBL to pause before exiting the program, so leave only a placeholder:

cat ~/.config/gcmc/epilog.gcmc 
(epilog begins)
(M2) (allow program to continue)
(epilog ends)

Having done a git clone into /opt/gcmc before building the program, the GCMC library routines live in:

Limiting numeric values to two decimal places makes sense:
-P 2

With all that in hand, unleashing the compiler on an unsuspecting source file requires this jawbreaker:

gcmc -P 2 -I /opt/gcmc/library \
-G ~/.config/gcmc/prolog.gcmc \
-g ~/.config/gcmc/epilog.gcmc \
-o cycloids.ngc \

One might, of course, tuck all that into a little script, rather than depend on extracting it from the bash history as needed.

The resulting G-Code file looks about right:

head cycloids.ngc
(prolog begins)
G17 (XY plane)
G21 (mm)
G40 (no cutter comp)
G49 (no tool length comp)
G80 (no motion mode)
G90 (abs distance)
G94 (units per minute)
(prolog ends)
[pi@MPCNC tmp]$ head -25 cycloids.ngc
(prolog begins)
G17 (XY plane)
G21 (mm)
G40 (no cutter comp)
G49 (no tool length comp)
G80 (no motion mode)
G90 (abs distance)
G94 (units per minute)
(prolog ends)
G0 Z1.00
(-- tracepath at Z=-1.00mm --)
G0 X-145.50 Y-30.00
G1 Z-1.00
G1 X-145.51 Y-29.93

... vast snippage ...

G1 X175.50 Y30.00
G1 Z1.00
G0 Z25.00
(epilog begins)
(epilog ends)

Then it’s just a matter of tweaking cycloids.gcmc to make interesting things happen:

GGMC Cycloids test patterns

GGMC Cycloids test patterns



Model M Keyboard Surprise

A friend gave me a New Old Stock IBM Model M keyboard, built by Lexmark on 1/30/96. Although I intended to try it out, I first showed it to Mary and it immediately ended up at her desk:

IBM Model M 1996 - media keys

IBM Model M 1996 – media keys

I favor off-lease Dell boxes intended for office use, so the PS/2 plug on the end of the (permanently attached) cable slid right into the PS/2 jack on the back panel. Gotta love it.

She’d been hammering out testcases and doc on Model M keyboards basically forever, so her fingers snapped into position and the room sounds like her old IBM office.

The “101 key” layout predates frippery along the lines of multimedia keys, so I gimmicked the top row of the numeric pad to control the mixer volume and muting toggle:

  • /amixer sset 'Master' 10%-
  • *amixer sset 'Master' 10%+
  • amixer sset 'Master' toggle

While doing that, I found the semicolon key fired at the slightest touch, so I popped the keycap to see if I could frighten it into compliance:

IBM Model M 1996 - dome switch

IBM Model M 1996 – dome switch


It seems Lexmark replaced the classic buckling spring mechanism with less clicky rubber dome switches, even back in 1996, perhaps for use in libraries & suchlike. Come to think of it, this place is more like a library than an office, so muted clickiness seems appropriate.

For completeness:

IBM Model M 1996 - label

IBM Model M 1996 – label


Google Pixel vs. USB Mounting

For reasons undoubtedly making sense at the time, the Google Pixel (and, most likely, current Android devices) don’t support the USB Mass Storage protocol. A bit of poking around suggests the jmtpfs utility supplies the other end of the Pixel’s Media Transfer Protocol and the process goes a little something like this:

  • Once upon a time, create a mountpoint: mkdir /mnt/pixel
  • Unlock the phone
  • Plug in the USB cable
  • Pull down the top menu, tap USB charging this device
  • Select Transfer Files
  • sudo jmtpfs /mnt/pixel -o allow_other,fsname="Pixel"

The allow_other parameter sets the directory / file permissions so ordinary users can access the files. The fsname is just for pretty.

The Pixel’s storage then appears as the awkwardly named /mnt/pixel/Internal\ shared\ storage/ directory.

Despite being somewhat Linuxy under the hood, the mapped storage doesn’t support the usual filesystem attributes, so don’t try to transfer them with, say, rsync -a:

rsync -rhu --progress /mnt/music/Music\ for\ Programming /mnt/pixel/Internal\ shared\ storage/Music/

When you’re done: sudo umount /mnt/pixel

This may not be a win over bankshotting off Dropbox or Google Drive, except for sensitive bits like private keys and suchlike.

Thunar apparently knows how to detect and mount mtp devices automagically and I suppose GUI-fied drag-n-drop works as you’d expect.

Leave a comment

Epson R380 Continuous Ink Supply: Tubing Failure

After 4.5 years, one of the silicone tubes on the Epson R380’s continuous ink supply system broke:

Epson R380 - broken CISS tube

Epson R380 – broken CISS tube

The yellow smudges in front of the tubing clamp and across the top suggest the total mess lying in wait between the cartridges. Donning my shop apron and wielding damp paper towels cleaned things up well enough.

I cut through all the tubes a few inches back from the clamp, pulled the stubs off the elbow connectors, reinstalled the fresh ends, and re-repaired the clamp with a new cable tie:

Epson R38 - CISS tubes

Epson R38 – CISS tubes

Although the failing yellow supply surely contributed to the problem, the printhead seems to be on its last legs after nearly nine years. IIRC, I got the printer for $15 after rebate, spent maybe four times that on CISS tanks, and perhaps $200 on good-quality ink in pint bottles, it doesn’t owe me much.

Maybe I shouldn’t buy ink in pint bottles any more.


Google Pixel XL: Google Play Services Phone Number Update

This notification appeared every day after I got my shiny-new / soon-to-be-obsolete Google Pixel XL:

Screenshot_20170906-085931 - Update Your Phone Number - detail

Screenshot_20170906-085931 – Update Your Phone Number – detail

Fast-forward through nearly a month of doing the obvious things to no avail:

  • Tap the notification to update my phone number
  • Update my phone number from Firefox on the Pixel
  • Update my phone number from Firefox on my desktop
  • Ditto, from Chromium
  • Just dismiss the notification, repeatedly
  • Change my phone number in various Google places
  • Ditto, in various ways

Searching on the obvious keywords provided very few hits and none with a resolution. I followed one suggestion to flush the Google Play and Google Play Services caches, to no visible effect.

So I started a chat with Google Support by coredumping the entire list of Things Already Tried. After ten minutes of pleasantries, mostly spent idling while Holmes (great name for a tech support guy) read my coredump (and, most likely, timeshared a dozen other support chats), this transpired:

11:36:01​ ​ Holmes:​ ​ I ​ ​ see​ ​ that​ ​ you’ve​ ​ tried​ ​ almost​ ​ all​ ​ the​ ​ things​ ​ to​ ​ get​ ​ rid​ ​ of​ ​ the​ ​ notification​ ​ for​ ​ Google​ ​ play services.
11:36:05​ ​ Holmes:​ ​ Is​ ​ that​ ​ right?
11:36:57​ ​ Ed​ ​ Nisley:​ ​ It’s​ ​ everything​ ​ I ​ ​ could​ ​ think​ ​ of,​ ​ plus​ ​ a ​ ​ bit​ ​ of​ ​ searching​ ​ the​ ​ usual​ ​ forums.​ ​ A ​ ​ few​ ​ other folks​ ​ have​ ​ the​ ​ same​ ​ problem,​ ​ but​ ​ none​ ​ have​ ​ a ​ ​ resolution.
11:38:04​ ​ Holmes:​ ​ Sure,​ ​ I ​ ​ understand​ ​ that.​ ​ Please​ ​ don’t​ ​ worry​ ​ at​ ​ all,​ ​ we’ve​ ​ a ​ ​ dedicated​ ​ team​ ​ of​ ​ experts​ ​ for Play​ ​ related​ ​ concern.​ ​ I’m​ ​ from​ ​ hardware​ ​ nexus​ ​ Support​ ​ team.
11:38:15​ ​ Holmes:​ ​ I’d​ ​ connect​ ​ you​ ​ directly​ ​ with​ ​ them.

I’ve never gotten to Level 2 that fast in my entire life!

Fifteen minutes later (again, mostly his reading & timesharing):

11:54:37​ ​ Calvin​ ​ S:​ ​ The​ ​ issue​ ​ might​ ​ be​ ​ due​ ​ to​ ​ some​ ​ residual​ ​ files​ ​ that​ ​ might​ ​ hinder​ ​ the​ ​ download​ ​ process.
Lets​ ​ try​ ​ to​ ​ clear​ ​ cache​ ​ of​ ​ Google​ ​ Play​ ​ Store,​ ​ to​ ​ see​ ​ if​ ​ the​ ​ issue​ ​ can​ ​ be​ ​ resolved.
11:55:06​ ​ Calvin​ ​ S:​ ​ I ​ ​ can​ ​ help​ ​ you​ ​ with​ ​ the​ ​ steps,​ ​ if​ ​ you​ ​ want​ ​ to.
11:55:10​ ​ Ed​ ​ Nisley:​ ​ As​ ​ I ​ ​ said​ ​ in​ ​ the​ ​ initial​ ​ description,​ ​ I’ve​ ​ already​ ​ done​ ​ that.
11:55:39​ ​ Calvin​ ​ S:​ ​ I ​ ​ appreciate​ ​ your​ ​ efforts​ ​ to​ ​ fix​ ​ this​ ​ issue.
11:56:08​ ​ Ed​ ​ Nisley:​ ​ Blew​ ​ away​ ​ all​ ​ the​ ​ caches​ ​ for​ ​ anything​ ​ to​ ​ do​ ​ with​ ​ Google​ ​ Play​ ​ anything!
11:56:20​ ​ Calvin​ ​ S:​ ​ Could​ ​ you​ ​ please​ ​ let​ ​ me​ ​ know,​ ​ what​ ​ all​ ​ troubleshooting​ ​ steps​ ​ you​ ​ have​ ​ tried?
11:57:05​ ​ Ed​ ​ Nisley:​ ​ Did​ ​ you​ ​ read​ ​ the​ ​ initial​ ​ description​ ​ I ​ ​ sent​ ​ to​ ​ start​ ​ this​ ​ chat?​ ​ Took​ ​ Holmes​ ​ five​ ​ minutes to​ ​ chew​ ​ through​ ​ it.
11:58:11​ ​ Calvin​ ​ S:​ ​ I ​ ​ see​ ​ that​ ​ you​ ​ have​ ​ cleared​ ​ cache​ ​ of​ ​ Play​ ​ services.
11:58:50​ ​ Calvin​ ​ S:​ ​ Let​ ​ us​ ​ uninstall​ ​ updates​ ​ for​ ​ the​ ​ Play​ ​ Store​ ​ app​ ​ Play​ ​ Store​ ​ and​ ​ Google​ ​ Play​ ​ Services.

At which point it became obvious I was going to spend the rest of the day dinking around:

12:00:58​ ​ Ed​ ​ Nisley:​ ​ Given​ ​ that​ ​ this​ ​ notification​ ​ appears​ ​ in​ ​ the​ ​ morning,​ ​ doing​ ​ this​ ​ step​ ​ by​ ​ step​ ​ will​ ​ take days.​ ​ Give​ ​ me​ ​ a ​ ​ list​ ​ of​ ​ everything​ ​ you​ ​ will​ ​ suggest​ ​ so​ ​ I ​ ​ can​ ​ do​ ​ it​ ​ without​ ​ wasting​ ​ hours​ ​ typing​ ​ at​ ​ you.
12:02:22​ ​ Calvin​ ​ S:​ ​ Respecting​ ​ your​ ​ time,​ ​ I’ll​ ​ follow​ ​ up​ ​ with​ ​ you​ ​ over​ ​ an​ ​ email​ ​ with​ ​ all​ ​ the​ ​ possible troubleshooting​ ​ steps.

The “troubleshooting steps” look like a generic list of progressively more desperate measures applicable to any mysterious Android problem:

Clear app data for the Play Store

Go to Settings > Apps.
Tap Google Play Store > Storage > Clear data > Ok.
At the top left, tap the Back arrow to go to the “App info” screen.
At the top right, tap More (3 dots) > Uninstall updates > Ok > Ok to restore the app to its factory version.
Note: The Play Store will update automatically within 48 hours. If “Uninstall updates” is dimmed, you can skip this step.
Note: If you’ve changed the Google Play Store app settings (content filters, password protection, etc.), you’ll need to set them up again.

Clear the app data of Google Play services

Warning: Clearing the app data of Google Play services can reset settings, affect app performance, and cause unpredictable behavior across the device.

Go to Settings > Apps or Application Manager.
At the top right, tap More (3 dots) > Show system apps (on Android versions lower than 6.0, go to All instead).
Tap Google Play services.
Note: If you don’t see “Google Play services,” check Show all system apps and make sure that both Google Play Framework and Google Play Services are enabled. ​​If they aren’t enabled, download the Google Play Service from Play Store.
Tap Storage > Clear cache.
Then tap Manage Space > Clear All Data > Ok.

After completing this step, you should check the settings on your apps to see if they’re still configured correctly.

Remove and re-add your Google Account

Note: This may reset settings and remove in-app content. However, your purchases and synced data (Gmail, Google contacts, etc.) are tied to your account and will be available after re-adding your account.

Go to Settings > Accounts > Google.
Tap the name of the account you wish to remove.
Important: Make sure you remember your account password. You’ll need it to sign back in to your account.
At the top right, tap More (3 dots) > Remove account > Remove account.
At the top left, tap the Back arrow > Add account > Google.
Sign in to your Google Account.

Uninstall and reinstall Play Store updates

Temporarily uninstalling updates to the Google Play Store app can help fix some issues.

To revert the Play Store app to the previous version:

Go to Settings.
Tap Apps or Application manager (depending on the device).
Tap Google Play Store (depending on the device, you may need to go to All).
Tap on the menu button, and then Uninstall updates.
If the Uninstall updates button isn’t available, skip the rest of this step and continue troubleshooting.
When prompted to change the Play Store app back to the factory version, tap OK.
Go back to the device’s home screen and relaunch the Play Store. Your Play Store app should update to the latest version within a few minutes.
If the Play Store app doesn’t update, tap on the menu button from within the app and go to Settings. Scroll down until you see Play Store Version. Tap on that to check for an update. If none is available, continue to the next step.

Uninstall updates for Google Play Services

Go to Settings.
Tap Apps or Application manager (depending on the device).
Tap Google Play Services (depending on the device, you may need to go to All).
Tap on the menu button, and then Uninstall updates.
If the Uninstall updates button isn’t available, skip the rest of this step and continue troubleshooting.
When prompted to change the Play Store app back to the factory version, tap OK.

Reset your device to factory settings

If you’d like help with resetting your device, contact us from another device and we’ll walk you through it.

To reset your device:

If you have an SD card, remove it to save the data on the card.
Reset your Android device to factory settings.
Sign in to your device with a Google Account that was signed in before the reset.
If you removed an SD card, reinsert it.

To reload your apps and data:

Open the Play Store app.
Tap the Menu (3 lines) > My apps & games > Library.
Next to the apps that you’d like to install, tap Install or Enable.

If the issue still persist after performing all the troubleshooting steps I request you to reply to this email with the screenshot.

As it turned out, blowing away “the app data of the Google Play services” did the trick; the notification Went Away and hasn’t returned.

I hope I never need that information again …