Arduino-HomeKit-ESP8266 icon indicating copy to clipboard operation
Arduino-HomeKit-ESP8266 copied to clipboard

Pairing with QR Code does not work reliably

Open farbefreak opened this issue 4 years ago • 1 comments
trafficstars

Hello,

i am trying to get every feature working, including the QR Code assisted paring.

I did specify: homekit_server_config_t accessory_config = { .accessories = accessories, .password = "915-71-923", .setupId = "WMUT", //optional }; SetupID and password. These were used for generating the QR code with the script from maximkulkin. However pairing with this code does not seem to work reliably. This is a failed try: `>>> [ 47439] HomeKit: Starting server

[ 47449] HomeKit: Formatting HomeKit storage at 0xfb000 [ 47456] HomeKit: Generated new accessory ID: 8C:7A:38:71:E8:A2 [ 47527] HomeKit: Generated new accessory key [ 47534] HomeKit: Preiniting pairing context [ 47539] HomeKit: Using user-specified password: 915-71-923 [ 47563] HomeKit: Call s_mp_exptmod in integer.c, original winsize 6 [ 53627] HomeKit: Call s_mp_exptmod in integer.c, original winsize 5 [ 56741] HomeKit: Preinit pairing context success [ 56746] HomeKit: Configuring MDNS [ 56753] HomeKit: MDNS begin: Tube Light, IP: 192.168.0.22 [ 56765] HomeKit: Init server over *WM: [3] unloading Free heap: 38784, HomeKit clients: 0 Free heap: 39560, HomeKit clients: 0 Free heap: 39408, HomeKit clients: 0 Free heap: 39408, HomeKit clients: 0 [ 72992] HomeKit: Got new client: local 192.168.0.22:5556, remote 192.168.0.30:49930 [ 73006] HomeKit: [Client 1073677636] Pair Setup Step 1/3 [ 73347] HomeKit: [Client 1073677636] Pair Setup Step 2/3 [ 73361] HomeKit: Call s_mp_exptmod in integer.c, original winsize 6 [ 82153] HomeKit: Call s_mp_exptmod in integer.c, original winsize 5 !!! [ 86740] HomeKit: [Client 1073677636] The socket is null! (or is closed) Free heap: 38152, HomeKit clients: 1 [ 86754] HomeKit: [Client 1073677636] Disconnected! [ 86759] HomeKit: [Client 1073677636] Closing client connection [ 86765] HomeKit: Free saved_preinit_pairing_context [ 86771] HomeKit: [Client 0] Clear the pairing context [ 86777] HomeKit: Preiniting pairing context [ 86781] HomeKit: Using user-specified password: 915-71-923 [ 86805] HomeKit: Call s_mp_exptmod in integer.c, original winsize 6 [ 92968] HomeKit: Call s_mp_exptmod in integer.c, original winsize 5 [ 96156] HomeKit: Preinit pairing context success Free heap: 39024, HomeKit clients: 0 Free heap: 39432, HomeKit clients: 0 Free heap: 39432, HomeKit clients: 0`

A iPhone was used to connect. It did show "device can not be added“ error. Sometimes the pairing works like it should, sometimes if fails with this error. Sometimes it also fails with a "unknown error: 2025" displayed on the iPhone but i don't have a log from this. I did already follow your example of running only arduino_homekit_loop() while not paired.

Did i do something wrong or is the esp8266 to slow?

farbefreak avatar Mar 08 '21 23:03 farbefreak

Make sure that CPU frequency is set to 160Mhz

I already used QR code pairing successfully. Yet, when I had problem, I did that to solve it: "erase the full flash or call homekit_storage_reset() in setup() to remove the previous HomeKit pairing storage and enable the pairing with the new accessory of this new HomeKit example." Boot the ESP. After that, reflash the ESP without homekit_storage_reset() and then try to pair.

marcantoinegodde avatar May 01 '21 12:05 marcantoinegodde