Closed renssies closed 6 years ago
Update: Our doorbell just rang, so everyone rushed to their phone to open the door (the door lock is in HomeKit). This caused another high number of sessions started. But this time it did not crash. It looks like the crash only occurs after the device has just been set up.
The crash is probably due to out of memory: memory became too fragmented that it couldn’t allocate next buffer. Large number of clients is not what esp8266 can handle. One workaround we could try to implement is to substitute malloc with one that will put task to sleep for short duration if allocation fails to wait until LWIP finishes sending it’s send queue and frees memory. On Tue, Jan 16, 2018 at 03:13 Rens Verhoeven notifications@github.com wrote:
Update: Our doorbell just rang, so everyone rushed to their phone to open the door (the door lock is in HomeKit). This caused another high number of pairings. But this time it did not crash. It looks like the crash only occurs after the device has just been set up.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/maximkulkin/esp-homekit/issues/17#issuecomment-357928910, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAqIULu4PHPQGVl90V-de9KJETVVS67ks5tLIROgaJpZM4RfmTq .
I propose to clarify the vocabulary here
I think you mean to say session-setup instead of pairing. if you agree, would you edit the above? It is rather confusing. (I know to read between the lines, but others might not)
On a constructive level, the actual pairing is a painful process. How about rebooting the device after it got paired? (I mean the 100% paired, not the half-paired). Recovering is lightning fast anyway so no real harm is done, but memory and behaviour will be fresh born clean. If it crashes after that, we have fundamental issues to solve.
@HomeACcessoryKid why reboot? Since we have fixed memory issues, after pairing is complete there is no memory overhead. All other operations do not require large continuous chunks of memory, so fragmentation is not a problem.
OK, if you are confident it is rock solid... I withdraw my proposal
I was testing the contact sensor I made at Awkward. Here we have 21+ devices that have HomeKit setup. 8 Devices share the same iCloud account and the other 13 are HomeKit guests.
Setting up the device works fine, but after the setup all the other devices want to start a session too. This causes esp-homekit to eventually crash.
After the crash the device restarts and the sessions are eventually restored, so it's not a high priority, but it is something that happens.
Crash log:
Edit Jan 16 2018: Updated wording of pairing vs sessions