mihome-binary-protocol icon indicating copy to clipboard operation
mihome-binary-protocol copied to clipboard

Errors in the miio.py and protocol docs

Open matangg opened this issue 8 years ago • 1 comments

I tried recreating (in my own Python 2 code) a mihome packet that I sniffed with the protocol docs but I wasn't able to get the MD5 checksum right. The protocol docs say this value should be initialized with zeroes. However, in the miio.py code this field is initialized to the device token value. The init_msg_head function also has an error where it uses an "unknown const" value which should be the Device ID (did) value. When I used my own Device ID with the device token in the md5 checksum field before the MD5 calculation I got the correct packet.

matangg avatar Mar 08 '17 14:03 matangg

Thank you for this comment. You are absolutely right. I spent quite some time debugging my code and realised that what is mentioned in the docs is different from how it is actually implemented.

jaiverma avatar Jun 17 '21 19:06 jaiverma