[RESPONDED] QMK keyboard setup not working under Linux?

Hi, trying to swap my Fn & Ctrl keys on my new FW16. If I go to keyboard.frame.work to change settings it fails with

15:56:17.997
Failed to open the device.
Device: Framework Laptop 16 Keyboard Module - ANSI
Vid: 0x32AC
Pid: 0x0012

15:56:18.021
Received invalid protocol version from device
Device: Framework Laptop 16 Keyboard Module - ANSI
Vid: 0x32AC
Pid: 0x0012

Compiling and running the executable here seems to work for changing RBG colors and stuff, but only if I run it as root. Without sudo I get

called `Result::unwrap()` on an `Err` value: HidApiError { message: "Failed to open a device with path '/dev/hidraw7': Permission denied" }

I originally thought I had a bad keyboard since it wasn’t able to open it, but since some of it works via the command line, I’m wondering if it’s a permission thing, or other Linux-centric issue.

Attached kernel version & distro:

I’m on mint and keyboard.frame.work works (testing the firmware on rp2040 board). What browser are you using? And is it installed as a normal system package?
Perhaps try reflashing?
Releases · FrameworkComputer/qmk_firmware · GitHub

The QMK HID commandline tool error does sound like a permission issue. Did you configure a udev rule? github.com/FrameworkComputer/qmk_hid#running-on-linux

Summary

place this file into /etc/udev/rules.d/.

Once added, run the following:

sudo udevadm control --reload-rules
sudo udevadm trigger

~edit~ If anyone else needs to apply this just to get keyboard.frame.work to connect, please post your distro.

4 Likes

Ah! You’re the best! I didn’t see that at the bottom of the page. That fixed both the root issue and the browser issue. Looks like it was just a permission issue. Thanks!

3 Likes

Followup, can you remap your Fn key? I can map Left Ctrl to MO(1), but no matter what I set the Fn key to, it continues to work as the Fn key. I set it to “B” in the screenshot"

You should be able to.
Let me go look at firmware files to check if it has anything unusual.

You’re not in Fn-lock are you? Fn-lock is a separate layer. And due to the way layers overlay each other, the key assigned in the Fn-lock layer is what’s used when you are in the Fn-lock layer.

I’m not seeing anything unusual. I’d suggest trying an eeprom reset. You can do it with the QMK HID commandline tool: --eeprom-reset. Or by adding EE_CLR to your keymap at keyboard.frame.work then pressing the key. EE_CLR looks to be named Reset in Via (keyboard.frame.work), under the “Special” section.

Oh, Fn-lock must have been it. I was going to say I wasn’t, until I realized that the default for the F keys was the media/brightness, not the F1-10. Damn missing indicator lights. I think it’s working as expected now.

Thanks for all the help :slight_smile:

For anyone in the future who reads this and wants to swap Fn and left control:

  1. On layer 0, make the bottom left MO(1) (under LAYERS) and the one to the right “Left Control” (under BASIC)
  2. Leave layer 1 alone
  3. On layer 2, make the bottom left MO(3) (under LAYERS) and the one to the right “Left Control” (under BASIC)

The third item lets you flip in and out of Fn-lock via the left most button.

edit: layer typo

2 Likes

You mean on Layer 2.

1 Like

Can anyone explain how to flash an update to the keyboard and number pad?
I’ve tried getting qmk_hid working from the framework github but i cant get the gui working as pysimplegui is having problems with tkiniter.

Can I ask what you ultimately want to do? And also, what OS you’re on.
I ask because if you’re looking to flash or reflash the firmware, you don’t need the qmk_hid tool for that.

Kubuntu 23.10.
Ultimately I want to use keyboard.frame.work, but I’m getting the same thing as the OP where the website is receiving an invalid protocol when using Brave browser (fork of chromium).
I have done the udev addition listed on the qmk page but that didnt work.

The qmk_hid tool is not a substitute for keyboard.frame.work. It’s mostly for special commands, like clearing memory, BIOS mode, Factory mode, etc. The only normal function it has is some backlight controls.

How is Brave installed? As a normal .deb package or as snap (or flatpak)?
I’ve read that snaps can have issues with permissions. And that some snap browser builds can leave out WebHID support.

Try this check for WebHID support https://webapicheck.com/apis/webhid-api

1 Like

Yea, looks like brave is installed as a snap app.
Installed the one from their website through apt and the website is working correctly… how wierd… is it cus of the security of snap apps or because of the bundled drivers?

Thank you.

Glad it’s working now.

I understand that snap apps can work with WebHID. So I believe it’s just that the Brave snap version didn’t enable it.

Bug #1780678 “[snap] Chromium cannot use WebUSB” : Bugs : chromium-browser package : Ubuntu
See comment #5, saying WebUSB support was fixed by adding the plug-in when building the snap package. WebHID is like a subset of WebUSB.

2 Likes

Major shout out to @MJ1 for their AMAZING work here.

1 Like

Thanks for the helpful post! This was needed for Arch (endeavorOS).

1 Like

I just realized the QMK and QMK_HID package may include qmk.rules for ARCH/Manjaro, but those rules DO NOT include the FW16 keyboard. I had to add a line under the QMK_HID area

SUBSYSTEMS==“usb”, ATTRS{idVendor}==“32ac”, ATTRS{idProduct}==“0012”, ENV{ID_QMK}=“1”

These rules did not work for you? github.com/qmk/qmk_firmware/tree/master/util/udev/50-qmk.rules Those are general rules meant to cover any qmk keyboard. They come from the QMK docs.

If they didn’t work, which distro?

Can you check if /dev/hidraw* belongs to the plugdev group?

ll /dev/hidraw*

example output crw-rw-rw-+ 1 root plugdev 240, 3 Mar 22 17:28 /dev/hidraw3

Nope, hidraw are all owned by root:root. Using Manjaro. reading some posts from the past, thats evidently also an arch thing? usb's not working properly / Newbie Corner / Arch Linux Forums

This will only work for the ANSI (American) layout Keyboard Module. It won’t cover the numpad, macropad, ISO, or JIS modules. I’d suggest SUBSYSTEMS==“usb”, ATTRS{manufacturer}=="Framework", ENV{ID_QMK}=“1”

Oh, I read that Arch doesn’t like the plugdev group approach. They prefer using TAG+="uaccess". But 50-qmk.rules does also include the uaccess tag. Not sure why it wasn’t providing access for you. Tim_Hendersen in the post above yours said 50-qmk.rules worked on endeavorOS Arch. How did you find or come up with the rule that’s working for you?

1 Like