Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tradfri doesn't respond to encrypted messages #13

Closed
mjg59 opened this issue Mar 12, 2018 · 10 comments
Closed

Tradfri doesn't respond to encrypted messages #13

mjg59 opened this issue Mar 12, 2018 · 10 comments

Comments

@mjg59
Copy link
Contributor

mjg59 commented Mar 12, 2018

After monkey patching http.client to avoid #12 I can successfully pair my Tradfri, but any packet sent after switching to SecureHttp never receives a response.

@jlusiardi
Copy link
Owner

can you attach the dump? afair the stuff was pretty picky about keeping the connection open...

@mjg59
Copy link
Contributor Author

mjg59 commented Mar 17, 2018

get_accessories.zip

Interesting - there does seem to be a response, but we're never doing anything with it. I'll dig further.

@mjg59
Copy link
Contributor Author

mjg59 commented Mar 17, 2018

Oh right the response is just the ack, ignore me. I've also tried adding a Host: header to the request, since that seemed to be the only difference to what an iOS device seems to be sending at this point.

@jlusiardi
Copy link
Owner

The get_accessories dump seems odd. This should contain 0x06 for kTLVType_State somewhere?

@mjg59
Copy link
Contributor Author

mjg59 commented Mar 17, 2018

It looks like there's an 0x06 TLV at the end of each POST to pair-verify, and one at the end of each response?

@mjg59
Copy link
Contributor Author

mjg59 commented Mar 17, 2018

Ah - SecureHttp isn't changing \n to \r\n

@mjg59
Copy link
Contributor Author

mjg59 commented Mar 17, 2018

Yes, adding
data = data.replace("\n", "\r\n")
to the top of _handle_request() makes this work

@mjg59
Copy link
Contributor Author

mjg59 commented Mar 17, 2018

#14

@jlusiardi
Copy link
Owner

so you get progress on the tradfri, any success in switching it on and off?

@mjg59
Copy link
Contributor Author

mjg59 commented Mar 18, 2018

I'm using Hue bulbs, and it turns out that the Tradfri will only expose Ikea bulbs over Homekit :( I suspect it'd work fine now, I'm able to read the accessory-info characteristics.

@mjg59 mjg59 closed this as completed Mar 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants