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

Bluetooth classic pairing from Pico W HID host to any Android BluetoothHidDevice fails #612

Open
Slion opened this issue Jun 19, 2024 · 3 comments

Comments

@Slion
Copy link

Slion commented Jun 19, 2024

Pico W SDK 1.5.1

Bluetooth classic pairing from Pico W HID host to any Android BluetoothHidDevice fails.
It works fine when connection is initiated from the Android device.
Other HID host such as PCs are known to be able to initiate pairing fine.

Here are the logs when the tablet is not discoverable:
pair-fail-pico-to-tab-s8.zip

Here are the logs when the tablet is discoverable:
pair-fail-pico-to-tab-s8-visible.zip

Somehow they are quite different.

@mringwal
Copy link
Member

Logs are good now, but please post complete logs from start.

pair-fail-pico-tab-s8: looks like remote hast lost the link key - see Authentication Complete Event with "PIN or Key Missing". Please delete local bonding(e.g. with gap_delete_all_link_keys)

pair-fail-pico-tab-s8-visible: authentication works - you get Authentication Complete Event with status 0x00 and Encryption Changed event. There's an unexpected ACL packet which gets dropped by the stack. Then the log stops in the middle of a Information Request. BTstack is supposed to send an L2CAP Information Response... not sure if the Pico crashed here or what happened.

@Slion
Copy link
Author

Slion commented Jul 1, 2024

BTstack is supposed to send an L2CAP Information Response... not sure if the Pico crashed here or what happened.

I noticed that when calling hid_host_connect the timer callback I use to perform tasks including blinking the LED is not called anymore until hid_host_disconnect is called. It sounds like your observation could match that behaviour. Something is preventing the event loop to run somehow.

@Slion
Copy link
Author

Slion commented Jul 4, 2024

Those are logs of the Pico W trying to connect to Interface on HONOR Magic V2 using hid_host_connect. It hangs until the Android app is sent to the background. Meaning my btstack timer callback that blinks the LED is not called anymore until the Android app is sent to the background. Both devices have bonded already and the connection works when initiated from the Android device.

The weird thing is that as the Pico tries to connect it would cause the phone to connect to the PC. So I unpaired the PC and it would trigger pairing request with the PC. So I unplugged the PC Bluetooth dongle but it would not work any better.

host-connection-fail.zip

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