Closed simkard69 closed 9 months ago
After a little bit of "trial & error", I found out that when I try to initialize the 7th accessory/service it fails. Looked in homeintegration.c file and found these lines :
#define MAX_HAP_SERVICES 7
#define MAX_HAP_ACCESSORIES 7
I've just made some change, replaced these 2 lines with these ones :
#define MAX_HAP_SERVICES 15
#define MAX_HAP_ACCESSORIES 15
So far so good while initializing a 7th accessory or service. Will do more tests later today. Anyway, can that be extended without impacting any library/system stability ?
Ok, so basically, on my side, I've tried :
Something I noticed after some new trial & error : when initializing 7 accessories (including the main/base) works fine. If I try to initialize 8 accessories, HomeKit on iOS device immediately considers the main accessory as a Hub/HomeBridge. Is that something hardcoded in the library ? Is this a known behavior of HomeKit now ?
@Yurik72 : Can you please help me on that one (even if I know that you're not that much active on this library unfortunately). Thanks
Solved modifying the following lines in "homeintegration.c" file
FROM define MAX_HAP_SERVICES 7 define MAX_HAP_ACCESSORIES 7
TO define MAX_HAP_SERVICES 15 define MAX_HAP_ACCESSORIES 15
NOTE : From what I've read, ESP32 can handle a maximum of 40 accessories ... but I have some doubts. Keeping in mind that starting as 8 accessories per same HomeKit device, it is considered as a Hub/HomeBridge and the first accessory (main/base) cannot be controlled and there are some connection drops which avoids updating values at first try. >>> I'm trying to find a solution in this other ISSUE : #141
I'm trying to create a module to drive Somfy RTS window shades.
Initializing 6 of them seems to work fine, keeping in mind that each window covering (understandging "shade") has 4 charecteristics (name, position_state, current_position and target_position). So that makes 24 characteristics in total. There are no change if I initialize them as accessory or services.
My initialization part (for debugging purposes of course) looks like this :
And it outputs something like that :
It doesn't seem like it is a free heap problem, so I'm wondering what could be the culprit here ?
Any chance someone has an idea of what is going on ?
Thanks