Airthings / wave-reader

MIT License
50 stars 18 forks source link

Did the Bluetooth UUIDs change? #7

Closed eisenhowerj closed 4 years ago

eisenhowerj commented 4 years ago

Hello, I bought the Airthings Wave specifically because of this project. Anyway, my unit seems to have a different set of UUIDs than the python script is looking for.

Error:

root@radon:~/wave2# python read_wave.py 10 Traceback (most recent call last): File "read_wave.py", line 197, in wave.connect() File "read_wave.py", line 150, in connect self.datetime_char = self.periph.getCharacteristics(uuid=self.UUID_DATETIME)[0] File "/usr/local/lib/python2.7/dist-packages/bluepy/btle.py", line 508, in getCharacteristics rsp = self._getResp('find') File "/usr/local/lib/python2.7/dist-packages/bluepy/btle.py", line 407, in _getResp resp = self._waitResp(wantType + ['ntfy', 'ind'], timeout) File "/usr/local/lib/python2.7/dist-packages/bluepy/btle.py", line 368, in _waitResp raise BTLEGattError("Bluetooth command failed", resp) bluepy.btle.BTLEGattError: Bluetooth command failed (code: 10, error: No attribute found within the given range)`

At first I thought something was wrong with UUID_DATETIME but after singling out each wave.read, none of them work. After picking around and trying to do my own bluetooth debugging, I think the UUIDs have changed.

root@radon:~/wave2# gatttool -I -b A4:DA:32:27:6A:34 [A4:DA:32:27:6A:34][LE]> connect Attempting to connect to A4:DA:32:27:6A:34 Connection successful [A4:DA:32:27:6A:34][LE]> characteristics handle: 0x0002, char properties: 0x02, char value handle: 0x0003, uuid: 00002a00-0000-1000-8000-00805f9b34fb handle: 0x0004, char properties: 0x02, char value handle: 0x0005, uuid: 00002a01-0000-1000-8000-00805f9b34fb handle: 0x0006, char properties: 0x02, char value handle: 0x0007, uuid: 00002a04-0000-1000-8000-00805f9b34fb handle: 0x0008, char properties: 0x02, char value handle: 0x0009, uuid: 00002ac9-0000-1000-8000-00805f9b34fb handle: 0x000c, char properties: 0x02, char value handle: 0x000d, uuid: b42e4dcc-ade7-11e4-89d3-123b93f75cba handle: 0x000f, char properties: 0x2c, char value handle: 0x0010, uuid: b42e50d8-ade7-11e4-89d3-123b93f75cba handle: 0x0013, char properties: 0x10, char value handle: 0x0014, uuid: b42e538a-ade7-11e4-89d3-123b93f75cba handle: 0x0018, char properties: 0x1c, char value handle: 0x0019, uuid: f000ffc1-0451-4000-b000-000000000000 handle: 0x001c, char properties: 0x1c, char value handle: 0x001d, uuid: f000ffc2-0451-4000-b000-000000000000 handle: 0x0020, char properties: 0x14, char value handle: 0x0021, uuid: f000ffc5-0451-4000-b000-000000000000 handle: 0x0025, char properties: 0x02, char value handle: 0x0026, uuid: 00002a23-0000-1000-8000-00805f9b34fb handle: 0x0027, char properties: 0x02, char value handle: 0x0028, uuid: 00002a24-0000-1000-8000-00805f9b34fb handle: 0x0029, char properties: 0x02, char value handle: 0x002a, uuid: 00002a25-0000-1000-8000-00805f9b34fb handle: 0x002b, char properties: 0x02, char value handle: 0x002c, uuid: 00002a26-0000-1000-8000-00805f9b34fb handle: 0x002d, char properties: 0x02, char value handle: 0x002e, uuid: 00002a27-0000-1000-8000-00805f9b34fb handle: 0x002f, char properties: 0x02, char value handle: 0x0030, uuid: 00002a29-0000-1000-8000-00805f9b34fb

[A4:DA:32:27:6A:34][LE]> char-desc handle: 0x0001, uuid: 00002800-0000-1000-8000-00805f9b34fb handle: 0x0002, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0003, uuid: 00002a00-0000-1000-8000-00805f9b34fb handle: 0x0004, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0005, uuid: 00002a01-0000-1000-8000-00805f9b34fb handle: 0x0006, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0007, uuid: 00002a04-0000-1000-8000-00805f9b34fb handle: 0x0008, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0009, uuid: 00002ac9-0000-1000-8000-00805f9b34fb handle: 0x000a, uuid: 00002800-0000-1000-8000-00805f9b34fb handle: 0x000b, uuid: 00002800-0000-1000-8000-00805f9b34fb handle: 0x000c, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x000d, uuid: b42e4dcc-ade7-11e4-89d3-123b93f75cba handle: 0x000e, uuid: 00002901-0000-1000-8000-00805f9b34fb handle: 0x000f, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0010, uuid: b42e50d8-ade7-11e4-89d3-123b93f75cba handle: 0x0011, uuid: 00002901-0000-1000-8000-00805f9b34fb handle: 0x0012, uuid: 00002902-0000-1000-8000-00805f9b34fb handle: 0x0013, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0014, uuid: b42e538a-ade7-11e4-89d3-123b93f75cba handle: 0x0015, uuid: 00002901-0000-1000-8000-00805f9b34fb handle: 0x0016, uuid: 00002902-0000-1000-8000-00805f9b34fb handle: 0x0017, uuid: 00002800-0000-1000-8000-00805f9b34fb handle: 0x0018, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0019, uuid: f000ffc1-0451-4000-b000-000000000000 handle: 0x001a, uuid: 00002902-0000-1000-8000-00805f9b34fb handle: 0x001b, uuid: 00002901-0000-1000-8000-00805f9b34fb handle: 0x001c, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x001d, uuid: f000ffc2-0451-4000-b000-000000000000 handle: 0x001e, uuid: 00002902-0000-1000-8000-00805f9b34fb handle: 0x001f, uuid: 00002901-0000-1000-8000-00805f9b34fb handle: 0x0020, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0021, uuid: f000ffc5-0451-4000-b000-000000000000 handle: 0x0022, uuid: 00002902-0000-1000-8000-00805f9b34fb handle: 0x0023, uuid: 00002901-0000-1000-8000-00805f9b34fb handle: 0x0024, uuid: 00002800-0000-1000-8000-00805f9b34fb handle: 0x0025, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0026, uuid: 00002a23-0000-1000-8000-00805f9b34fb handle: 0x0027, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0028, uuid: 00002a24-0000-1000-8000-00805f9b34fb handle: 0x0029, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x002a, uuid: 00002a25-0000-1000-8000-00805f9b34fb handle: 0x002b, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x002c, uuid: 00002a26-0000-1000-8000-00805f9b34fb handle: 0x002d, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x002e, uuid: 00002a27-0000-1000-8000-00805f9b34fb handle: 0x002f, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0030, uuid: 00002a29-0000-1000-8000-00805f9b34fb

I know I'm "talking" to the right device:

[A4:DA:32:27:6A:34][LE]> char-read-hnd 0x0030 Characteristic value/descriptor: 41 69 72 74 68 69 6e 67 73 20 41 53 [A4:DA:32:27:6A:34][LE]> # Airthings AS <----------------- [A4:DA:32:27:6A:34][LE]> char-read-hnd 0x002c Characteristic value/descriptor: 47 2d 42 4c 45 2d 31 2e 32 2e 34 [A4:DA:32:27:6A:34][LE]> # G-BLE-1.2.4 <-----------------

Let me know if other details are required. I simply turned on device, paired with phone (while I'm testing, bluetooth is turned off on phone) and it went through a firmware update then rebooted.

orjangj commented 4 years ago

Do you have a 2nd generation Wave? If so, then have a look at this issue https://github.com/Airthings/wave-reader/issues/6

eisenhowerj commented 4 years ago

Well damn, thats what it was (swapping the UUID). I did notice at one point something in the bluetooth saying that it was an Airthings Wave+ and I did try the waveplus-reader.

In the other thread you mentioned there is currently no support for Airthings Wave 2nd gen...should I return it and get an Airthings Wave 1st gen?

orjangj commented 4 years ago

By "no support" I meant that we do not have a dedicated script to read values from Wave2, but you should be able to get the waveplus-reader script to work with your Wave2 by applying the changes discussed in issue #6. So no need to get a 1st gen Wave if you want to keep your 2nd gen 🙂

eisenhowerj commented 4 years ago

Ah ok, thanks for the reply