Anrijs / Aranet4-Python

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

Basic Inquiry Not Working #29

Closed cxvoth closed 1 year ago

cxvoth commented 1 year ago

Hi, I'm eager to get the Aranet4 integrated into Home Assistant and I found this project that would be perfect.

My Aranet4 device works properly, and the mobile app functions as expected. The device firmware is reported as v0.4.10. "Smart Home" integration is enabled in the mobile app.

aranetctl in installed on Ubuntu 22.04 using Python 3.10 Looks like pip installed version 2.1.3 of Aranet4-Python

ananetctl scan works as expected. I assume the sensor details are not returned during the scan because of the old firmware version.

./aranetctl --scan
Looking for Aranet4 devices...
=======================================
  Name:     Aranet4 12ED5
  Address:  EF:BE:2D:BA:DD:A5
  RSSI:     -43 dBm

However, any attempt to query the device directly never returns a result: ./aranetctl EF:BE:2D:BA:DD:A5 (blocks forever)

I have tried multiple variations with the device paired and unpaired with the mobile phone and computer. Unfortunately the mobile app will not allow me to update the firmware due to "unable to reach firmware service..."

Any ideas?

Anrijs commented 1 year ago

Have you enabled "Smart Home Integrations" in Aranet4 app?

cxvoth commented 1 year ago

yes

Anrijs commented 1 year ago

Did some tests with both v1.2.0 and 0.4.1 firmware on Linux (Raspberry Pi 4). Blocking only occurred when Aranet4 was not paired to system.

cxvoth commented 1 year ago

Thanks for verifying. I focused on ensuring the device was properly pairing: Success.

$ bluetoothctl 
[bluetooth]# discoverable on 
[bluetooth]# pairable on 
[bluetooth]# scan on 
Discovery started 
[CHG] Controller A4:34:D9:EF:21:98 Discovering: yes 
[CHG] Device EF:BE:2D:BA:DD:A5 RSSI: -79 

[bluetooth]# devices 
Device EF:BE:2D:BA:DD:A5 Aranet4 12ED5 

# trust EF:BE:2D:BA:DD:A5 
Changing EF:BE:2D:BA:DD:A5 trust succeeded 

[bluetooth]# info EF:BE:2D:BA:DD:A5 
Device EF:BE:2D:BA:DD:A5 (random) 
Name: Aranet4 12ED5 
Alias: Aranet4 12ED5 
Paired: no 
Trusted: yes 
Blocked: no 
Connected: yes 
LegacyPairing: no 
UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb) 
UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb) 
UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb) 
UUID: Battery Service           (0000180f-0000-1000-8000-00805f9b34fb) 
UUID: Nordic Semiconductor AS.. (0000fe59-0000-1000-8000-00805f9b34fb) 
UUID: Vendor specific           (f0cd1400-95da-4f4b-9ac8-aa55d312af0c) 
ManufacturerData Key: 0x0702 
ManufacturerData Value: 
  21 0a 04 00 00 0c 0f                             !......          
RSSI: -70 
Battery Percentage: 0x5b (91) 

[bluetooth]# agent KeyboardOnly 
[bluetooth]# pair EF:BE:2D:BA:DD:A5 
Attempting to pair with EF:BE:2D:BA:DD:A5 
[CHG] Device EF:BE:2D:BA:DD:A5 Connected: yes 
Request passkey 
[agent] Enter passkey (number in 0-999999): 263384 
[CHG] Device EF:BE:2D:BA:DD:A5 Paired: yes 
Pairing successful 
[CHG] Device EF:BE:2D:BA:DD:A5 ServicesResolved: yes 
[CHG] Device EF:BE:2D:BA:DD:A5 ManufacturerData Key: 0x0702 
[CHG] Device EF:BE:2D:BA:DD:A5 ManufacturerData Value: 
  22 0a 04 00 00 0c 0f                             "......          

[Aranet4 12ED5]# paired-devices 
Device EF:BE:2D:BA:DD:A5 Aranet4 12ED5 

[Aranet4 12ED5]# exit 

$ sudo ./aranetctl EF:BE:2D:BA:DD:A5 

-------------------------------------- 
Connected: Aranet4 12ED5 | v0.4.10 
Updated 86 s ago. Intervals: 300 s 
2016 total log_size 
-------------------------------------- 
CO2:            1093 ppm 
Temperature:    21.1 °C 
Humidity:       47 % 
Pressure:       999.5 hPa 
Battery:        91 % 
Status Display: AMBER 
-------------------------------------- 
cxvoth commented 1 year ago

working as designed