-
Notifications
You must be signed in to change notification settings - Fork 275
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
HOMEKIT_MAX_CLIENTS - why 8? #31
Comments
This value needs to be considered. |
It looks like MEMP_NUM_TCP_PCB is set to 5 in lwip2, but in lwip, which seems to be what is being used, it's doing this to read it from a register (which I don't understand):
Also, if I simply increase HOMEKIT_MAX_CLIENTS in arduino_homekit_server.cpp to, say, 15, I'm able to get more clients connected (I've managed up to 12). So we seem to be able to get more connections than lwip is set to allow (which I don't understand). If lwip is zeroing out and re-using the older connections, then HomeKit clients handle that rather gracefully… client devices don't seem to care. It occurs to me that using espconn_tcp_get_max_con to retrieve the maximum value from the sdk, rather than setting it manually, might be an approach to consider. All it appears to do is just return MEMP_NUM_TCP_PCB after all. On the other hand, if it works just to set a higher number of max clients and let HomeKit recover from dropped connections on the client side, maybe that's just fine. Increasing connections does reduce available heap. In any case, there is a lot here I don't understand! |
I wrote this number 8 at random when I wrote this library. Anyway it depends on your real project and what you really need, and there is no best value to be written in a library. You can increase it or reduce it by modifying the source code. Also I do think ESP8266 is not so powerful to hold so many clients (not only HomeKit clients if you use http, webserver, websockets together). |
Indeed. Lower numbers seem to be more stable but do seem to lead to more "Updating…" and "Not responding" delays in the Home app. Higher numbers seem to improve the experience in the Home app but seem to lead to resets on the ESP. For now I guess the best value is for the implementer to determine. Thank you! |
Why is the default HOMEKIT_MAX_CLIENTS set to 8? It would be helpful to increase this, in homes with lots of Apple devices.
The text was updated successfully, but these errors were encountered: