Closed Apollon77 closed 3 years ago
Ha, I got it working ... I "Just" needed to init the crypto session later - so when I move "_pairVerify" one block down it works ... and then it works with both read requests (so characteristic and the ServiceSignature one) ... but no data returned in both cases ...
so whats the semantically correct read request? What do you think?
I never had any issues with that method, so it's hard to say what's going on. I thought I had it all in the right order, but maybe not.
Does your device have a primary or hidden service defined?
I think o finish my work and then write here. Maybe you find time foe a short test then. Otherwise will have users to test it soon too
I'm pretty sure all devices have a primary service, as I think it's a requirement.
According to specs (at least how I read them) it is optional ... and also my BLE device do now show any "primary:true" in jsons (nor the Hue Bridge - IP- or the Eve Energy BLE one
As update, I got things working :-)
Additionally I now know what you mean with the BLE subscription issues ... It's a mess :-(
But in fact I make progress :-)
Hello, I'm using Eve Energy with the Eve Extend in the Network version of the lib, and it's the same for power consumption. even if there is a "ev" you only get it with a getCaracteristic... no event.
@NebzHB With "Network" you mean "Wifi"? interesting ... But ok then I can stop searching ;-))
yes wifi
Ok, in fact getAccessories is fixed on Gatt/BLE. I also added "linked services" but because lacking a devices with linked services Icould not really test it :-(
Anyone of you having such a device? ;-)
See GitHub version for now ... Need to test some more before releaseing it
PS: I was also not possible to get a "list Pairing" response from my BLE device ... and my Hue Bridge returns only an emty array as listPairings response ... strange
Hi @mrstegeman, sorry It's me again :-)
I now started checking with a BLE device and yes seems very special.
Pairing worked directly which was great. Then I tried "get accessories" and directly had two issues where it would be cool to hear your opinion if you find some time to support me understanding it.
First of all the pair Verify failed because
https://github.com/Apollon77/hap-controller-node/blob/main/src/transport/ble/gatt-client.ts#L553-L556
returned not only one characteristic but (as it seems) all. So the assumption of "array only contains one item" was wrong.
I worked around that by adding an array filter, but I still need to understand why noble returned it that way ... strange
Then the verify completed, but then it fails at
https://github.com/Apollon77/hap-controller-node/blob/main/src/transport/ble/gatt-client.ts#L1175
and the device do not respond - and after that connection seems dead - so also the rest of the code (that works if i do not request the primary/hidden service info) is failing.
My question after also checking other libs is:
Should https://github.com/Apollon77/hap-controller-node/blob/main/src/transport/ble/gatt-client.ts#L1169 not be buildServiceSignatureReadRequest ?? (ok I tried it but device also do not answer to this)
was that working for your BLE device?