maximkulkin / esp-homekit

Apple HomeKit accessory server library for ESP-OPEN-RTOS
MIT License
1.12k stars 170 forks source link

esp32 slow pairing #96

Closed mentaluproar closed 5 years ago

mentaluproar commented 5 years ago

With the esp32 led example, I kept getting crashes. After increasing the heap size for led_identify_task() to 1024, the crashes stopped but pairing now takes much longer. Wolfssl4 makes use of the encryption acceleration features of the ESP32, which might help. Is there a reason esp-homekit uses version 3.13?

maximkulkin commented 5 years ago

There is no reason other than nobody have updated it to a new version. In my experience ESP32 pairing takes ~2s to pair and almost instant to do pair verify (establish a connection) which IMO is good enough.

LED identify task on ESP32 does need a bigger stack size now. I believe it is related to recent updates in ESP_IDF SDK as it worked before.

Give it another try. If you still experience slow pairing, please provide debug logs of pairing process and point to where it spends a lot of time.

mentaluproar commented 5 years ago

I actually found a way around that. You need to explicitly set the processor speed. That fixes pairing.