-
Notifications
You must be signed in to change notification settings - Fork 170
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
Separate Accessories - Causes Intermittent 'No Response' #203
Comments
Hi Yes, homekit_setup_mdns() uses name of the first accessory only. It is considered to be "the main" accessory and thus it's category and name is used. This is the case for accessory bridges: the bridge accessory goes first, then all other accessories. Thus, overall the advertised name of the accessory and it's category is derived from accessories[0]. esp-homekit does not support running multiple servers on the same device. All IDs are automatically assigned if you did not assign them manually. It traverses the accessory-service-characteristic graph in order the are defined and assigns IDs sequentially unless it encounters non-zero ID in which case it will keep it and continue to assign IDs from the next ID. This is done to support controlling IDs in case some accessory/service/characteristic was removed in new firmware, but you want to keep all other accessory/service/characteristic IDs unchanged (and this is the advised way of doing it in HomeKit spec). Regarding your code, I have found one problem. When you allocate characteristics array with size depending on whether it is dimmer or not, you're off by one: you need an extra element for the NULL pointer at the end. I also would recommend just having array of size 4, it does not hurt and it is less error prone. |
Nice catch! I doubt this is what is causing my issue though...? Or maybe it is..? Can you think of anything that would be causing my accessories that are separated to intermittently go 'No Response'? |
When you say "both accessories will go No Response", "both" means configured accessories within one physical device, right? Did you check console logs? Does it crash? |
Correct. Single/physical ESP controller, but with the I changed it to I do not think they are crashing; the status LED flashes for 10 seconds after a reboot, and I haven't noticed this. I will double-check and revert back. |
Should I be creating a separate Accessory with category I want to add some Custom Characteristics to log number of restarts. But; I do not want to add it to all lights, or even just one light. Can you add Custom Characteristics to the 'Bridge' accessory? So something like this;
Normally I add the custom characteristic to the main service (I added some to a Looking at your code, I don't see anything specific to Bridge Accesories. Homebridge and Espressif's HomeKit SDK both set some kind of |
I have added the Custom Characteristic that tracks number of restarts, and last restart reason. After seeing the device go 'No Response' for a few minutes and come back, I checked the Characteristic in Eve, and found that it had not restarted. So something else is happening. Any other thoughts? |
Hi,
When I use the below code to create a device with separate accessories, both will intermittently go 'No Response'. Perhaps something to do with using the same
ACCESSORY_INFORMATION
Service (andNAME
)?Does each Accessory need a different name set in the
ACCESSORY_INFORMATION
Service? It appearshomekit_setup_mdns
only uses the name fromaccessories[0]
?Do I need to specifically set
.id
for each Accessory, or is this handled by thehomekit_accessories_init
function?The text was updated successfully, but these errors were encountered: