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: Shell: Bluetooth scan failed (err -22) in audio_shell after trying to connect to a device by name #78659

Closed
babrsn opened this issue Sep 18, 2024 · 4 comments · Fixed by #78846
Assignees
Labels
area: Bluetooth Host area: Bluetooth bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@babrsn
Copy link
Collaborator

babrsn commented Sep 18, 2024

Describe the bug
In audio_shell, after initializing Bluetooth successfully (bt init), attempting to connect to a device by name (bt connect-name <device_name>) fails with the error message: Bluetooth scan failed (err -22).

To Reproduce

  1. Update branch to the latest on upstream.
  2. Build and flash audio_shell to a board.
  3. Initialize Bluetooth using bt init.
  4. Attempt to connect to a device by name using bt connect-name <device_name>.
  5. Observe the error message: Bluetooth scan failed (err -22).

Expected behavior
The device should connect successfully without any errors.

Impact
Minor problem in audio shell that prevents connecting to a device by name.

Logs and console output
N/A

Additional context
N/A

@babrsn babrsn added the bug The issue is a bug, or the PR is fixing a bug label Sep 18, 2024
Copy link

Hi @babrsn! We appreciate you submitting your first issue for our open-source project. 🌟

Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙

@babrsn babrsn changed the title Bluetooth: Audio: Bluetooth scan failed (err -22) in audio_shell after trying to connect to a device by name (bt connect-name <device_name> Bluetooth: Audio: Bluetooth scan failed (err -22) in audio_shell after trying to connect to a device by name Sep 19, 2024
@Thalley Thalley added the priority: low Low impact/importance bug label Sep 19, 2024
@Thalley
Copy link
Collaborator

Thalley commented Sep 19, 2024

IIRC the issue here is that the host stopped allowing connection with a timeout when privacy is enabled. A solution could be to use timeout=0 in the connection parameters and then submit a k_work instead

@Thalley
Copy link
Collaborator

Thalley commented Sep 19, 2024

Removed the audio label as this has nothing to do with the audio shell (it affects any version of the BT shell)

@Thalley Thalley changed the title Bluetooth: Audio: Bluetooth scan failed (err -22) in audio_shell after trying to connect to a device by name Bluetooth: Shell: Bluetooth scan failed (err -22) in audio_shell after trying to connect to a device by name Sep 20, 2024
@babrsn
Copy link
Collaborator Author

babrsn commented Sep 23, 2024

@Thalley please assign it to @babrsn

@Thalley Thalley assigned babrsn and unassigned Thalley Sep 23, 2024
LukaszMrugala pushed a commit to LukaszMrugala/zephyr that referenced this issue Sep 26, 2024
Added a timeout for active scans (instead of using the host's scan
timeout) in the shell by submitting a k_work that stops the scan
after a specified period.

Fixes zephyrproject-rtos#78659

Signed-off-by: Babak Arisian <[email protected]>
vladislav-pejic pushed a commit to vladislav-pejic/zephyr that referenced this issue Sep 30, 2024
Added a timeout for active scans (instead of using the host's scan
timeout) in the shell by submitting a k_work that stops the scan
after a specified period.

Fixes zephyrproject-rtos#78659

Signed-off-by: Babak Arisian <[email protected]>
aescolar pushed a commit to aescolar/zephyr that referenced this issue Nov 4, 2024
…me in shell

Added a timeout for active scans (instead of using the host's scan
timeout) in the shell by submitting a k_work that stops the scan
after a specified period.

Fixes zephyrproject-rtos#78659

Signed-off-by: Babak Arisian <[email protected]>
(cherry picked from commit d8c1d4d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Host area: Bluetooth bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants