toy / blueutil

CLI for bluetooth on OSX: power, discoverable state, list, inquire devices, connect, info, …
https://github.com/toy/blueutil
Other
969 stars 52 forks source link

`--inquiry` not working, but Bluetooth Preferences MacOS GUI correctly discovering mouse - Catalina & Big Sur #60

Open cristiano-belloni opened 2 years ago

cristiano-belloni commented 2 years ago

I'm trying to pair one of my computer with my Logitech MX Master 2S.

image

image

This happens with blueutil 2.9.0, installed via brew on Catalina (MacBook Pro (Retina, 15-inch, Mid 2015)) and Big Sur (MacBook Pro (16-inch, 2019).

CHBrianLiu commented 2 years ago

Same issue here. I couldn't find the Bluetooth device from the --inquiry command, but the device was visible from the Preference UI.

image

toy commented 2 years ago

Thank you both for reporting, do you have possibility to check same actions with different bluetooth device and to check same device with different computer?

CHBrianLiu commented 2 years ago

Hi @toy, thanks for checking this. I think I can help test on another device.

I've tried on another Mac, MacBook Pro (13-inch, M1, 2020), which runs MacOS 11.4. My Magic Keyboard (not the same keyboard I reported above, sorry that I don't have it with me now) can be detected by blueutil. And all the peripherals presented in the System Preferences are in the list as well.

If there's anything that can help you troubleshoot, I'm willing to provide more information or logs. Thanks for the kind help.

toy commented 2 years ago

@CHBrianLiu Thank you for checking, this means that it at least doesn't affect all systems running 11.4.

Would be great if you can also check inquiry with some other device on affected system and if the issue stays after system restart.

fedekrum commented 2 years ago

Tell me what to do and I can help. Having same issue on my mac

fedekrum commented 2 years ago

Using Catalina. It may be something related to the more restricted access of apps and scripts to BT and other security things that have to be approved at the "Security and Privacy" Control panel.

fedekrum commented 2 years ago

Yesssss !!! That is !!! You must go to "System Preferences - Security & Privacy - Privacy (tab) - Developer Tools" and allow "Terminal" application to run software without a system security policy.

Is not a bug, is a matter of permission.

fedekrum commented 2 years ago

Screenshot 2021-12-01 at 04 09 44

toy commented 2 years ago

@fedekrum Thanks for investigating! My attempt at reproducing was not completely successful - I wanted to check if allowing bluetooth interaction (instead of "Developer Tools") will also work, but after it started working with the option it didn't stop working after disabling and removing the option, and even after restarting.

@cristiano-belloni @CHBrianLiu Can you try checking if permissions are the issue?

siutsin commented 1 year ago

Hi @toy I have a similar issue with my Logitech MX Anywhere 3 mouse, but NO problem with the Logitech M557 mouse, Apple Magic Mouse, and Keychron K10 keyboard.

I have to add iTerm to BOTH Developer Tools and Bluetooth in System Preferences - Security & Privacy - Privacy to see the Logitech MX Anywhere 3 mouse with blueutil --paired - adding only either of these will not be visible.

I am using macOS 12.6.2 and am unsure what the difference is between the new mouse and other devices, but it is problematic as I don't have admin right on some of the laptops I would like to pair. I am wondering if there is any way to pair it up without the admin privilege?

toy commented 1 year ago

@siutsin Checking if I can reproduce I noticed that without adding Bluetooth permission for terminal app (or by turning it off) I don't see my connected mouse both using blueutil --paired and blueutil --connected, but permission doesn't affect seeing a headset and a keyboard. Also no Developer Tools permission for the terminal. So looks like it is down to understanding the difference between devices from os perspective.

fbukevin commented 1 year ago

Same issue to me

milindprajapati commented 3 months ago

I am seeing an issue with blueutil --inquiry on macOS Ventura. Is anyone facing same issue? It will get stuck at blueutil[900:16498] -[IOBluetoothDeviceInquiry initWithDelegate:] - 0x600002568090

toy commented 2 months ago

@milindprajapati Can you have a look if #66 works for you?

ankou29666 commented 3 weeks ago

I am seeing an issue with blueutil --inquiry on macOS Ventura. Is anyone facing same issue? It will get stuck at blueutil[900:16498] -[IOBluetoothDeviceInquiry initWithDelegate:] - 0x600002568090

same issue for me on 2015 mbp on Sonoma with OCLP. Getting value 0x600003fec020 instead.

keyboard (logitech craft) paired successfully via preferences on Monterey. Sonoma discovers the keyboard but never prompts for PIN code. But did prompt me for PIN when pairing my phone. MX master 3S paired smoothly also.

toy commented 3 weeks ago

@ankou29666 I assume OCLP stands for OpenCore-Legacy-Patcher, if yes than it may be one more reason for framework or api problems on top of existing issues with supported hardware/os. The 0x600003fec020 is most probably just memory address, the line is logged by framework and I didn't yet find a way for it to not log the line. I also don't really understand the description, do you have inquiry or pairing problem? Overall are you using the latest version of blueutil, as it contains an attempt to fix the inquiry problem?

ankou29666 commented 3 weeks ago

the last version being supported on 2015 macbook pros being Monterey, OpenCore Legacy Patcher is the only way to have a more recent version installed.

and yeah the 0x60000 stuff changes everytime I change the 1/2/3 slot on the keyboard (sorry English is not my mother tongue, what I mean is trying to affect the macbook pro on the 2nd or 3rd "slot", the first one being affected to another computer)

i've recently installed blueutil with the homebrew method, the install was made around two monthes ago. I'll confirm this as soon as I get back access to that machine.

toy commented 3 weeks ago

the install was made around two monthes ago

@ankou29666 Please check the version then, as v2.10.0 was released less than 2 months ago

ankou29666 commented 3 weeks ago

I confirm it's 2.10.0