Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USB doesn't revert after unpairing BLE #958

Closed
mondalaci opened this issue Oct 4, 2024 · 4 comments
Closed

USB doesn't revert after unpairing BLE #958

mondalaci opened this issue Oct 4, 2024 · 4 comments

Comments

@mondalaci
Copy link
Member

  1. I pair my Android phone via BLE. The UHK works fine via BLE.
  2. I unpair my phone.
  3. The UHK doesn't work via USB, so I must reboot the right half. In the Zephyr console, I can see that the HID app has been stopped. This used to work.

A bisect revealed that the offending commit is 48c69e0.

@kareltucek
Copy link
Collaborator

. In the Zephyr console, I can see that the HID app has been stopped.

Eh? What or how can you see that?

@mondalaci
Copy link
Member Author

Reading hardware config
Reading user config
Applying user config
User config applied
I: 3 Sectors of 4096 bytes
I: alloc wra: 0, f40
I: data wra: 0, 210
I: SoftDevice Controller build revision: 
I: 36 f0 e5 0e 87 68 48 fb |6....hH.
I: 02 fd 9f 82 cc 32 e5 7b |.....2.{
I: 91 b1 5c ed             |..\.    
I: HW Platform: Nordic Semiconductor (0x0002)
I: HW Variant: nRF52x (0x0002)
I: Firmware: Standard Bluetooth controller (0x00) Version 54.58864 Build 1214809870
I: No ID address. App must call settings_load()
Settings: Found peer 'left' with address 22ef8a977df4
I: Identity: EA:5C:DD:BC:10:F4 (random)
I: HCI: version 5.4 (0x0d) revision 0x118f, manufacturer 0x0059
I: LMP: version 5.4 (0x0d) subver 0x118f
NUS and HID advertising successfully started
Scan module initialized
NUS Client module initialized
Scanning successfully started
Filters matched: left (f4:7d:97:8a:ef:22), connectable:1
Scan connecting: left (f4:7d:97:8a:ef:22)
Filters matched: left (f4:7d:97:8a:ef:22), connectable:0
Connecting failed: left (f4:7d:97:8a:ef:22)
uhk80:right$ Connected to left (f4:7d:97:8a:ef:22)
MTU exchange done with left (f4:7d:97:8a:ef:22)
Security changed: left (f4:7d:97:8a:ef:22), level 4
Resetting left right link! Bidirectional
Service discovery completed
Connected to unknown (ac:d6:18:1b:3d:b5)
Passkey for unknown (ac:d6:18:1b:3d:b5): 794533
Type `uhk btacc 1/0` to accept/reject
BLE HID conn params: interval=11 ms, latency=10, timeout=1000 ms
Numeric Match, conn 0x2000ce08
Security changed: unknown (ac:d6:18:1b:3d:b5), level 4
Pairing completed: unknown (ac:d6:18:1b:3d:b5), bonded 1
BLE HID conn params: interval=7 ms, latency=0, timeout=5000 ms
BLE HID conn params: interval=11 ms, latency=10, timeout=1000 ms
I: starting HID app 1: 1
I: input report sent (size 10)
I: input report sent (size 10)
I: input report sent (size 10)
I: input report sent (size 10)
I: input report sent (size 10)
Disconnected from unknown (ac:d6:18:1b:3d:b5), reason 19
NUS and HID advertising successfully started
I: stopping HID app 1

It's worth mentioning that Zephyr crashes at the first BLE connection attempt and it only works afterward. I can do another bisect regarding the initial crash if justified.

@kareltucek
Copy link
Collaborator

kareltucek commented Oct 4, 2024

Well, I am getting that "stopping HID" log even with the "good" commits, and UHK continues to work just fine. I suspect it refers to bluetooth hid or something.

Given the indicated commit, it seems to be just a minor problem, as in that particular commit, usb state is initialized to "disconnected", but the power-delegate is not yet implemented, so upon disconnecting HID, uhk enters sleep mode in the old locking variant.


I didn't manage to reproduce this on master just now (4fb3c97).

Also, I am not experiencing any Zephyr crash on a BLE connection attempt.

@mondalaci
Copy link
Member Author

As it turns out, this issue is not always reproducible. The relevant Zephyr log:

I: input report sent (size 10)
Disconnected from unknown (ac:d6:18:1b:3d:b5), reason 19
NUS and HID advertising successfully started
I: stopping HID app 1
L2 Suspend
L0 ON

Sometimes, the keyboard and mouse interface keep working despite the stopping HID app 1 message, but usually, the mouse interface doesn't work anymore when switching from my Android phone (BLE) to USB.

Closing this issue in favor of UltimateHackingKeyboard/firmware80#310.

@mondalaci mondalaci transferred this issue from UltimateHackingKeyboard/firmware80 Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants