Skip to content
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

I can't pair it with homekit #408

Open
Kristian8606 opened this issue Nov 24, 2020 · 24 comments
Open

I can't pair it with homekit #408

Kristian8606 opened this issue Nov 24, 2020 · 24 comments

Comments

@Kristian8606
Copy link

I try to pair the device but always to no avail

HomeKit: Starting server
HomeKit: Using existing accessory ID: 78:2D:23:65:7A:7E
HomeKit: Configuring mDNS
HomeKit: Got new client connection: 55 from 192.168.0.110
HomeKit: [Client 55] Pair Setup Step 1/3
HomeKit: [Client 55] Pair Setup Step 2/3
HomeKit: [Client 55] Pair Setup Step 3/3
HomeKit: Added pairing with EE50190D-642E-4437-B1F7-657F0714E992
HomeKit: Configuring mDNS
HomeKit: [Client 55] Successfully paired
HomeKit: [Client 55] Closing client connection

after restart

`WiFI ready

HomeKit: Starting server
HomeKit: Using existing accessory ID: 78:2D:23:65:7A:7E
HomeKit: Found admin pairing with EE50190D-642E-4437-B1F7-657F0714E992, disabling pair setup
HomeKit: Configuring mDNS`

@Kristian8606
Copy link
Author

5ECFFB31-EF4D-43B5-AB55-6009F51F6018

@maximkulkin
Copy link
Owner

It says "after restart". What restart? You're not supposed to reboot accessory right after pairing.

@Kristian8606
Copy link
Author

after restart

`WiFI ready

HomeKit: Starting server
HomeKit: Using existing accessory ID: 78:2D:23:65:7A:7E
HomeKit: Found admin pairing with EE50190D-642E-4437-B1F7-657F0714E992, disabling pair setup
HomeKit: Configuring mDNS`

@Kristian8606
Copy link
Author

but no accessory is displayed in the home. When trying to pair again, the accessory was not found because it appears to be paired

@Kristian8606
Copy link
Author

Because of my poor English, my question may have confused you, sorry. When I try to pair I get a HomeKit: [Client 55] Closing client connection and the error in the photo above. Then I restart esp and try to pair again but it behaves as if it is paired

@maximkulkin
Copy link
Owner

Disconnection after pair setup is a normal procedure. Controller then reconnects, goes through pair verification and then downloads accessory definition and shows what kind of services accessory provides on the UI. From your log I can't tell what happens after pair setup.

@peros550
Copy link

if I got it right , Kristian says that accessory paired in logs, but never in home iOS app.

@Kristian8606
Copy link
Author

Kristian8606 commented Nov 24, 2020

this is all available information and according to it the device seems to be paired but in fact the device is not displayed in the home application due to the shown on photo error

@Kristian8606
Copy link
Author

I noticed that the size of led.bin is 681 kb I think this may be a problem?

@AramVartanyan
Copy link

This issue could be triggered by values out of boundaries or improper characteristics defined. I have never received this message. 🤔

@Kristian8606
Copy link
Author

just following the example i haven't changed anything

@Kristian8606
Copy link
Author

I forgot to specify that I use led example ESP8266_RTOS_SDK

@Kristian8606
Copy link
Author

What causes this error?
I get it often.
!!! HomeKit: [Client 4] Failed to compute SRP shared secret (code -2)

@maximkulkin
Copy link
Owner

This is out of memory error.

@peros550
Copy link

I get this error also, right after setting up the wifi. Solution seems to be to hard reset the board and try again. It looks the wifi config procedure eats some memory which isn’t freed?

@maximkulkin
Copy link
Owner

@peros550 I do not know what is exactly in your case, but wifi_config can cause memory fragmentation (because you run homekit server when wifi_config hasn't fully stopped yet), so it goes like ( <wifi_config> <homekit_server> ), then wifi_config stops and you get ( <homekit_server> ), so memory is fragmented and there might not be enough memory chunks.

@peros550
Copy link

peros550 commented Nov 28, 2020

Thanks Maxim. No worries it's not a big issue on my case since a reboot clears the problem.
Any idea how we could calculate what kind of memory each RTOS task consumes in design time?

@maximkulkin
Copy link
Owner

@peros550 Yes, you can. Basically, it's the stack size you allocate for your task + some fixed overhead ( + everything your task allocates while running ).

@tosie
Copy link

tosie commented Dec 4, 2020

@Kristian8606 In the past I have seen this problem when not using the newest git submodules. Try to update all submodules, rebuild everything, erase the flash and flash again (maybe some of these steps are not necessary, but it worked for me).

git pull --recurse-submodules
make -C examples/... clean
make -C examples/... all
make -C examples/... erase_flash
make -C examples/... flash

@choosegit
Copy link

I also have the this problem,In debugging,When I find something wrong, the log is:

>>> HomeKit: Configuring mDNS
>>> HomeKit: [Client 55] Successfully paired
>>> homekit_client_process: [Client 55] Finished processing
>>> HomeKit: [Client 55] Closing client connection

When there is no problem, the log is:

>>> HomeKit: [Client 4] Successfully paired
>>> HomeKit: [Client 4] Closing client connection
>>> HomeKit: Got new client connection: 4
>>> HomeKit: [Client 4] Pair Verify Step 1/2
>>> HomeKit: [Client 4] Pair Verify Step 2/2
>>> HomeKit: [Client 4] Found pairing with E4D1A879-C96A-4297-A752
>>> HomeKit: [Client 4] Verification successful, secure session established
>>> HomeKit: [Client 4] Get Accessories
>>> HomeKit: [Client 4] Update Characteristics
>>> HomeKit: [Client 4] Update Characteristics
>>> HomeKit: [Client 4] Update Characteristics
>>> HomeKit: [Client 4] Get Characteristics

It seems to have some problem with validation

@maximkulkin
Copy link
Owner

@choosegit could you please recompile firmware with HomeKit debug logs enabled and reupload logs

@choosegit
Copy link

static inline int hwrand_generate_block(uint8_t *buf, size_t len)
This function causes the problem

@jmgutierrezc1
Copy link

I do have a similar problem, everything work very well and I can pair with Homekit, the problem come if I lose power>

0:30:05.969 -> >>> [ 74] HomeKit: Using existing accessory ID: 66:41:E3:25:57:20
00:30:05.969 -> >>> [ 80] HomeKit: Found admin pairing with 08F9D6E6-E39C-4A1C-A379-521136694FAA, disabling pair setup
00:30:05.969 -> >>> [ 89] HomeKit: Configuring MDNS
00:30:05.969 -> >>> [ 92] HomeKit: Init server over
00:30:05.969 -> Free heap: 40288, HomeKit clients: 0
00:30:10.992 -> Free heap: 40336, HomeKit clients: 0

I never get the accessory to work again. the accessories do not response again on Homekit I have to reset, connect to my wifi again delete the accessory from Homekit and re-pair

@mdemir4421
Copy link

worked for me.

void remove_all_pairings() {
homekit_storage_reset();
}

void setup() {
// Your setup code here, including WiFi connection and homekit setup
remove_all_pairings(); // Call this function to remove all pairings
// Continue with the rest of your setup...
}

void loop() {
// Your loop code here
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants