How to properly disable bluetooth while connected via USB?

I have my UHK80 connected to PC via USB, halves are also connected via wire, and I don’t have batteries at all.
However, Bluetooth icon appears in the top left corner of the display. And indeed, on my laptop I can find UHK80 among available Bluetooth devices, and initiate pairing. I believe that that started after I upgraded to firmware version 13.0.0.

I tried to disable Bluetooth by using following macros: bluetooth toggle advertise, bluetooth noAdvertise, bluetooth toggle noAdvertise nothing of which seemed to have any effect.

How do I control Bluetooth connectivity?

I assume you need to first use set bluetooth.alwaysAdvertiseHid 0, and then the advertise macros should work. (working for me using FW v13.0.1)

You can also fully disable BLE with set bluetooth.enabled 0, but that will disable the dongle as well, if you have one.

2 Likes

Also, please show off your white UHK80! I haven’t seen any of the colored cases in the wild yet…

2 Likes

Thank you very much! Worked like a charm. I ought to have been able to found it in the reference manual, but somehow missed it entirely.

The whole macro now looks like this and works as intended:

set bluetooth.alwaysAdvertiseHid false
bluetooth toggle advertise
1 Like

Sure thing! :slight_smile:

Here are some pics:



I had UHK 60 v1 before, which was black and had a wooden palm rest, and decided to experiment with something new for UHK 80. White case looks very beautiful indeed! I wonder if I can somehow recolor the palm rests to something whiter, though.
Also believe it will look even nicer with blue-white keycaps, which I already ordered form Yuzu. Certainly will show off once again when they arrive :smiling_face:

4 Likes

Please do so!

I really like the white line around the dark OLED display. Wondering if more of those lines could be created, e.g. on top of the left half in place of the large white area.

2 Likes

It does look good, doesn’t it?
When I get my yellow case, i think I’ll try to temporarily fill the recessed logo on the left half with wax or something and use black paint around it to mimic the right side.

I’m at least gonna paint the logo itself black or something to give it some contrast.

1 Like

Looking forward to seeing that!

1 Like

Hi @pcooke9 is this supposed to make the Bluetooth icon disappear from the OLED display:

set bluetooth.enabled false

I have this configured as a macro, but if I hit the key that is bound to the macro the icon still appears on the display.
Am I doing something wrong?
I tested another example macro and that works, so I guess the macro config itself is good.

Thanks

There are some advertising bugs in 13.x releases that are probably responsible. Sorry about that! You can try the build from [Dev build] Testing request: Bluetooth ble-hid-to-ble-hid switchovers - #8 by Tunney , but that one has other issues.

But yes, the config looks correct and the bluetooth icon should disappear.

I assume the icon should go away, but you’re right, it doesn’t. It seems to only be a graphical bug though. The set bluetooth.enabled false macro is a global BLE kill-switch AFAIK (including the dongle). I tested it to be sure, and my dongle/BLE devices are still being disabled (as they should), regardless of the icon status.

Just for clarity; the BLE icon currently retains it’s OLED visibility status when using set bluetooth.enabled 0. If you change the BLE advertising mode while it’s disabled, the icon will update after re-enabling BLE via set bluetooth.enabled 1.

The same is true with the BLE pairing mode icon.

Until a fix is available, you can disable the BLE icon with bluetooth noAdvertise, and then use set bluetooth.enabled 0 to fully disable BLE (if fully disabling it was what you were wanting to do).

2 Likes

The issue persists with “13.0.1-bluetooth_glitches-v1” as well as latest master branch (1054a85).

@pcooke9, thanks a lot, do you have GitHub issue for that?
Also, so I tried to run the bluetooth noAdvertise command as part of a macro, but it does not seem to have any effect on the icon, maybe I’m doing something wrong, I’m not a macro expert yet.
I also tried to enable bluetooth first with a macro (set bluetooth.enabled 1), and run the bluetooth noAdvertise after that, but the icon stays.

I’m on 13.0.1.

:person_facepalming:

There is an additionl config: bluetooth.alwaysAdvertiseHid.

noAdvertise basically switches to default mode: exits advertise or pair mode if they are not default. When advertising mode is default though (alwaysAdvertiseHid is 1, which it is by default), then it switches to advertise mode.

I will change the behavior somehow as this is confusing.

1 Like

Looks like Karel’s on it:

If it seems like I know what I’m doing, let me assure you, I definitely do not. I’m not a coder by any means, just a village idiot with a lot of time on my hands.:sweat_smile:

1 Like

@kareltucek Am I correct to assume that if someone only wants to initiate BLE advertising manually, they can just put set bluetooth.alwaysAdvertiseHid 0 in $onInit, and use bluetooth toggle advertise?

That would also help prevent BLE advertising if the UHK80 happened to crash/reboot while AFUHK… right?

Sorry if that’s a dumb question; I’ve been awake for far too long…

Yes, exactly that was the idea :slight_smile:

Although we still advertise nus, so I am not sure if it helps you :frowning:

1 Like

The more important aspect for me, is to prevent people from spamming connection attempts when I’m away. Even if the NUS entries are visible, I don’t think it’s “possible” to connect to them under normal circumstances, so I’m happy with it. :grinning_face_with_smiling_eyes:

Well, the thing is that I am not so sure about that :sweat_smile:.

Well, I can’t intentionally connect to the NUS entries, so if one of my troll neighbors manages to do it, I hope they come and tell me how… :rofl:

3 Likes