How to run the official keychron launcher web app under Linux for keyboard configuration and firmware updates.
There are a few things to consider when trying to use the keychron launcher web app under Linux:
.deb or .rpm file).
udev
rule. With this first rule in place the keyboard can be
configured (remap keys, set backlight, create macros, etc.).
udev
rule is needed because the keyboard changes its USB
identification when going into firmware update mode, creating
a different USB device.
dfu-util needs to be installed. This is
what the browser calls internally to transmit firmware
data. dfu-util is available in the repositories
of most distributions.
These software versions were used to update a Keychron K10
Pro ISO RGB K10P-H3P-DE to firmware V1.1.0. Other (newer)
versions and other keyboards probably work, too.
Without correct udev configuration, clicking the
Connect button in the web app at
https://launcher.keychron.com and choosing the
keyboard in the selection dialog results in an error message
popup
⊗ HID Device Connected [K]
showing up for a (very) short time.
The following steps allow the launcher web app to talk to the keyboard for configuration, macro recording etc. The process was mostly taken from [1].
udev rulelsusbOn my computer it currently looks like this:
# lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 002: ID 1235:8006 Focusrite-Novation Focusrite Scarlett 2i2 Bus 003 Device 003: ID 05e3:0608 Genesys Logic, Inc. Hub Bus 003 Device 004: ID 050d:065a Belkin Components F8T065BF Mini Bluetooth 4.0 Adapter Bus 003 Device 005: ID 3434:02a1 Keychron Keychron K10 Pro Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hubThe second to last line of the output shows that the USB bus id of my keyboard is
3434:02a1 here.
The first part before the colon is
called idVendor, the second part is
the idProduct. The ids of other keyboards
might be different.
id -gn <linux user>On my computer, for my default user
chb it looks
like this:
# id -gn chb chbOn a lot of unix systems the primary group of any user has the same name as the user itself by default.
/etc/udev/rules.d/99-keychron.rules
and put the following line into it:
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="XXXX", ATTRS{idProduct}=="YYYY", MODE="0660", GROUP="ZZZZ", TAG+="uaccess", TAG+="udev-acl"
XXXX with
the idVendor from lsusb.
YYYY with
the idProduct from lsusb.
ZZZZ with the group name from
id.
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="3434", ATTRS{idProduct}=="02a1", MODE="0660", GROUP="chb", TAG+="uaccess", TAG+="udev-acl"
udevadm control --reload-rules udevadm trigger
You should now be able to run a supported browser as the
user whose group went into the rule, go to
https://launcher.keychron.com and connect to
your keyboard via the Connect button (and the
following selection dialog). Configuration, macro recording etc.
should work.
However, firmware updates still won't start or get stuck, continue to the next section if you want to fix that.
When putting the keyboard into firmware update mode the USB
device id changes to a different one. In order to allow the web
app to continue talking to the keyboard a
second udev rule is needed that sets the access
permissions for this new device.
For transmitting firmware updates the web app calls the tool
dfu-util. If it is not installed the firmware
update will stay stuck[2].
The following steps enable the launcher web app to talk to the keyboard for firmware updates:
udev rulelsusb again to find the new USB device
id of the keyboard. On my computer the output now looks
like this:
# lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 002: ID 1235:8006 Focusrite-Novation Focusrite Scarlett 2i2 Bus 003 Device 003: ID 05e3:0608 Genesys Logic, Inc. Hub Bus 003 Device 004: ID 050d:065a Belkin Components F8T065BF Mini Bluetooth 4.0 Adapter Bus 003 Device 006: ID 0483:df11 STMicroelectronics STM Device in DFU Mode Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hubThe bus id of my keyboard in firmware update mode (line
STMicroelectronics STM Device in DFU
Mode) is 0483:df11 here, so the
new idVendor is 0483 and the
new idProduct is df11.
On other systems the ids might look different.
/etc/udev/rules.d/99-keychron.rules:
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="XXXX", ATTRS{idProduct}=="YYYY", MODE="0660", GROUP="ZZZZ", TAG+="uaccess", TAG+="udev-acl"
XXXX with
the idVendor of the new device.
YYYY with
the idProduct of the new device.
ZZZZ with the group name
used for the first udev rule before.
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0660", GROUP="chb", TAG+="uaccess", TAG+="udev-acl"
udevadm control --reload-rules udevadm trigger
dfu-util is installeddfu-util tool is available in the
repositories of most distributions (Debian, Ubuntu, Fedora,
Gentoo and maybe more). See
https://dfu-util.sourceforge.net/.
With those bits and pieces in place the keychron launcher web app should be able to perform a firmware update on a keychron keyboard. Please see one of the firmware update tutorials for your keyboard at Keychron for instructions on how to proceed from here.
To add to the big warning sign from above: Updating firmware is only worth the risk if there is a good reason for it (e.g. an annoying bug that you actually encounter repeatedly gets fixed or a feature is added that you desperately need). It is only tested with one single keyboard, there is no guarantee that it will work with anything else (not from me and certainly not from Keychron)[3].
Good luck and have fun!