[23:13:07][D][esp-idf:000][BTC_TASK]: E (694342) BT_APPL: Max Notification Reached, registration failed,see CONFIG_BT_GATTC_NOTIF_REG_MAX in menuconfig
This means I have too many watches for BLE.
By default, CONFIG_BT_GATTC_NOTIF_REG_MAX is 9. In my ESPHome configurations, there are just three ble_client sensors (all with notify: True), but the device also works as BLE proxy, which might use additional notifications. So, I’ve found a way to configure it for ESPHome:
Great, except… it does nothing. Apparently, it gets ignored. I suspected that something eats the notification slots and 32 isn’t enough (weird, but possible), but it doesn’t seem to be the case. It compiles even with this line (and even for a clean build):
CONFIG_BT_GATTC_NOTIF_REG_MAX: "šedesát čtyři"
Because this compiles, I assume that this value is getting ignored. Apparently, sdkconfig_options aren’t getting completely ignored, because when I put unquoted integer after the colon, it complains that it needs a string. But any (even non-numeric) string is accepted.
(No, I don’t expect it to be able to read the number written in Czech…)
Aha. I think I’ve seen this piece of code, but didn’t conclude that this overrides my config. I hoped it to be vice versa…
So, IIUC, the only way to proceed is probably to set this in a custom external component (not in custom component, as they are gone).
BTW, what all count in the limit? Apparently ble_client sensor does, I have three of them. Maybe also ble_client device (I have one). Maybe some devices and services used through BLE proxy (depends on their usage).
I’ll try. It’s not on top of my priority list (the errors have magically disappeared; I know, they might magically reappear) and I am not familiar with ESPHome development, but my idea is to:
Create an external component (I’ve never done that) that handles the configuration.
Make it configurable.
Maybe move it to ESPHome’s source code and create a PR.