-
-
Notifications
You must be signed in to change notification settings - Fork 568
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
Cant decode token (invalid start byte) #224
Comments
Could you please try |
Great idea!
|
Looks like it doesn't work anymore in newer versions of construct, the last known version to work was construct==2.9.28 . You can downgrade the package for testing, and then update it back to 2.9.30 (in case some parts of the protocol are broken in 2.9.28, I'm not sure anymore what breaks and when). |
It looks like a problem with one of String classes (there are 4 in construct) but I cant make what is the problem from just looking at this log. String classes recently added support for UTF16/32 but that clearly aint the problem, they also droped support for encoding=None but that aint either. Can you link me the exact source line that parses that string? If its String or CString class, then encoding must be on this list: (utf-8 is not, utf8 is) |
All Construct code used for miio protocol is in The problem is with |
Right, but you got it half wrong. Hex/HexDump still produce It seems I should expand the example: >>> d = Hex(GreedyBytes)
>>> obj = d.parse(b"\x00\x00\x01\x02")
>>> obj
b'\x00\x00\x01\x02'
>>> print(obj)
unhexlify('00000102') |
The code you pointed at: Simple fix: (you probably need to adjust few other lines as well) binascii.hexlify(m.header.value.device_id).decode(), I will update Construct docs to mention this. EDIT: For explanation, the |
Who is affected of this issue? |
I updated the API page to be more accurate what Hex results in. If I may explain myself, the Hex class was never meant (by me) to transform bytes, it was meant to provide hex view of it. But I was sloppy and never got around to properly implementing it, until now. Thats why API change. Old implemenataion was just stale code that wasnt written by me. |
I'm facing the same issue when I try to connect a mi ir remote
|
@smartjx The issue will be fixed with the merge of https://github.com/rytilahti/python-miio/pull/226/files |
I've done pip3 install construct==2.9.31 but seems this issue has not been resolved |
Please post logs and use construct 2.9.30. |
@syssi thank you for your reply. |
SSH to your raspberry pi and provide the output of these commands:
|
@syssi thank you for you guide. MIIO log :
HA Log Token not accepted by device : Unable to discover the device 192.168.1.73 |
Thats definately the known Adapter/path bug, just hang on until #226 is merged. |
@arekbulski The issue is already "fixed" in release 0.3.6. The error shouldn't occur because of the *args, **kwargs. PR #226 won't help here. |
@syssi It seems 0.3.6 still has this issue. I do found an issue open in HA github |
Of course it does. The |
I don't think so. It looks like there are multiple python-miio and/or construct versions installed. @smartjx Please provide the output of
It will point to multiple installs. |
yes I do found multiple installs. |
@syssi Thank you 👍
|
Hi,
i try to discover the vacuum robot on macos.
mirobo discover
does find it, but cannot decode or show the token:Is there some kind of workaround?
Or is it possible to write the token undecoded to a file?
The text was updated successfully, but these errors were encountered: