Created
April 23, 2017 20:17
-
-
Save TheUbuntuGuy/225492a8dec816d49b70d9c21811e8b1 to your computer and use it in GitHub Desktop.
Decode Anova Precision Cooker WiFi Packets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import math | |
f = open("rawdump.txt", "r") | |
for l in f.readlines(): | |
p = 0 | |
chars = [] | |
chksum = 0 | |
for i in range(0, len(l), 2): | |
line = l[i:i+2] | |
if line != "\n": | |
byte = int(line, 16) | |
p += 1 | |
if p == 2: | |
print("Len: {}".format(byte)) | |
if p == math.floor((len(l)/2) - 1): | |
chksum = chksum & ((2**8) - 1) | |
if byte == chksum: | |
print("Chksum: OK") | |
else: | |
print("Chksum: FAIL. Read: {} != calc'd: {}".format(line, chksum)) | |
if p >= 3 and p < (len(l)/2) - 2: | |
chksum += byte | |
n = (p - 2) % 7 | |
byte = byte >> (n) | ((byte & (2**n)-1) << 8-n) | |
chars.append(chr(byte)) | |
print("{}\n".format(''.join(chars))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/AlmogBaku/Anova4All
see this for a more holistic solution :)
Thanks @TheUbuntuGuy for the lead