Anrijs / Aranet4-Python

Aranet4, Aranet2 and Aranet Radiation Python client
MIT License
212 stars 18 forks source link

"Encryption is insufficient" error #19

Closed mappum closed 1 year ago

mappum commented 2 years ago

I can successfully scan for devices and find my device's ID, but when running aranetctl <uuid> I get the following error:

Traceback (most recent call last):
  File "/opt/homebrew/bin/aranetctl", line 8, in <module>
    sys.exit(entry_point())
  File "/opt/homebrew/lib/python3.9/site-packages/aranet4/aranetctl.py", line 239, in entry_point
    main(argv=sys.argv[1:])
  File "/opt/homebrew/lib/python3.9/site-packages/aranet4/aranetctl.py", line 231, in main
    current = client.get_current_readings(args.device_mac)
  File "/opt/homebrew/lib/python3.9/site-packages/aranet4/client.py", line 374, in get_current_readings
    return asyncio.run(_current_reading(mac_address))
  File "/opt/homebrew/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/opt/homebrew/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
    return future.result()
  File "/opt/homebrew/lib/python3.9/site-packages/aranet4/client.py", line 368, in _current_reading
    readings.stored = await monitor.get_total_readings()
  File "/opt/homebrew/lib/python3.9/site-packages/aranet4/client.py", line 268, in get_total_readings
    raw_bytes = await self.device.read_gatt_char(self.AR4_READ_TOTAL_READINGS)
  File "/opt/homebrew/lib/python3.9/site-packages/bleak/backends/corebluetooth/client.py", line 259, in read_gatt_char
    output = await self._delegate.read_characteristic(
  File "/opt/homebrew/lib/python3.9/site-packages/bleak/backends/corebluetooth/PeripheralDelegate.py", line 147, in read_characteristic
    return await asyncio.wait_for(future, timeout=timeout)
  File "/opt/homebrew/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/tasks.py", line 479, in wait_for
    return fut.result()
bleak.exc.BleakError: Failed to read characteristic 44: Error Domain=CBATTErrorDomain Code=15 "Encryption is insufficient." UserInfo={NSLocalizedDescription=Encryption is insufficient.}
mappum commented 2 years ago

I'm on macOS 12.3, python 3.9.13.

ukBaz commented 2 years ago

Have you paired your sensor with your mac?