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

"--disconnect" doesn't work on MacOS Monterey #58

Open
tomeyerog opened this issue Oct 28, 2021 · 17 comments
Open

"--disconnect" doesn't work on MacOS Monterey #58

tomeyerog opened this issue Oct 28, 2021 · 17 comments
Labels

Comments

@tomeyerog
Copy link

Hi there,

I am using blueutil to pair my MacBook Pro (2016) on MacOS Monterey with my Google Pixel Buds.

Connecting works perfectly but disconnecting via "blueutil --disconnect f8-0f-f9-ff-93-f9" doesn't do anything.

This worked previously on BigSur.

I am using 2.9.0 of blueutil.

Cheers
Tom

@toy
Copy link
Owner

toy commented Oct 28, 2021

Hi Tom and thank you for opening the issue.

Does the command have success exit code and is there any output at all?
Please try to also run blueutil --disconnect f8-0f-f9-ff-93-f9 --info f8-0f-f9-ff-93-f9.
Would be great if you could also check the command with some other device.

@toy toy added the bug label Oct 28, 2021
@tomeyerog
Copy link
Author

With blueutil --disconnect f8-0f-f9-ff-93-f9 --info f8-0f-f9-ff-93-f9 it works!

@toy
Copy link
Owner

toy commented Oct 30, 2021

Heh, I didn't expect it to fix it, but wanted to see if right after disconnection the status is shown as connected or not. The way it was fixed makes me think in direction of something being released to early, worth investigating. But good that it is at least temporarily fixed for you.

@fire1ce
Copy link

fire1ce commented Nov 16, 2021

can confirm the same behavior:
blueutil --disconnect "ID" -> nothing
blueutil --disconnect "ID" --info "ID" -> Disconnects

Macbook Air - M1
here's the output if it can help:

blueutil --disconnect '04-fe-a1-a2-fe-f8' --info '04-fe-a1-a2-fe-f8'
address: 04-fe-a1-a2-fe-f8, connected (master, 0 dBm), not favourite, paired, name: "EDIFIER R1280DB", recent access date: 2021-11-16 22:41:13 +0000

@toy
Copy link
Owner

toy commented Nov 16, 2021

@fire1ce Thank you for confirming, odd behaviour especially as info outputs that speakers are connected, so they are disconnected right after.

@hkuokka
Copy link

hkuokka commented Nov 18, 2021

I also have the same problem with my M1 Mac mini. After upgrading to Monterey, the disconnect feature stopped working. And for me the workaround described above (adding the "--info" part) does not work.

Running the command with info added gives the same result as above, but the device will not disconnect:
blueutil --disconnect '24-d0-df-85-28-62' --info '24-d0-df-85-28-62' address: 24-d0-df-85-28-62, connected (master, 0 dBm), not favourite, paired, name: "Henri (AirPods Pro)", recent access date: 2021-11-18 11:01:15 +0000

@toy
Copy link
Owner

toy commented Nov 18, 2021

@hkuokka Can you please try blueutil --disconnect '24-d0-df-85-28-62' --wait-disconnect '24-d0-df-85-28-62'?

@hkuokka
Copy link

hkuokka commented Nov 19, 2021

@hkuokka Can you please try blueutil --disconnect '24-d0-df-85-28-62' --wait-disconnect '24-d0-df-85-28-62'?

This works perfectly, thank you so much!

I've used blueutil and switchaudio-osx together to have a quick keyboard shortcut (done with Keyboard Maestro) to quickly connect and disconnect my AirPods Pro and set my audio input/output correctly. And after upgrading to Monterey this stopped working and I've missed this functionality so much. Blueutil has been by far the fastest and most reliable way of accomplishing what I want and now it works again :)

@ivinjose
Copy link

ivinjose commented Dec 9, 2021

This solution works, thanks!

@RobbieMinderhoud
Copy link

@hkuokka Can you please try blueutil --disconnect '24-d0-df-85-28-62' --wait-disconnect '24-d0-df-85-28-62'?

This works perfectly

@butaminas
Copy link

Neither
blueutil --disconnect '24-d0-df-85-28-62' --wait-disconnect '24-d0-df-85-28-62'
nor
blueutil --disconnect f8-0f-f9-ff-93-f9 --info f8-0f-f9-ff-93-f9
works for me on MacOS 12.3 (21E230)

localauthor added a commit to localauthor/launchbar-bluetooth-devices that referenced this issue Apr 1, 2022
"blueutil --recent" and "blueutil --disconnect" don't work in Monterey
(among others)

Until these are fixed, this patch replaces them with "--paired" and
"--wait-disconnect" respectively per:
toy/blueutil#63
toy/blueutil#58
@sidouglas
Copy link

I can report that 12.4 on an M1 Max that blueutil --disconnect 14-3f-a6-6d-bb-92 --wait-disconnect 14-3f-a6-6d-bb-92 DOES work for me. Thanks.

azuwis added a commit to azuwis/blueutil that referenced this issue Mar 26, 2024
IOBluetoothDevice.recentDevices return empty list in macOS Monterey and
later, use IOBluetoothDevice.pairedDevices instead, to make

  --info "BY NAME"
  --connect "BY NAME"
  --disconnect "BY NAME"
  ...

work again.

Fix toy#58 toy#62 toy#63
azuwis added a commit to azuwis/blueutil that referenced this issue Mar 26, 2024
IOBluetoothDevice.recentDevices return empty list in macOS Monterey and
later, use IOBluetoothDevice.pairedDevices instead, to make

  --info "BY NAME"
  --connect "BY NAME"
  --disconnect "BY NAME"
  ...

work again.

Fix toy#58 toy#62
@FantaZZ
Copy link

FantaZZ commented Aug 12, 2024

macOS 14.6.1
Wait long time, nothing happend
image

@toy
Copy link
Owner

toy commented Aug 12, 2024

@FantaZZ Is --disconnect the only action that doesn't work for you? If you use just --wait-disconnect and disconnect using gui, does it work?

@FantaZZ
Copy link

FantaZZ commented Aug 13, 2024

@toy I have not try other action, --disconnect is all I need.

If you use just --wait-disconnect and disconnect using gui, does it work?

I do not know why I should disconnect using gui, my purpose is disconnect use cmd line.
When I try your said. only use --wait-disconnect
image
Then I disconnect using gui.
What is I should expect ?

And I found something maybe useful.
image
Found info by address is not working. Found by name is working.

So I try this.
image
Wait long time, still Nothing happend.

mac mini m1, macOS 14.6.1 , blueutil 2.10.0

@toy
Copy link
Owner

toy commented Aug 17, 2024

@FantaZZ Do you have Bluetooth privacy permission granted for your terminal application (I guess iTerm2)?

And I found something maybe useful.

This is very odd, when device is found in list of connected or by name, it is connected, paired and has a name, but not when found by address.

Just a note that not quoting or quoting address will have no difference, as quoting is a shell feature that doesn't in this case affect the argument that blueutil receives.

@FantaZZ
Copy link

FantaZZ commented Aug 22, 2024

@toy Yes, I have given iTrem2 bluetooth permissions, I confirmed in System Setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants