Ultimate Hacking Keyboard Firmware update

Hi!

I’m a (mostly) happy owner of a Ultimate Hacking Keyboard, but I’m having trouble with the agent used to install new firmwares.

These are the udev rules I configured, and I created the plugdev group and added my user to it in configuration.nix.

I’m running the agent with appimage-run.

Is there anyone who has successully gotten the Agent to update their keyboard?

Hey there!

I’m not familiar with NixOS, but you should be able to use Agent on any Linux distribution by making it executable and simply running it. Agent sets up udev rules via a privilege escalation window.

I’ve just registered on this forum, and won’t be around, but should you have any further issues, feel free to shoot an email to support@ultimatehackingkeyboard.com

Laci - the founder of the Ultimate Hacking Keyboard

@asymmetric You didn’t actually mention what the problem is

Sorry if that wasn’t clear,

Is there anyone who has successully gotten the Agent to update their keyboard?

I didn’t manage to update the firmware on the device.

I’m suspecting it could be because the keyboard is connected to a dock, rather than the laptop directly, in which case NixOS wouldn’t be at fault :slight_smile:

I’ll try to confirm this next week.

Yeah but more specifically: What commands did you run, was there an error? How do you notice it didn’t work? “Having trouble” and “not succeeding” doesn’t say anything about the actual problem. Don’t want to sound harsh, but it’s almost impossible to debug anything without such info.

2 Likes

I’ve been able to update the firmware, here is my setup:

i didn’t do this myself i probably copied it from somewhere, but i have no ides from who.

And I’m loving my uhk, i can’t wait for addons to arrive :slight_smile:

3 Likes

You may want to add a shell.nix to your firmware repository to make it easy for Nix users to hack on your firmware. qmk has one ;).

These are the relevant lines of my configuration.nix:

udev.extraRules = ''
      # uhk
      SUBSYSTEM=="input", GROUP="input", MODE="0666"
      SUBSYSTEMS=="usb", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="612[0-7]", MODE:="0666", GROUP="plugdev"
      KERNEL=="hidraw*", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="612[0-7]", MODE="0666", GROUP="plugdev"
'';

And when I try to update the firmware:

[15:28:43.665] [UhkOperations] Operating system: Linux 4.19.49 x64
[15:28:43.665] [UhkOperations] Start flashing right firmware
[15:28:43.665] [UhkHidDevice] Start reenumeration, mode: Bootloader
[15:28:43.772] [UhkHidDevice] USB[T]: Enumerate device. Mode: Bootloader
[15:28:43.772] [UhkHidDevice] USB[W]: 01 00 88 13 00 00
[15:28:44.254] [UhkHidDevice] reenumeration devices up
[15:28:44.254] [UhkHidDevice] Device communication closing.
[15:28:44.255] [UhkHidDevice] Device communication closed.
[15:28:44.256] [blhost] RUN: /home/asymmetric/.cache/appimage-run/868a716a7f881e6a937366dbdd9f67fc38e968a310b27ef9c2acc746cfc023bf/squashfs-root/resources/packages/blhost/linux/x86_64/blhost --usb 0x1d50,0x6120 flash-security-disable 0403020108070605
[15:28:44.267] [blhost] STDOUT: Error: UsbHidPeripheral() cannot open USB HID device (vid=0x1d50, pid=0x6120, sn=).
[15:28:44.269] [blhost] EXIT_CODE: 1
[15:28:44.270] [blhost] FINISHED: 1
[15:28:44.546] [DeviceService] updateFirmware error { message: 'blhost error code:1', stack: 'Error: blhost error code:1\n at finish (/home/asymmetric/.cache/appimage-run/868a716a7f881e6a937366dbdd9f67fc38e968a310b27ef9c2acc746cfc023bf/squashfs-root/resources/app.asar/webpack:/uhk-usb/src/uhk-blhost.ts:53:35)\n at ChildProcess.childProcess.on.code (/home/asymmetric/.cache/appimage-run/868a716a7f881e6a937366dbdd9f67fc38e968a310b27ef9c2acc746cfc023bf/squashfs-root/resources/app.asar/webpack:/uhk-usb/src/uhk-blhost.ts:36:17)\n at emitTwo (events.js:125:13)\n at ChildProcess.emit (events.js:213:7)\n at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)' }
[15:28:44.547] [UhkHidDevice] Available devices:
[15:28:44.548] {"vendorId":7504,"productId":24864,"path":"/dev/hidraw0","serialNumber":"","manufacturer":"Ultimate Gadget Laboratories","product":"UHK Bootloader","release":2,"interface":0,"usagePage":14897,"usage":11825}
[15:28:44.549] [DeviceService] Read hardware modules information failed Error: [UhkHidDevice] Device is not connected at Promise (/home/asymmetric/.cache/appimage-run/868a716a7f881e6a937366dbdd9f67fc38e968a310b27ef9c2acc746cfc023bf/squashfs-root/resources/app.asar/webpack:/uhk-usb/dist/src/uhk-hid-device.js:107:1) at Promise (<anonymous>) at UhkHidDevice.<anonymous> (/home/asymmetric/.cache/appimage-run/868a716a7f881e6a937366dbdd9f67fc38e968a310b27ef9c2acc746cfc023bf/squashfs-root/resources/app.asar/webpack:/uhk-usb/dist/src/uhk-hid-device.js:104:1) at Generator.next (<anonymous>) at /home/asymmetric/.cache/appimage-run/868a716a7f881e6a937366dbdd9f67fc38e968a310b27ef9c2acc746cfc023bf/squashfs-root/resources/app.asar/webpack:/uhk-usb/dist/src/uhk-hid-device.js:7:1 at Promise (<anonymous>) at __awaiter (/home/asymmetric/.cache/appimage-run/868a716a7f881e6a937366dbdd9f67fc38e968a310b27ef9c2acc746cfc023bf/squashfs-root/resources/app.asar/webpack:/uhk-usb/dist/src/uhk-hid-device.js:3:1) at UhkHidDevice.write (/home/asymmetric/.cache/appimage-run/868a716a7f881e6a937366dbdd9f67fc38e968a310b27ef9c2acc746cfc023bf/squashfs-root/resources/app.asar/webpack:/uhk-usb/dist/src/uhk-hid-device.js:103:1) at UhkHidDevice.<anonymous> (/home/asymmetric/.cache/appimage-run/868a716a7f881e6a937366dbdd9f67fc38e968a310b27ef9c2acc746cfc023bf/squashfs-root/resources/app.asar/webpack:/uhk-usb/dist/src/uhk-hid-device.js:155:1) at Generator.next (<anonymous>)
[15:28:44.550] [blhost] CLOSE_CODE: 1

The keyboard is connected directly to the laptop (Thinkpad T450s).

I got uhk-agent running with these bits (thanks!), but then it would crash with

GLib-GIO-ERROR**: No GSettings schemas are installed on the system`

when I pressed Device > Configuration > [Export Device Configuration | Import Device Configuration].

My conclusion was that $XDG_DATA_DIRS wasn’t set correctly (I’m not using a desktop manager, which I suspect triggered my problem. Using i3 for WM). I solved it like this

1 Like

Can confirm that, at least for me, the udev rules provided by upstream don’t work, and the one provided by you do.

More precisely, I had to replace TAG+="uaccess" with GROUP="plugdev".

Brilliant!

1 Like

For future readers: in case that helps I created a package based on the work from this thread. Putting everything inside (self-contained), borrowing deps from atomEnv, creating the desktop entry with icons and so. You can find the code here. Once I have some spare time I’ll prepare a PR for the nixpkgs repo

2 Likes