-
Notifications
You must be signed in to change notification settings - Fork 13
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
Anova Nano Support #7
Comments
I don't have an Anova Nano so it's unlikely. I wasn't even aware of the product until seeing this issue. If you're looking to dabble in reverse engineering, the way I figured this out before was a combination of a bluetooth software sniffer app and minimal probing of the app libraries. IIRC, I found enough information via a simple It also looks like there are cheap hardware Bluetooth LE sniffers now. These didn't exist when I did this work 5 years ago. I suspect this may be the simplest path to figuring out the protocol. If you do look further into this I'm more than happy to add support here. Also, if you do hit specific issues/roadblocks feel free to ask questions here. I may be able to help in that regard. |
Thanks for the quick answer! I am indeed already trying to reverse engineer. Capturing the communication is actually easy with the Anova app, an Android phone and the BLE log enabled (at least I think I am getting the right thing). So far I can't get my head around it though. Maybe we need this guy https://www.youtube.com/watch?v=xDDPFHhY7ec ;-) |
If you can post the BLE log here (or in a gist) and the steps you performed in the app I’d be happy to take a look and see if I notice anything. |
This is the log of an Android device, pairing with the Nano and then turning the heating on and off three times. The set temperature was at 75°C during the whole time and the water temperature around 20°C. The Nano part of the log starts around 22:24 with the first appearance of "TexasIns_12:f3:7a (Nano)", I think. |
Hey @neilpa I'm also going to take a crack at getting the nano working. I'll use BLE Scanner and pull some logs, but are you willing to share the logs you got from your tests and any notes you might have? I'll share any progress as I go. |
I finally spent some time digging into Stefan's log from above in Wireshark. I've made a bit of progress but haven't cracked the protocol yet. My working theory is that frames 5029/5031, 5072/5074, and 5116/5118 are the "on" command request/response pairs. Similarly 5065/5067, 5094/5095, and 5138/5139 are the "off" command pairs. These are the only packets that have Furthermore, I have a weaker suspicion that If the above is true, then the "temperature parameter" bytes are @mehlkelm would you be able to take another trace? In particular, can you set the target temperature to a few different values that increase in 1/10th degree increments. Maybe 53.8, 53.9, 54.0, 54.1 and 69.8, 69.9, 70.0, 70.1. Might also be useful to see 1 degree increments in some range too. I've got more detailed notes walking through my process. I'm cleaning those up and will post them as a walk-through of the steps I did to get this far. For now though, here's some # on/off commands
$ tshark -r btsnoop_hci.log -T fields \
-e frame.number -e frame.p2p_dir -e frame.time_relative -e btatt.value \
-Y "hci_h4.type == 2 && btatt.opcode in { 0x52 0x1b } && (btatt.value[2] == 0x0a || btatt.value[2] == 0x0b)"
5029 0 30358.442725000 01020a00
5031 1 30358.521773000 01020a00
5065 0 30367.504277000 01020b00
5067 1 30367.589556000 01020b00
5072 0 30371.009801000 01020a00
5074 1 30371.098829000 01020a00
5094 0 30377.796039000 01020b00
5095 1 30377.875767000 01020b00
5116 0 30380.448411000 01020a00
5118 1 30380.508211000 01020a00
5138 0 30387.683550000 01020b00
5139 1 30387.771845000 01020b00
# set temperature
$ tshark -r btsnoop_hci.log -T fields \
-e frame.number -e frame.p2p_dir -e frame.time_relative -e btatt.value \
-Y 'hci_h4.type == 2 && btatt.opcode in { 0x52 0x1b } && btatt.value[2] == 0x03'
5024 0 30356.371959000 01050308ee0500
5025 1 30356.425288000 01020300
5027 0 30358.302027000 01050308ee0500
5028 1 30358.375456000 01020300
5070 0 30370.929342000 01050308ee0500
5071 1 30371.001720000 01020300
5114 0 30380.302995000 01050308ee0500
5115 1 30380.361782000 01020300
# Or if you want a full JSON extract of above
$ tshark -r btsnoop_hci.log -T json \
-Y 'hci_h4.type == 2 && btatt.opcode in { 0x52 0x1b } && (btatt.value[2] == 0x0a || btatt.value[2] == 0x0b || btatt.value[2] == 0x03)'
... |
I recorded another session. Please excuse the large file, I don't know how to crop the log. 22:53 Current temp. 21.0°C, target temp. is 75.0°C |
Awesome! I'll take a look and see what I can figure out. |
I extracted the raw payloads from what I think are the set temperature commands and correlated them to the temperature you were setting. The table below has the three bytes in both hex and binary. You can see the middle byte increase mostly corresponding to 1/10th degree changes. (I also included the 75.0 setting from the prior trace)
However, the jumps from 42.0 to 50.0 and 50.2 to 64.0 don't make sense yet. There's probably some bit packing/shifting going in here and I'm just not seeing it. Another possibility is that these are always encoded as Fahrenheit and one of the zero bits is actually meaningful. We just aren't "seeing it" because Celsius is about half as granular as Fahrenheit (e.g. F = C * 9/5 + 32). @mehlkelm Can you do one more trace that goes from 51.0 to 51.8 in 1/10th degree increments? That would probably give the insight as to what's happening with that third byte. Also the tshark -r 2019-06-12_btsnoop_hci.log -T fields -e btatt.value -Y 'hci_h4.type == 2 && btatt.opcode in { 0x52 } && btatt.value[2] == 0x03' | uniq | cut -b 7-12 |
Finally got around to more tracing: |
Thanks for the new log @mehlkelm. That trace gave the last clue for the temperature encoding. The upper bit in the "mid-byte" in my above table is always Given that, I can naively replicate the numeric encoding. However, I still don't understand the logic behind this encoding. Another interesting thing to test would be trying the same numeric temperatures but in Fahrenheit to see if units are also encoded in that data. I'll start hacking on a branch to test out some of these ideas. But without a device it's going to be hard to test since it also appears that the initial communication setup is different as well. |
So, since iOS 13 you can easily trace Bluetooth packets in realtime: https://www.bluetooth.com/blog/a-new-way-to-debug-iosbluetooth-applications/ Will be posting some new findings |
Start device
Stop device
Set temp 55
Set temp 66
|
May I ask if there are any news on Anova Nano support? |
@garret No. I don't have a device so any further progress is going to be difficult. It'll likely require someone with a device to pick up where this thread left-off and provide specifics one what the protocol looks like. |
Anova Nano seems to have a new protocol. Any chance you will get to address it?
Thanks! Stefan
The text was updated successfully, but these errors were encountered: