Aranet4-Python icon indicating copy to clipboard operation
Aranet4-Python copied to clipboard

Abort on mac os

Open blackrez opened this issue 1 year ago • 3 comments

Hello,

I'm trying to use aranet4 on my macbook but I can't scan the aranet4 device.

Here the logs :

(base) ➜  ~ pip3 install aranet4
Collecting aranet4
  Downloading aranet4-2.2.2.tar.gz (13 kB)
  Preparing metadata (setup.py) ... done
Collecting bleak (from aranet4)
  Downloading bleak-0.20.2-py3-none-any.whl (135 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 135.6/135.6 kB 2.7 MB/s eta 0:00:00
Requirement already satisfied: requests in ./opt/miniconda3/lib/python3.9/site-packages (from aranet4) (2.29.0)
Requirement already satisfied: async-timeout<5,>=3.0.0 in ./opt/miniconda3/lib/python3.9/site-packages (from bleak->aranet4) (4.0.2)
Collecting pyobjc-core<10.0.0,>=9.0.1 (from bleak->aranet4)
  Downloading pyobjc_core-9.2-cp39-cp39-macosx_10_9_universal2.whl (737 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 737.1/737.1 kB 3.3 MB/s eta 0:00:00
Collecting pyobjc-framework-CoreBluetooth<10.0.0,>=9.0.1 (from bleak->aranet4)
  Downloading pyobjc_framework_CoreBluetooth-9.2-cp36-abi3-macosx_11_0_universal2.whl (13 kB)
Collecting pyobjc-framework-libdispatch<10.0.0,>=9.0.1 (from bleak->aranet4)
  Downloading pyobjc_framework_libdispatch-9.2-cp39-cp39-macosx_10_9_universal2.whl (20 kB)
Requirement already satisfied: charset-normalizer<4,>=2 in ./opt/miniconda3/lib/python3.9/site-packages (from requests->aranet4) (2.0.4)
Requirement already satisfied: idna<4,>=2.5 in ./opt/miniconda3/lib/python3.9/site-packages (from requests->aranet4) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./opt/miniconda3/lib/python3.9/site-packages (from requests->aranet4) (1.26.14)
Requirement already satisfied: certifi>=2017.4.17 in ./opt/miniconda3/lib/python3.9/site-packages (from requests->aranet4) (2023.5.7)
Collecting pyobjc-framework-Cocoa>=9.2 (from pyobjc-framework-CoreBluetooth<10.0.0,>=9.0.1->bleak->aranet4)
  Downloading pyobjc_framework_Cocoa-9.2-cp39-cp39-macosx_10_9_universal2.whl (390 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 390.5/390.5 kB 3.2 MB/s eta 0:00:00
Building wheels for collected packages: aranet4
  Building wheel for aranet4 (setup.py) ... done
  Created wheel for aranet4: filename=aranet4-2.2.2-py3-none-any.whl size=12940 sha256=fbf6d4d4ab78da8fea5d8ffd850ac7c83e377fdce6f20b7869f35a705c5086c6
  Stored in directory: /Users/nabil_servais/Library/Caches/pip/wheels/0f/23/9f/a72addd44baf97a016e4988280c1e1f1429103d230698e67e6
Successfully built aranet4
Installing collected packages: pyobjc-core, pyobjc-framework-libdispatch, pyobjc-framework-Cocoa, pyobjc-framework-CoreBluetooth, bleak, aranet4
Successfully installed aranet4-2.2.2 bleak-0.20.2 pyobjc-core-9.2 pyobjc-framework-Cocoa-9.2 pyobjc-framework-CoreBluetooth-9.2 pyobjc-framework-libdispatch-9.2
(base) ➜  ~ aranetctl
Device address not specified
(base) ➜  ~ aranetctl --scan
Looking for Aranet devices...
[1]    74329 abort      aranetctl --scan

OS: macOS 13.3.1 22E261 arm64 python version: Python 3.9.16

blackrez avatar Jul 17 '23 08:07 blackrez

I ran into this issue too. The problem is that the scanner needs permission to access bluetooth from Mac OS, but my terminal (in this case, iTerm) wasn't smart enough to show the popup window to authorize it. The two options for solving are:

  1. Run the command from an IDE (in my case PyCharm), which should show the popup
  2. Go into mac settings > Privacy & Security > Bluetooth and add your terminal as an authorized application

samGbos avatar Sep 15 '23 15:09 samGbos

I ran into this issue too. The problem is that the scanner needs permission to access bluetooth from Mac OS, but my terminal (in this case, iTerm) wasn't smart enough to show the popup window to authorize it. The two options for solving are:

1. Run the command from an IDE (in my case PyCharm), which should show the popup

2. Go into mac settings > Privacy & Security > Bluetooth and add your terminal as an authorized application

@blackrez Did this resolve your issue?

Anrijs avatar Oct 02 '23 04:10 Anrijs

FWIW I hit this on macOS 13.6 (Ventura) using iTerm2, and samGbos's solution fixed it :)

chbrown avatar Jan 14 '24 04:01 chbrown