Skip to content

Instantly share code, notes, and snippets.

@TheUbuntuGuy
Created April 23, 2017 20:17
Show Gist options
  • Save TheUbuntuGuy/225492a8dec816d49b70d9c21811e8b1 to your computer and use it in GitHub Desktop.
Save TheUbuntuGuy/225492a8dec816d49b70d9c21811e8b1 to your computer and use it in GitHub Desktop.
Decode Anova Precision Cooker WiFi Packets
#!/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)))
@AlmogBaku
Copy link

https://github.com/AlmogBaku/Anova4All
see this for a more holistic solution :)

Thanks @TheUbuntuGuy for the lead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment