Getting the IRK on recent Android phone (Pixel 8, Android 15) #551
Replies: 2 comments 2 replies
-
Glad you got it sorted! Where did you find a suggestion to use wireshark? I'd have thought the IRK wouldn't be sent in plaintext but if wireshark has a built-in protocol follower I guess it could do it. Just haven't seen that described, as far as I can recall (or I might have and immediately dismissed it - which might be why it's not in the wiki 😄 ) For that matter, the amount of BS guides online was exactly why I wrote the wiki page, so now there'd be another one! 🤣 I figure the espresense and fyrefyrefyre methods as probably being about equal in difficulty, and I certainly don't discourage the espresense method, I've just never tried it - good to have a run-down on how it works though! I think I was mostly just unsure if the UI for it was on-device or needed something else installed, or MQTT running.
between ESPresense and ESPHome, to be picky 😄 By the way, you might still want to enable the iBeacon transmitter in the companion app - not because you need iBeacons, but because it keeps the phone transmitting (and at a chosen power level) - which it might not if just left to its own devices - ymmv. |
Beta Was this translation helpful? Give feedback.
-
Did you reverse the keys when you found them and account for endians? when I tried this recently I had to adjust the endian for it to work -- you could check this manually now if you have logs of the keys you found. in case you're not familiar, this is what reversing the key in terms of endianness: 1234AB reversed would be (each pair is reversed) AB3412 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I would consider myself perhaps a medium level wizard, nonetheless I struggled more than I thought should be necessary to determine the IRK of my phone.
Maybe this is because it's a (relatively) new-ish phone, and maybe Android changed some things (I am on Android 15)? Or maybe I am just thick. 😆
At any rate, hopefully the following is helpful to someone...
Internet awash with bad information
First of all, almost all the information on the Internet (about getting your IRK) seems to be about Apple/iPhones. The ESPresence project even recommends using the HA Companion app to send an iBeacon, instead of trying to determine the IRK. Which did not sound like the ideal approach to me.
Wireshark (did not work (for me))
Wireshark did not work for me. I tried several captures, here were some of the issues I experienced with that approach:
adb
takes quite a while to create each one, often stopping for quite long periods, making me think it had frozen. But no, just be patient. As always with serial connections, try to use a good quality cable which is as short as possible.ESPresence (did work)
So, what did work finally? Using ESPresence to get the key. It actually worked quite well, easily, and quickly!
I had held off on this as it was sort of recommended against in the wiki here, as well as being essentially against the recommendations of the ESPresence project themselves. But this is apparently all incorrect and perhaps out-of-date information, which was the main reason I decided to make this post.
I actually wish I would have went this way first, as I wasted a lot of time last night and this morning banging my head the Wireguard way. Anyway...
It's pretty straightforward, just follow instructions to flash ESPresence onto any ESP32 device. I even used the same ESP32 device I had been using for Bermuda experiments (which is no problem at all to flash back, as long as you have the YAML source). ESPresence even provide a web-based installer. I used Chromium here (as I block a lot of stuff in my main (Firefox) browser and my experience has shown me these kind of things work better in Chromium). But it was pretty quick and easy:
Now, follow the iPhone instructions for 'Enrollment' from an iPhone. Never mind that we are using an Android.
IRK:<blablabla>
. This is the critical bit we are looking for. Copy this somewhere safe.This part seemed a bit janky, you might have to repeat 2-3 times before you are successful.
Once you have the IRK, you can delete the 'ESPresence' device from the Bluetooth menu on your phone.
Enter IRK into 'Private BLE Device' Integration
Bonus tip
If you have more than one Android (or iPhone) device in your household, leave the ESPresence device up and running until you have collected all your IRKs.
I was in a hurry to test, and a bit frustrated, so I immediately flashed back to Bermuda. So now I will need to do more flashing back and forth from ESPresence to Bermuda. Not the end of the world, but could have been avoided.
Cheers!
Beta Was this translation helpful? Give feedback.
All reactions