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

Blueutil binary not working on silicon Macs #35

Closed
aymane-eljerari opened this issue Feb 11, 2023 · 22 comments
Closed

Blueutil binary not working on silicon Macs #35

aymane-eljerari opened this issue Feb 11, 2023 · 22 comments

Comments

@aymane-eljerari
Copy link

I opened blueutil and notificator as shown in the installation guide, but I still can not interface with my bluetooth devices through alfred.

@aymane-eljerari
Copy link
Author

Running this command within the workflow directory

xattr -d com.apple.quarantine ./blueutil

returns this

xattr: ./blueutil: No such xattr: com.apple.quarantine

@vegardinho
Copy link
Owner

I'll need some debugging info if you want me to take a look at it. Your command line return indicates that there is no quarantine on that file, so the issue is somewhere else.

@aymane-eljerari
Copy link
Author

Yes, how can I provide the debugging info? Is there a log file somewhere?

@vegardinho
Copy link
Owner

vegardinho commented Feb 13, 2023

Take a screenshot from the outout of the Workflow Debugger

@aymane-eljerari
Copy link
Author

This is what the debugger shows, when I run bton. Is the Bluetooth controller compatible with apple silicon?

Screenshot 2023-02-13 at 5 30 28 PM

@vegardinho
Copy link
Owner

vegardinho commented Feb 15, 2023

Might be that I accidentally removed cross compatibility in the last update. Try to replace the blueutil binary file with the one below (or install the alternative workflow, also below; in that case, the commands for on/off are 'btw' and 'bty'), and see if that fixes it.

Edit: I have to ask you to do it, because I don't have a computer with apple silicon myself.
Archivo comprimido.zip

@JSFLJ
Copy link

JSFLJ commented Sep 7, 2023

@vegardinho the above file still does not fix this issue on apple silicon. I am having this exact same issue.

I used your alternative workflow (in the zip file).

@vegardinho
Copy link
Owner

Can you try this workflow? Make sure to delete or rename the commands of the old workflow first.
Bluetooth Controller Beta.zip

@JSFLJ
Copy link

JSFLJ commented Sep 19, 2023

Hi @vegardinho, unfortunately that did not solve my problem. Still getting the following issue in the debugger.

[19:19:55.075] Logging Started...
[19:19:59.115] Bluetooth Controller Beta[Script Filter] Queuing argument '(null)'
[19:19:59.213] Bluetooth Controller Beta[Script Filter] Script with argv '(null)' finished
[19:19:59.217] ERROR: Bluetooth Controller Beta[Script Filter] Code 1: security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.
Traceback (most recent call last):
File "../Alfred.alfredpreferences/workflows/user.workflow.C9093872-1204-4C4D-82EF-6A073DE4A8CC/./scripts/return_device_json.py", line 137, in
main()
File "../Alfred.alfredpreferences/workflows/user.workflow.C9093872-1204-4C4D-82EF-6A073DE4A8CC/./scripts/return_device_json.py", line 39, in main
js_bytes = check_output(cmd_args)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 424, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 505, in run
with Popen(*popenargs, **kwargs) as process:
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1821, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 86] Bad CPU type in executable: './blueutil'

@vegardinho
Copy link
Owner

Can you try running the binary below directly?

cd ~/Downloads/blueutil (or wherever you unzip the file)
./blueutil --paired

Does it run as expected?

Also, if you could install blueutil with homebrew/macports/other and send me the installed version (check where it is by running whereis blueutil), that would be great.

blueutil.zip

@JSFLJ
Copy link

JSFLJ commented Sep 29, 2023

After running the terminal commands, I get;
zsh: bad CPU type in executable: ./blueutil

For blueutil version;
blueutil -v
2.9.1

Looking forward to solving this issue.

@vegardinho
Copy link
Owner

@JSFLJ Could you also do this?

Also, if you could install blueutil with homebrew/macports/other and send me the installed version (check where it is by running whereis blueutil), that would be great.

Essentially, I'm trying to figure out whether the binary provided by homebrew/macports is universal or targeted against specific architecture (apple chip/intel).

@JSFLJ
Copy link

JSFLJ commented Jan 10, 2024 via email

@rh10hd
Copy link

rh10hd commented Jul 19, 2024

Can you try this workflow? Make sure to delete or rename the commands of the old workflow first. Bluetooth Controller Beta.zip

This beta version works well on Sonoma 14.5, M1 Chip. Thank you for making this workflow🥳
btsetfavorite

@JSFLJ
Copy link

JSFLJ commented Jul 26, 2024

@rh10hd could you please tell me step-by-step how you did it please?

Can you try this workflow? Make sure to delete or rename the commands of the old workflow first. Bluetooth Controller Beta.zip

This beta version works well on Sonoma 14.5, M1 Chip. Thank you for making this workflow🥳

@rh10hd
Copy link

rh10hd commented Jul 27, 2024

@rh10hd could you please tell me step-by-step how you did it please?

Can you try this workflow? Make sure to delete or rename the commands of the old workflow first. Bluetooth Controller Beta.zip

This beta version works well on Sonoma 14.5, M1 Chip. Thank you for making this workflow🥳

@JSFLJ
I deleted the older version, downloaded the beta version and followed the Installation step by step. You can check the dependencies in Alfred preferences after installing the workflow. I guess that might help a bit.

Don't forget to allow Alfred to have access to bluetooth. That's the point, I found that it was this step that caused the workflow to not work. Once I opened the setting, the workflow worked immediately!

BTW, when you try to Remove quarantine using terminal for blueutil or notificator, it may return xattr: ./blueutil: No such xattr: com.apple.quarantine. Don't worry, I tried several times and the same thing happened. Just make sure you've installed both of them as required.

I hope this would help you.

@JSFLJ
Copy link

JSFLJ commented Jul 27, 2024 via email

@vegardinho
Copy link
Owner

Thanks, @rh10hd! And I'm glad you got it working, @JSFLJ!

I've now created a new version that relies on Homebrew installation through Alfred's 'Resolve Dependencies' feature. That should therefore rid any problems with architecture!'

There is one caveat, though: I'm not sure if this version too requires manual removal of quarantine. Could you test this beta to see if it works automatically, once you've run 'Resolve Dependencies', or if you get an error because blueutil must be allowed to run? Remember to delete the current version first.

If this version also requires manual removal of quarantine, I'm not sure I'll implement it, as there'll be too many installation steps.
Bluetooth Controller Beta 4.0.2.zip

@vegardinho vegardinho changed the title bton does not turn on bluetooth. Blueutil binary not working on silicon Macs Jul 28, 2024
@rh10hd
Copy link

rh10hd commented Jul 29, 2024

Thanks, @rh10hd! And I'm glad you got it working, @JSFLJ!

I've now created a new version that relies on Homebrew installation through Alfred's 'Resolve Dependencies' feature. That should therefore rid any problems with architecture!'

There is one caveat, though: I'm not sure if this version too requires manual removal of quarantine. Could you test this beta to see if it works automatically, once you've run 'Resolve Dependencies', or if you get an error because blueutil must be allowed to run? Remember to delete the current version first.

If this version also requires manual removal of quarantine, I'm not sure I'll implement it, as there'll be too many installation steps. Bluetooth Controller Beta 4.0.2.zip

(I’m not an English native speaker, some words and grammars might be used incorrectly, so I hope this does not cause you any misunderstanding or inconvenience.)

Hi @vegardinho . Wow! Thanks for updating the workflow!! I became the lucky one to have a try on the new beta version😉I installed it as soon as I received your mail, it worked well on my Mac! I didn’t even resolve the dependencies in Alfred preferences. So I think the problem is that the Alfred doesn’t have the access to Bluetooth. Giving Alfred the permission to control the Bluetooth is not mandatory so lots of people would not do that lol.

Nevertheless I have to say that I’ve installed bluetil on the previous beta version so I’m not sure that whether this would affect the new beta version.

Moreover, in the course of using this workflow, I’ve met 2 bugs. First, when I toggled connection with Bluetooth device, some devices displayed the previous name (I’ve used those names before) but the names on BLUETOOTH STATUS were normal. It ‘s a bit annoying, but it doesn’t bother me much.

Second, when I tried to toggle/reset the Bluetooth status, the list filter didn’t show up. I had to press the right arrow button to use the Universal Action and then press Escape. I’m sorry that I can’t reproduce the problem, but I’ve found the solution on the Alfred forum, hope that you could improve it in the next version.

Regardless, the new beta version is BRILLIANT even though there are a few minor issues. Thanks again!

@vegardinho
Copy link
Owner

vegardinho commented Jul 29, 2024

Thanks for the feedback, @rh10hd!

Maybe you're right that allowing Alfred to manage bluetooth is sufficient! Still, I'm not comfortable ruling out the possibility of it not being enough – besides, what about the notifcator binary? I assume Alfred is already allowed to post notifications? The fact that you were able to run homebrew-blueutil without allowing it specifically, though, is promising!

I think I've fixed the bug related to the confirmation, using your suggestion. Try installing the beta below to see if you still get the same problem behavior as before.

The device names is not really something I've changed in the latest releases, so it's not really related to this beta. If you continue to get old names, feel free to create a new issue! If you are able to first reproduce the error on a different computer, to rule out your computer being the error source, that would be great – but feel free to post the issue either way.
Bluetooth Controller Beta v4.1.zip

@rh10hd
Copy link

rh10hd commented Jul 30, 2024

Thanks!! @vegardinho
I forgot to mention the notificator, because it has been working well on my Mac since I first installed the workflow. So is now! I can control it on systems setting's notication directly. The new version works fine, although the names of some of devices are still problematic, but I've put them behind me (as they don't affect normal use)
Thank you for developing and maintaining this workflow. I love it!

@vegardinho
Copy link
Owner

Now pushed v4.2. Closing this issue.

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

4 participants