UHK80 Bluetooth trouble

I can’t, for the life of me, make this thing connect to any of my devices.

I try to connect to my Linux laptop. It says is connected but no keystrokes come through. Then, after a while, the UHK80 BLE device disappears and the UHK80 Right NUS goes into a weird loop trying to connect to it. [Edit: This part works now, by reflashing the firmware, still no dice in windows]

I tried to connect it to my work, windows, laptop. It says pairing success but then it doesn’t connect, ever.

Dongle works… Sometimes. In windows it gets recognized as a game bar or something which the work laptop cannot support. Let’s say that’s on the IT policies of my job but still.

On firmware 14.0.1 BTW.

Anyone else experienced this?

Is your dongle flashed to the same FW v14.0.1 as the rest of the UHK80? If not, then plug it into the same PC as the UHK80, and flash it. The dongle shouldn’t be getting recognized as a gamepad anymore, that functionality was disabled via firmware a long time ago.

1 Like

Thank you. That fixed the dongle. Now the problem is just the Bluetooth.

Thing is, after flashing the dongle, I had to disconnect Bluetooth to pair the dongle to the kb again. After that happened, any time I tried to connect Bluetooth again, not only it didn’t work, it borked the dongle connection completely and had to re pair.

So basically, right now I’m stuck with only being able to use wired or dongle. Bluetooth breaks everything.

Please try this:

  • flash this firmware: uhk-firmware-14.0.2-bt_debug-v1.3.tar.gz
  • open advanced settings:
    • go into agent About page
    • click the agent icon 7 or so times
    • scroll back up in the left pane
    • click Device/Advanced Settings
  • enable logging for right half
  • try to pair your ble hid device again
  • copy the logs out of agent into a text editor (this fixes newlines)
  • look through them for anything suspicious
  • post them here

Hello,

Thank you. This firmware actually fixed the bluetooth issue. There’s still some weirdness in work’s laptop but I’m perfectly good accepting that’s the machine’s fault because everywhere else it’s working perfectly fine and I can’t find anything suspicious in the logs. No breaking the dongle or anything like that either. Consider this fixed.

Sadly nope, connection to dongle was lost again. See following post.

…But no, actually. The issue persists. I can either use Bluetooth connections or dongle connections but I cannot have both paired to the keyboard at the same time. The moment I add a bluetooth connection the dongle unpairs. The moment I re-pair the dongle the bluetooth connections disconnect (in windows) or bug out (in Linux) and cannot be logged into again.

Adding it to a pastebin:

After the final logs where it started spitting out gibberish, the keyboard doesn’t turn on anymore. Unbricking was required.

There are no actual errors.

But there still are some some noteworthy sections:

Bt: Adv: H
ID advertising successfully started
Conn state: Host0(Wired, Ready), Active
Conn state: Host0(Wired, Ready), Active
bas: BAS Notifications enabled
Bt: connected n/a (Polaris, 1c:ce:51:c4:1b:8a), 4 3
Conn state: Host3(Polaris, Connected), Peer host1
Bt: Established HID connection with host1 (Polaris, 1c:ce:51:c4:1b:8a)
Conn state: Host3(Polaris, Ready), Peer host1
Bt: btManager: BtManager_StartScanningAndAdvertisingAsync because StartScanningAndAdvertisingAsync in connectHid
Bt: btManager: should scanAndAdvertise 0 1
Bt: Starting advertising, try 0!
Bt: start advertising
Bt: filling adv allow filter
Bt: Adv: NUS advertising successfully started
Batteries: 95% 99% (4131 4139)
Batteries: 95% 99% (4131 4139)
Conn state: Host3(Polaris, Ready), Peer host1, Active
Conn state: Host3(Polaris, Ready), Peer host1, Active
Batteries: 95% 99% (4131 4140)
Batteries: 95% 99% (4130 4140)
nected from host1 (Polaris, 1c:ce:51:c4:1b:8a), reason 22
Conn state: Host3(Polaris, Disconnected), Peer host1, Active
Conn state: Host0(Wired, Ready), Active
Bt: btManager: BtManager_StartScanningAndAdvertisingAsync because StartScanningAndAdvertisingAsync in disconnected
Unpaired device 1C:CE:51:C4:1B:8A (public)
Unpaired device 28:C5:D2:1A:94:9B (public)
Bt: btManager: should scanAndAdvertise 0 1
Bt: Starting advertising, try 0!
Unpaired device E1:FC:39:A2:83:84 (random)
Settings: Found peer 'left' with address c20923bb76e2
Settings: Found peer 'left' with address c20923bb76e2
Matched key: 1cce51c41b8a0, addrString: e276bb2309c21 ? 0
Bt: start advertising
Matched key: 28c5d21a949b0, addrString: e276bb2309c21 ? 0
Matched key:  �drbt/hash, addrString: e276bb2309c21 ? 0
Matched key: er/maxVoltage, addrString: e276bb2309c21 ? 0
Bt: Adv: HID "and NUS" advertising successfully started
Bt: connected n/a (Polaris, 1c:ce:51:c4:1b:8a), 4 3
Matched key: e276bb2309c21, addrString: e276bb2309c21 ? 1
Settings: Erased all settings
Settings: Found peer 'left' with address c20923bb76e2

This says that Agent has intentionally erased the settings (including all the bonds). I am wondering why? Have you triggered it?

At the same time, it says that it (Polaris) is not a selected connection, which would imply that you are either trying to connect multiple HIDs devices at the same time (which is not supported), or more than 3 devices at the same time, and that you are probably using direct switches to devices?

Polaris is trying to connect again and again, but is refused by the UHK based on that you have selected another device for connection - in that case you should see a target on the oled in form of “currentHost → selectedHost”. Please mention these in the next testing iteration.

Regarding gibberish spitting, I am very interested about that bug, but have no leads on how to reproduce it.


Here is a new build with adjusted logging. [Edit: actually give me a minute :sweat_smile:.]

You can also run a zephyr uhk connections macro at any time to print connection states - please do it at any point that looks interesting for you (e.g., in the above log, it would be nice to see it somewhere around the beginning).

Here it is: uhk-firmware-14.0.3-bt_debug-v1.5.tar.gz

Hi.
Seems like the link is dead. If you fix it I’ll run some more tests.
Regarding your questions:

  1. I clicked the delete device pairings button since none were working. I don’t know if that’s what you meant.
  2. I’m trying to have 3 different wireless devices paired to the keyboard so I can switch between them: a Linux PC using the dongle, a windows laptop for work, and my linux laptop (polaris). I guess the wired option is listed too so, strictly speaking, 4 connections.
  3. When I paired the keyboard to both laptops, windows and linux, via bluetooth and switched between one another, the one I disconnected from tried to connect over and over again to UHK80 Right NUS. In the computers it shows as showing the status as connected and then disconnected a couple times per second. I’ll try to take a video next time.

If there’s anything else I should take note of during the next tests let me know.

dead link

Strange. Try these then:

Same exact situation here.

  • Paired a MacBook Pro to the UHK 80 BLE

  • UHK 80 BLE device stops broadcasting and “UHK80 Right NUS” shows up

  • Windows machine refuses to connect to the UHK 80 Right NUS

  • Turned off Bluetooth on the Mac device (forced the disconnect from the UHK 80)

  • Note: Just disconnecting from the UHK 80 wasn’t enough, it immediately kept reconnecting to the apple device if I tried to just disconnect the keyboard without killing the whole radio (this is might a bug in the way the disconnect request is handled). I had to turn the radio all the way off on the MacBook in order for the UHK to stop reconnecting.

  • UHK 80 BLE device shows back up in the available devices and the Windows machine can connect to it just fine

  • Only a single Bluetooth device will connect at a time for me now.

Left & Right are both on firmware 15.0.1

One more thing to note, I’ve never had any trouble with Bluetooth bandwidth for streaming audio, but this evening while the UHK80 was connected I noticed a bunch of stuttering happening with my regular audio streams. Seems like whatever is happening is flooding Bluetooth traffic to the device it is connected to.

Happy to provide some logs and help tracking this down as I need to connect to a couple different bluetooth devices and right now am limited to one.

Additional info: In the logs that have been provided - something that’s jumping out to me would be the disconnect reason 22 – 0x22 LL Response Timeout provided in the HCI_Disconnection

Hi!

UHK at the moment supports at most one ble hid connection connected at a time. (It is a c2usb limitation.)

You should still be able to switch to the other device by the switch host action issued from UHK.

something that’s jumping out to me would be the disconnect reason 22 – 0x22 LL Response Timeout provided in the HCI_Disconnection

Sorry, I have not understood this sentence. Are you suggesting that we use that disconnect reason (22 (i.e., 0x16) or 0x22 (i.e., 34)?), or are you just stating that you are getting it?

#define BT_HCI_ERR_LOCALHOST_TERM_CONN          0x16
#define BT_HCI_ERR_LL_RESP_TIMEOUT              0x22
1 Like

Subject: UHK 80 Bluetooth pairing fails, firmware freezing

Hey, my UHK 80 won’t pair via Bluetooth. It shows up in my Bluetooth
devices but pairing fails every time with authentication errors.

Now I’m also getting firmware freeze messages in the logs with trace
buffers. The logs say to report this trace to devs:

EV: 512
Tag: v15.0.1
Trace:

()()
()<i
1>()

Bluetooth errors from my logs:

Bt: Pairing of auth conn failed because of 9
Bt: Pairing failed: n/a (n/a, 78:af:08:c6:df:12), reason 9
Bt: Bt security failed: n/a (n/a, 78:af:08:c6:df:12), level 1, err 9,
disconnecting
Bt: The connection (n/a (n/a, 78:af:08:c6:df:12)) isn’t even
connected! Ignoring.
Bt: Pairing of auth conn failed because of 9

Anyone else run into this? Running Arch Linux, firmware 15.0.1.

Freezing logs are false positives (unless your uhk actually freezes). Upgrade to 15.1.0 to get rid of them.

Linux pairing never worked, but we have a promissing candidate now, feel free to try: uhk80: improve BLE pairing compatibility by benedekkupper · Pull Request #1335 · UltimateHackingKeyboard/firmware · GitHub

2 Likes