xavier
January 18, 2021, 11:38pm
1
Hi, I would like to read the battery level on the BLE Gigaset G-tag .
I’ve seen that currently I only get id, name, rssi, and distance.
I haven’t found a way to get the 0000180f-0000-1000-8000-00805f9b34fb service (Battery Service) which includes the 00002a19-0000-1000-8000-00805f9b34fb characteristic (Battery Level).
Can I just edit some configuration files or do I have to wait for new code?
Thanks in advance for any response.
Xavier.
2 Likes
Really old thread here. I’m also searching for a solution to get the battery level. Anyone found a solution for this in the meantime?
DigiH
May 4, 2023, 9:09am
3
Hi @127001
{"ble_read_address":"AA:BB:CC:DD:EE:FF","ble_read_service":"180f","ble_read_char":"2a19","value_type":"HEX","immediate":true}
opened 09:59PM - 04 Mar 22 UTC
closed 07:53PM - 05 Mar 22 UTC
With OpenMQTTGateway-0.9.10 I cannot make reading out the battery level from a G… igaset G-Tag (not the Keeper).
T: Hey I got a callback home/OMG1/commands/MQTTtoBT/config
N: [ MQTT->OMG ]: {"ble_read_address":"7C:2F:80:AA:BB:CC","ble_read_service":"0000180f-0000-1000-8000-00805f9b34fb","ble_read_char":"00002a19-0000-1000-8000-00805f9b34fb","immediate":true}
T: MQTTtoBT json set
T: update WorB
T: update WorB
T: BLE ACTION TTL = 1
T: BLE ACTION Read
T: getDeviceByMac 7C:2F:80:AA:BB:CC
T: update 7C:2F:80:AA:BB:CC
T: getDeviceByMac 7C:2F:80:AA:BB:CC
N: BLE Connect begin
T: Model to connect found: 7C:2F:80:AA:BB:CC
T: processing BLE read
T: Found service: 0000180f-0000-1000-8000-00805f9b34fb
T: Client isConnected, freeHeap: 143940
N: Failed to find characteristic UUID: 00002a19-0000-1000-8000-00805f9b34fb
N: BLE Connect end
N: BLE Connect begin
N: BLE Connect end
N: Send on /BTtoMQTT/7C2F80AABBCC msg {"id":"7C:2F:80:AA:BB:CC","service":"0000180f-0000-1000-8000-00805f9b34fb","characteristic":"00002a19-0000-1000-8000-00805f9b34fb","success":false}
T: jsonPubl - ON
T: [ OMG->MQTT ] topic: home/OMG1/BTtoMQTT/7C2F80AABBCC msg: {"id":"7C:2F:80:AA:BB:CC","service":"0000180f-0000-1000-8000-00805f9b34fb","characteristic":"00002a19-0000-1000-8000-00805f9b34fb","success":false}
The service is found, but the characteristics is not. But actually the UUID of the characteristics should be correct.
$ sudo gatttool -b 7C:2F:80:AA:BB:CC --primary
attr handle = 0x0001, end grp handle = 0x0009 uuid: 00001800-0000-1000-8000-00805f9b34fb
attr handle = 0x000c, end grp handle = 0x000f uuid: 00001801-0000-1000-8000-00805f9b34fb
attr handle = 0x0010, end grp handle = 0x0018 uuid: 0000180a-0000-1000-8000-00805f9b34fb
attr handle = 0x0019, end grp handle = 0x001c uuid: 0000180f-0000-1000-8000-00805f9b34fb
$ sudo gatttool -b 7C:2F:80:AA:BB:CC --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 = 0x0a, char value handle = 0x0007, uuid = 00002a02-0000-1000-8000-00805f9b34fb
handle = 0x0008, char properties = 0x02, char value handle = 0x0009, uuid = 00002a04-0000-1000-8000-00805f9b34fb
handle = 0x000d, char properties = 0x22, char value handle = 0x000e, uuid = 00002a05-0000-1000-8000-00805f9b34fb
handle = 0x0011, char properties = 0x02, char value handle = 0x0012, uuid = 00002a29-0000-1000-8000-00805f9b34fb
handle = 0x0013, char properties = 0x02, char value handle = 0x0014, uuid = 00002a24-0000-1000-8000-00805f9b34fb
handle = 0x0015, char properties = 0x02, char value handle = 0x0016, uuid = 00002a26-0000-1000-8000-00805f9b34fb
handle = 0x0017, char properties = 0x02, char value handle = 0x0018, uuid = 00002a28-0000-1000-8000-00805f9b34fb
handle = 0x001a, char properties = 0x12, char value handle = 0x001b, uuid = 00002a19-0000-1000-8000-00805f9b34fb
$ sudo gatttool -b 7C:2F:80:AA:BB:CC --char-read --uuid=00002a19-0000-1000-8000-00805f9b34fb
handle: 0x001b value: 42
Does the Gigaset G-Tag need special treatment on OMG or anyone knows what's the problem?
Thanks in advance!
Hope this helps
1 Like
Thanks @DigiH !
Unfortunately I only got
{"id":"<mac>","service":"0x180f","characteristic":"0x2a19","success":false}
After adding "mac_type":0
the response was:
{"id":"<mac>","service":"0x180f","characteristic":"0x2a19","read":"64","success":true}
But 64 (100) can’t be right. The battery is quite old.
1 Like
DigiH
May 4, 2023, 10:06am
5
Hmm, as "mac_type":0
is the default when not specified it should have worked without it, possibly adding "ttl":4
or so woudl have also been successful without the mac_type with its several attempts.
That’s what it seems to be reporting back though any possibility to see the battery status in a Gigaset app? Or maybe also have a look at the characteristic with some app like nRFConnect?
Sorry for the delay!
I have now installed nRF Connect but have no idea, what to do with it ;).
Here are the RAW Data of the G-Tag:
LEN TYPE VALUE
2 0x01 0x06
13 0xFF 0x80010215123480AF1AF5BBC5
3 0x02 0x0F18
14 0x09 0x4769676173657420472D746167
Does this help?
DigiH
May 18, 2023, 11:54am
7
There could be a battery service/characteristic shown when connected. But it most likely has the same service/characteristic as used above with the OMG READ command, and the user in the linked issue seems to have the same g-tag model, so 64 hex/100 % might just be correct.
Battery Service
UUID: 0x180F
PRIMARY SERVICE
Battery Level
UUID: 0x2A19
Properties: NOTIFY, READ
Descriptors:
Client Characteristic Configuration
UUID: 0x2902
I’ll wait and see if anything changes.
Thanks for your help!
1 Like