GUIDE - Getting the IRK for your phone

OK, perhaps this should have been obvious, but the Apple Watch showed up correctly in Bermuda when I turned my iPhone on. I had turned it off while retrieving the IRK using the code and the Arduino IDE. I assume in order to use the Apple Watch your iPhone needs to be on, unless something else triggered it to start working I am unaware of…

Awesome! Next step is to configure a few bluetooth proxies in my house and then add some automations.

1 Like

I’ve edited the title of the original post to make it clear that this method works with Android phones as well. Hope that’s OK.

At least, it worked with mine (a Nokia). There’s much more variation in Android devices than there is with Apple, so other brands may be more problematic.

I had less luck with my WearOS watch (a Ticwatch 2). I was able to extract the IRK, but when I tried to use it to set up a Private BLE device I got an error:

This, in spite of the fact that the watch was listed in known devices and had a device tracker entity.

1 Like

I have an ESP32-C3 Super Mini.

I installed Arduino IDE, ESP32 Espressif (which states the C3 Super Mini is included) uploaded the .ino and seem to have fallen at the first hurdle.

COM Port definitely OK.

FQBN: esp32:esp32:esp32_family
Using board ‘esp32_family’ from platform in folder: C:\Users\Smurfs\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.2.0
Using core ‘arduino’ from platform in folder: C:\Users\Smurfs\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.2.0

cmd /c if exist “C:\Users\Smurfs\Desktop\DecodingRandom BT\esp32_get_irk\Arduino\esp32_get_irk\partitions.csv” COPY /y “C:\Users\Smurfs\Desktop\DecodingRandom BT\esp32_get_irk\Arduino\esp32_get_irk\partitions.csv” “C:\Users\Smurfs\AppData\Local\arduino\sketches\9F32F74414D868D212F10864F7DEA69D\partitions.csv”
cmd /c if not exist “C:\Users\Smurfs\AppData\Local\arduino\sketches\9F32F74414D868D212F10864F7DEA69D\partitions.csv” if exist “\partitions.csv” COPY “\partitions.csv” “C:\Users\Smurfs\AppData\Local\arduino\sketches\9F32F74414D868D212F10864F7DEA69D\partitions.csv”
cmd /c if not exist “C:\Users\Smurfs\AppData\Local\arduino\sketches\9F32F74414D868D212F10864F7DEA69D\partitions.csv” COPY “C:\Users\Smurfs\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.2.0\tools\partitions\{build.partitions}.csv” “C:\Users\Smurfs\AppData\Local\arduino\sketches\9F32F74414D868D212F10864F7DEA69D\partitions.csv”
The system cannot find the file specified.
exit status 1

Compilation error: exit status 1

What can I do to help anyone who knows what it is really telling us, to debug this please? I have put a note on Github btw.



[EDIT] I verified that a plain vanilla ESP32-WROOM compiles fine in my IDE install (I even got IRKs for my Apple Watch and iPad) so it must be down to the .ino not being compatible for the ESP32-C3 (despite the Arduino ESP32 Install for Espressif ESP32 including that variant).

OK, replying to my own query, the fryefryefrye fellow came back on Github, apparently you have to use an OLDER version of Arduino for the ESP32C3 (note that the newer version of Arduino, v2.3.6 actually worked OK on my ESP32-WROOM).

Whoever is updating the instructions please note; also to @jackjourneyman for the parallel Guide on this topic.

Older Versions of Arduino IDE available here.

I have moved on PlatformIO and not use Arduino any more.
You have a very new Arduino that I have not been used.
I just try to build this project with Arduino 1.8.10 with ESP32C3. It's OK.

I managed to open keychain access, but when I follow the instructions I get get a list of guids. i get like 50 devices named like MobileBluetooth etc. in the XML there is nothing but <?xml version="1.0" encoding="UTF-8"?>. how did you get your iphobe/watch irk?

Hi

I got the same text as you. The text consists of several lines in that one-line text-box. I just jogged with the arrow keys down to the line Remote IRK, 2 lines down from there I found the Base64 IRK code. Hope this helps you.

I need some help. I have a ring conn smart ring that I want to use but it will only pair with a phone. I have an iphone so I can’t get the IRK from that. Am I correct in assuming my only option is to buy an android phone so I can get the IRK?

Just now I used the Windows tutorial on Private BLE Device - Home Assistant to obtain the IRK’s for both my phone (S20 FE 5G) as well as my Nothing Watch Pro 2.

When trying to add them, the Private BLE integration says it’s not picking up devices that match the entered IRK’s.

That could be right, since I don’t see my phone, nor my smartwatch in the long list of devices in Bermuda. Both have bluetooth enabled (and currently connected to each other), both support BLE… not sure what I’m doing wrong. Did I miss something?

Should maybe note I did not see anything named “irk”, just a valuename using the MAC-address of the device as name and a hex-string that looks like an IRK as value.

edit: I used the ESP32-method, got a different value this time from my phone that is actually accepted, not sure how to use this method with my smartwatch.

I released a new version of my ESPHome IRK capture tool. It’s a native ESPHome package based on the ESP-IDF framework and works on a wide variety of ESP32 hardware. Works on a variety of Apple devices (iPhone, Watch, iPad) and Android phones. Android watches can/are problematic, so YMMV with those devices.

1 Like

I am also researching in getting the IRK for my Oura Ring - I do have an Android phone but from my understanding that you still only get the IRK from the device you are connecting from.

Thus, you will get the IRK of the Android phone.

We cannot initiate the connection from the Ring itself, which would be needed to get the IRK of the Ring.

Perhaps I am not understanding it correctly

@louisp
“I do have an Android phone but from my understanding that you still only get the IRK from the device you are connecting from.”
That’s something I ran into with the Android method, only saw the IRK of my phone, not my smartwatch.

“We cannot initiate the connection from the Ring itself, which would be needed to get the IRK of the Ring.”
Same with my previous smartwatch, I have since then replaced it. The one I have now (Polar Grit X Pro) actually can initiate BLE connections, but only with supported sensors, not sure if it is possible to modify the ESP32-sketch (for obtaining the IRK) in such a way the watch recognizes it as a supported sensor so it will try to connect.

1 Like