Closed maccoylton closed 6 years ago
Yeah, I've seen that problem. Looks like cJSON library we use to build JSON responses is not very memory efficient (accessories JSON for Thermostat on my tests takes ~16K, then you need space for buffer to render it into string). ESP with my HomeKit library has ~27K. Also, each new client is handled in a new task, which also takes ~4K. So, going forward I'm going to investigate other options for rendering JSON (maybe writing my own, more memory efficient library). Also, I will push a patch that I had for a while which modifies server to handle all clients in a single task which should improve memory requirements for each client. Each client still requires a separate 1K buffer for decoding data though.
BTW, if you'd like to join our (private) Slack channel, send me an email and I will send you invite
Should be fixed now: I rewrote JSON generation with a much more memory efficient one.
HI, I have my accessories shared with a some of the family, seems when any of those additional clients connects, my accessory crashes:-
target temperature set to : 17.000000 Target set to on
target temperature set to : 16.500000 Target set to on
target temperature set to : 16.000000 Target set to on
target heating cooling state set to : 3 Target set to auto Target Auto, current now off, current temp 19.500000, target temp 16.000000
Stack: SP=0x3fffc3e0
Free Heap: 4796 _heap_start 0x3fff1ba8 brk 0x3ffff388 supervisor sp 0x3ffffb00 sp-brk 1912 bytes arena (total_size) 55264 fordblks (free_size) 2884 uordblocks (used_size) 52380