ebaauw / homebridge-nb

Homebridge plugin for Nuki Bridge
Apache License 2.0
50 stars 3 forks source link

Error "Too many callbacks" #51

Closed spadrille2 closed 2 years ago

spadrille2 commented 2 years ago

I have one of my 5 Nuki bridges who doesn't work anymore. I have looked at the logs and every minutes i have 3 errors messages :

[28/01/2022, 11:50:47] [Nuki] Nuki_Bridge_5E62B028: subscribe to event notifications [28/01/2022, 11:50:47] [Nuki] Nuki_Bridge_3579BA5B: subscribe to event notifications [28/01/2022, 11:50:47] [Nuki] Nuki_Bridge_361F9939: subscribe to event notifications [28/01/2022, 11:50:47] [Nuki] Nuki_Bridge_361F9939: error: too many callbacks registered [28/01/2022, 11:50:47] [Nuki] Nuki_Bridge_3579BA5B: error: too many callbacks registered [28/01/2022, 11:50:47] [Nuki] Nuki_Bridge_5E62B028: error: too many callbacks registered

What can i do?

ebaauw commented 2 years ago

The Nuki bridge only supports notifications to three concurrent clients. Use fewer clients, make sure they behave nicely, and remove the callback on shutdown. Make sure Homebridge shuts down cleanly. Use nb to check registered callbacks and to remove stale callbacks.

Note that when the first registered callback fails, the bridge won't notify the other clients. Using more than one client concurrently generally is a bad idea, in my experience.