Switching between BT devices

Is there a way to switch between Bluetooth devices yet?

Or is support for that yet to come?

Great timing! It has been merged like 2 hours ago :-).

Use the switchHost { next | previous | last | STRING } macro :wink:

3 Likes

A new firmware and Agent version has yet to be released.

2 Likes

Hi, I just received my UHK 80 and could not figure out how to switch devices.

The UHK 80 website mentions switchHost:

“The switchHost next, switchHost previous, and switchHost last commands switch to the next, previous, and last connection, respectively”

When I try to add this command I get an error:

Thank you,

Doug

You need newest firmware from Releases · UltimateHackingKeyboard/firmware · GitHub :wink:

1 Like

Is pairing multiple devices only supported with dongles? I’ve ordered just the keyboard and it’s not clear to me how to initiate pairing it with a second device. I’ve flashed the latest firmware and triggering the switchHost doesn’t do anything.

How can I cause the keyboard to “look” for a second connection?

Disconnect the first device from uhk.

Only one ble hid connection is supported at a time, so uhk doesnt advertise when it is already connected to another ble hid device.

Switching between ble hid devices should still be possible by switchHost "host name". When that is done, uhk disconnects the other device and allows only the selected device to connect.

Thanks for the quick support. I flashed* 12.3.1 and switchHost is now recognized. However, I am not sure how it’s supposed to work. I have a bluetooth connection to a windows laptop, a bluetooth connection to a mac laptop, a dongle connection (I think violet?) and a USB connection. My wish is to switch between the laptop bluetooth connections at the touch of a button - much like my Logitech MX Keys. At the moment in Agent under Connections I only see the USB and Dongle connections. The bluetooth connections are not listed despite previously pairing.

* I had to try flashing twice - the first attempt resulted in an error. For the second attempt, I unplugged the dongle first. Providing the log here only as FYI:

Start flashing firmware
[DeviceService] stop poll UHK Device
[DeviceService] stopped poll UHK Device
[DeviceService] Operating system: Darwin 23.6.0 arm64
[DeviceService] Agent version: 5.0.2
[DeviceService] New firmware version: 12.3.1
[DeviceService] New firmware user config version: 8.3.0
[DeviceService] UHK Dongle firmware upgrade starts: {"id":5,"asCliArg":"dongle","firmwareUpgradeMethod":"mcuboot","logName":"UHK Dongle","name":"UHK Dongle","keyboard":[{"vid":14248,"pid":5}],"bootloader":[{"vid":14248,"pid":4}],"buspal":[],"reportId":4}
[UhkHidDevice] Available devices changed.
[UhkHidDevice] Added: {"vendorId":"0x37A8","productId":"0x5","path":"DevSrvsID:4295022470","serialNumber":"4294967295","manufacturer":"Ultimate Gadget Laboratories","product":"UHK dongle","release":1,"interface":0,"usagePage":1,"usage":6}
[UhkHidDevice] Added: {"vendorId":"0x37A8","productId":"0x5","path":"DevSrvsID:4295022474","serialNumber":"4294967295","manufacturer":"Ultimate Gadget Laboratories","product":"UHK dongle","release":1,"interface":2,"usagePage":65280,"usage":1}
[UhkHidDevice] Added: {"vendorId":"0x37A8","productId":"0x5","path":"DevSrvsID:4295022478","serialNumber":"4294967295","manufacturer":"Ultimate Gadget Laboratories","product":"UHK dongle","release":1,"interface":3,"usagePage":12,"usage":1}
[UhkHidDevice] Added: {"vendorId":"0x37A8","productId":"0x9","path":"DevSrvsID:4295022560","serialNumber":"1484743895","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 80 right half","release":1,"interface":4,"usagePage":1,"usage":128}
[UhkHidDevice] Added: {"vendorId":"0x37A8","productId":"0x9","path":"DevSrvsID:4295022558","serialNumber":"1484743895","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 80 right half","release":1,"interface":2,"usagePage":65280,"usage":1}
[UhkHidDevice] Added: {"vendorId":"0x37A8","productId":"0x9","path":"DevSrvsID:4295022557","serialNumber":"1484743895","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 80 right half","release":1,"interface":0,"usagePage":1,"usage":6}
[UhkHidDevice] Added: {"vendorId":"0x37A8","productId":"0x9","path":"DevSrvsID:4295022567","serialNumber":"1484743895","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 80 right half","release":1,"interface":3,"usagePage":12,"usage":1}
[UhkHidDevice] Used device: {"vendorId":"0x37A8","productId":"0x5","path":"DevSrvsID:4295022474","serialNumber":"4294967295","manufacturer":"Ultimate Gadget Laboratories","product":"UHK dongle","release":1,"interface":2,"usagePage":65280,"usage":1}
[UhkHidDevice] protocol versions: {"firmwareVersion":"12.2.0","deviceProtocolVersion":"4.13.0","moduleProtocolVersion":"4.3.0","userConfigVersion":"8.3.0","hardwareConfigVersion":"1.0.0","smartMacrosVersion":"3.0.0"}
[DeviceService] Current Dongle firmware checksum: 0fc3acc93b906f0cfa4d8977c3e937fb
[DeviceService] New Dongle firmware checksum: d428f1380ba33e92a976c66e962cdfd4
[UhkOperations] Start flashing device firmware with mcuboot
[UhkOperations] Start flashing UHK Dongle firmware with mcumgr
[UhkOperations] Reenumerate bootloader
[UhkHidDevice] Device communication closing.
[UhkHidDevice] Device communication closed.
[UhkHidDevice] Start reenumeration, mode: Bootloader, timeout: 5000ms
[UhkHidDevice] Reenumeration error. We hope it would not break the process TypeError: Cannot write to hid device
    at Fr.reenumerate (/Applications/UHK Agent.app/Contents/Resources/app.asar/electron-main.js:2:476381)
    at async Nn.updateFirmwareWithMcuManager (/Applications/UHK Agent.app/Contents/Resources/app.asar/electron-main.js:2:508078)
    at async Os.updateFirmware (/Applications/UHK Agent.app/Contents/Resources/app.asar/electron-main.js:2:561871)
    at async xs.process (/Applications/UHK Agent.app/Contents/Resources/app.asar/electron-main.js:2:554664)
[UhkHidDevice] closing normal keyboard after reenumeration
[UhkHidDevice] Could not find reenumerated device: Bootloader. Waiting...
[UhkHidDevice] Available devices changed.
[UhkHidDevice] Removed: {"vendorId":"0x37A8","productId":"0x5","path":"DevSrvsID:4295022468","serialNumber":"4294967295","manufacturer":"Ultimate Gadget Laboratories","product":"UHK dongle","release":1,"interface":1,"usagePage":1,"usage":2}
[UhkHidDevice] Removed: {"vendorId":"0x37A8","productId":"0x5","path":"DevSrvsID:4295022470","serialNumber":"4294967295","manufacturer":"Ultimate Gadget Laboratories","product":"UHK dongle","release":1,"interface":0,"usagePage":1,"usage":6}
[UhkHidDevice] Removed: {"vendorId":"0x37A8","productId":"0x5","path":"DevSrvsID:4295022476","serialNumber":"4294967295","manufacturer":"Ultimate Gadget Laboratories","product":"UHK dongle","release":1,"interface":4,"usagePage":1,"usage":5}
[UhkHidDevice] Removed: {"vendorId":"0x37A8","productId":"0x5","path":"DevSrvsID:4295022474","serialNumber":"4294967295","manufacturer":"Ultimate Gadget Laboratories","product":"UHK dongle","release":1,"interface":2,"usagePage":65280,"usage":1}
[UhkHidDevice] Removed: {"vendorId":"0x37A8","productId":"0x5","path":"DevSrvsID:4295022478","serialNumber":"4294967295","manufacturer":"Ultimate Gadget Laboratories","product":"UHK dongle","release":1,"interface":3,"usagePage":12,"usage":1}
[UhkHidDevice] Removed: {"vendorId":"0x37A8","productId":"0x9","path":"DevSrvsID:4295022555","serialNumber":"1484743895","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 80 right half","release":1,"interface":1,"usagePage":1,"usage":2}
[UhkHidDevice] Removed: {"vendorId":"0x37A8","productId":"0x9","path":"DevSrvsID:4295022560","serialNumber":"1484743895","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 80 right half","release":1,"interface":4,"usagePage":1,"usage":128}
[UhkHidDevice] Removed: {"vendorId":"0x37A8","productId":"0x9","path":"DevSrvsID:4295022559","serialNumber":"1484743895","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 80 right half","release":1,"interface":5,"usagePage":1,"usage":5}
[UhkHidDevice] Removed: {"vendorId":"0x37A8","productId":"0x9","path":"DevSrvsID:4295022558","serialNumber":"1484743895","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 80 right half","release":1,"interface":2,"usagePage":65280,"usage":1}
[UhkHidDevice] Removed: {"vendorId":"0x37A8","productId":"0x9","path":"DevSrvsID:4295022557","serialNumber":"1484743895","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 80 right half","release":1,"interface":0,"usagePage":1,"usage":6}
[UhkHidDevice] Removed: {"vendorId":"0x37A8","productId":"0x9","path":"DevSrvsID:4295022567","serialNumber":"1484743895","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 80 right half","release":1,"interface":3,"usagePage":12,"usage":1}
[UhkHidDevice] Could not find reenumerated device: Bootloader. Waiting..........
[UhkHidDevice] Device communication closing.
[UhkOperations] Init SerialPeripheral: /dev/tty.usbmodem11414401
[UhkOperations] Read UHK Dongle firmware from file
[UhkOperations] Write memory with mcumgr
[UhkOperations] Reset mcu bootloader
[UhkOperations] Close mcu communication channels
[UhkOperations] UHK Dongle firmware successfully flashed
[DeviceService] Waiting for keyboard
[UhkHidDevice] Device communication closing.
[UhkHidDevice] Available devices changed.
[UhkHidDevice] Added: {"vendorId":"0x37A8","productId":"0x9","path":"DevSrvsID:4295022560","serialNumber":"1484743895","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 80 right half","release":1,"interface":4,"usagePage":1,"usage":128}
[UhkHidDevice] Added: {"vendorId":"0x37A8","productId":"0x9","path":"DevSrvsID:4295022558","serialNumber":"1484743895","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 80 right half","release":1,"interface":2,"usagePage":65280,"usage":1}
[UhkHidDevice] Added: {"vendorId":"0x37A8","productId":"0x9","path":"DevSrvsID:4295022557","serialNumber":"1484743895","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 80 right half","release":1,"interface":0,"usagePage":1,"usage":6}
[UhkHidDevice] Added: {"vendorId":"0x37A8","productId":"0x9","path":"DevSrvsID:4295022567","serialNumber":"1484743895","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 80 right half","release":1,"interface":3,"usagePage":12,"usage":1}
[UhkHidDevice] Added: {"vendorId":"0x37A8","productId":"0x5","path":"DevSrvsID:4295029081","serialNumber":"4294967295","manufacturer":"Ultimate Gadget Laboratories","product":"UHK dongle","release":1,"interface":2,"usagePage":65280,"usage":1}
[UhkHidDevice] Added: {"vendorId":"0x37A8","productId":"0x5","path":"DevSrvsID:4295029085","serialNumber":"4294967295","manufacturer":"Ultimate Gadget Laboratories","product":"UHK dongle","release":1,"interface":3,"usagePage":12,"usage":1}
[UhkHidDevice] Added: {"vendorId":"0x37A8","productId":"0x5","path":"DevSrvsID:4295029087","serialNumber":"4294967295","manufacturer":"Ultimate Gadget Laboratories","product":"UHK dongle","release":1,"interface":0,"usagePage":1,"usage":6}
[UhkHidDevice] Used device: {"vendorId":"0x37A8","productId":"0x5","path":"DevSrvsID:4295029081","serialNumber":"4294967295","manufacturer":"Ultimate Gadget Laboratories","product":"UHK dongle","release":1,"interface":2,"usagePage":65280,"usage":1}
[UhkHidDevice] protocol versions: {"firmwareVersion":"12.3.1","deviceProtocolVersion":"4.14.0","moduleProtocolVersion":"4.3.0","userConfigVersion":"8.3.0","hardwareConfigVersion":"1.0.0","smartMacrosVersion":"3.1.0"}
[UhkHidDevice] Device communication closing.
[UhkHidDevice] Device communication closed.
[UhkHidDevice] Device communication closing.
[UhkHidDevice] Device communication closed.
[UhkHidDevice] Available devices changed.
[UhkHidDevice] Removed: {"vendorId":"0x37A8","productId":"0x9","path":"DevSrvsID:4295022555","serialNumber":"1484743895","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 80 right half","release":1,"interface":1,"usagePage":1,"usage":2}
[UhkHidDevice] Removed: {"vendorId":"0x37A8","productId":"0x9","path":"DevSrvsID:4295022560","serialNumber":"1484743895","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 80 right half","release":1,"interface":4,"usagePage":1,"usage":128}
[UhkHidDevice] Removed: {"vendorId":"0x37A8","productId":"0x9","path":"DevSrvsID:4295022559","serialNumber":"1484743895","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 80 right half","release":1,"interface":5,"usagePage":1,"usage":5}
[UhkHidDevice] Removed: {"vendorId":"0x37A8","productId":"0x9","path":"DevSrvsID:4295022558","serialNumber":"1484743895","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 80 right half","release":1,"interface":2,"usagePage":65280,"usage":1}
[UhkHidDevice] Removed: {"vendorId":"0x37A8","productId":"0x9","path":"DevSrvsID:4295022557","serialNumber":"1484743895","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 80 right half","release":1,"interface":0,"usagePage":1,"usage":6}
[UhkHidDevice] Removed: {"vendorId":"0x37A8","productId":"0x9","path":"DevSrvsID:4295022567","serialNumber":"1484743895","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 80 right half","release":1,"interface":3,"usagePage":12,"usage":1}
[UhkHidDevice] Can not create device: Error: Can not find connected device
    at ar (/Applications/UHK Agent.app/Contents/Resources/app.asar/electron-main.js:2:462972)
    at async Fr.connectToDevice (/Applications/UHK Agent.app/Contents/Resources/app.asar/electron-main.js:2:481008)
    at async Fr.getDevice (/Applications/UHK Agent.app/Contents/Resources/app.asar/electron-main.js:2:480486)
    at async /Applications/UHK Agent.app/Contents/Resources/app.asar/electron-main.js:2:474034
[UhkHidDevice] Transfer error:  Error: [UhkHidDevice] Device is not connected
    at Fr.getDevice (/Applications/UHK Agent.app/Contents/Resources/app.asar/electron-main.js:2:480536)
    at async /Applications/UHK Agent.app/Contents/Resources/app.asar/electron-main.js:2:474034
[UhkHidDevice] Device communication closing.
[DeviceService] updateFirmware error {"message":"[UhkHidDevice] Device is not connected","stack":"Error: [UhkHidDevice] Device is not connected\n    at Fr.getDevice (/Applications/UHK Agent.app/Contents/Resources/app.asar/electron-main.js:2:480536)\n    at async /Applications/UHK Agent.app/Contents/Resources/app.asar/electron-main.js:2:474034"}
[DeviceService] start poll UHK Device
[UhkHidDevice] Device is not connected

You will need to re-pair those devices first. After successful pairing, Agent should show a yellow bar that lets you to add the connections to the host connection list.

Then switchHost next switches between connections that are active. If you trigger switchHost “name” (according to the name in the agents host connection list), then UHK will try to connect to it even when the connection isnt active at the time.

As for dongle colours:

  • red = unpaired dongle
  • violet = dongle that is trying to connect to a uhk
  • blue = connected to uhk, but not the currently selected host
  • green = current target where hid reports are sent

If a paired device isnt added into the host connection list, it will be unpaired again at next config load.

3 Likes

Thanks again, that’s great information. I unpaired and repaired the bluetooth connection, but no yellow bar appeared to add the connections to the connection list. I got this same result on two Windows 11 x64 computers, an M1 MacBook Pro, and Ubuntu 24.04 x64.

Here’s what works for me in Win11.

Close Agent and then:

  1. On your laptops (or other BLE devices), unpair the UHK80, and then turn off the laptop’s Bluetooth radio as well.
  2. Disconnect the spiral bridge cable from the UHK80. (temporary optional cautionary measure)
  3. Reset the UHK’s right half using the reset button on the back of the board.
  4. After the UHK fully restarts (LEDs/OLED come back on), open Agent to the “Connections” tab.
  5. Then the turn your laptop or other BLE device’s Bluetooth radio back on, and re-pair the UHK.

You should then see the yellow bar at the top with the message:
“A new Bluetooth device has been paired to this UHK. Add it to connections so that you can switch to it.”

It’s also probably a good idea to disconnect the previous BLE devices before trying to add any more to the Connections list.

If this doesn’t work, then you may need to check Agent’s Connections tab for other BLE devices and delete them. Then go back and repeat the process.


Also, like @kareltucek said above, don’t forget that since you have more than one BLE device, you may need to dedicate a switchHost "host name" macro key for each BLE device, instead of using the next/previous/last options. Although in my experience, switching that way doesn’t currently work properly either. If you have multiple BLE devices paired, using switchHost "host name" will appear to select the desired device on the UHK’s OLED display, but the last used BLE device will actually remain activated.

In order to switch between the BLE devices, you may have to turn off the BT radio of the devices you don’t want to use, and then turn on the BT radio for the one you want to switch to. Hopefully that can be fixed in the future.

2 Likes

→ Multiple ble hids - switchHost issues. · Issue #1101 · UltimateHackingKeyboard/firmware · GitHub

1 Like

I can’t get the BLE connection showing in Agent on Linux. The UHK80 is connected to my notebook via right USB-C and when I pair my Tablet i can switch between the two devices. But the Tablet does not show up in Agent (AppImage 5.0.2).
After that, I tried to pair my phone. Pairing worked, but i can’t switch to it. Does anyone has a hint for me? The Win11 recipe did not work :frowning:

:disappointed:

No more ideas.

Please open a ticket in Agent GitHub, and share there your Agent log. Use --log=usb

Sorry, I forgot I was using the latest master branch version of Agent. Adding BLE devices to the connections list isn’t possible in the official release v5.0.2.

Struggling hard on this one since yesterday. Switching with turning off BT on devices is counterproductive. I want to switch from one host to another on the fly as I have both of them on.

So I, too, hope this will somehow be resolved soon.

1 Like

Is this still the case? One one device paired at a time?

For me, I can have multiple BLE devices paired, but only one actually connected at a time.

Connected at a time yes.

I have made some improvements towards switchHost switchover, but there are still some bugs.

1 Like

I cannot get it to switch from one BLE host to another, sticks at the “->”

Have tried the switch option in agent, and switchHost “name” switchhost name

Never moves to the other host