-
Notifications
You must be signed in to change notification settings - Fork 41
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
alarm handles leak, unable to schedule user alarms (TZ-1399) #507
Comments
Hi, The default number of |
I'm having a similar problem, and my temporary solution was to restart the chip once it stops me from registering more alarms, I launch the first alarm when initializing the system and then I periodically feed a Watchdog, the moment it stops feeding the chip must be restarted, (the espresif watchdog does not work in end-device with low power, so I built one myself). #define TIME_WDT_ZIGBEE_MS (120000) // 120s //Call this function only once during stack initialization |
@xieqinan, I think I got it. here's a snippet that allowed me to repro the issue:
Explanations: In my original app I indeed have a timeout timer for commands if I don't get status report or response in some defined time and that timer gets cancelled as soon as I get the response. The question is: am I using the cancel routine wrong? Or does it simply malfunction? @agustinebrecht , lol, I'm doing something somewhat similar, although in my case I'm tracking the allocated handles and if a newly allocated handle has a value bigger than some defined threshold (in my case: 0x33) - I'm setting the flag that a restart is needed and performing a restart as soon as no occupancy is registered (I'm dealing with a presence sensor in my case, so...) to be less disruptive for the users)) |
This is indeed a buffer leak issue in
|
@xieqinan , hey, thanks for investigating and for the tip |
@xieqinan , if I use |
@xieqinan I'm getting linker errors when trying to use |
Please refer to #507 (comment), you should add the |
Yes, it will. So you need to remove this workaround once the issue is fixed. |
I did |
Why? It works fine on my end. Are you using a C++ compiler? If so, you may need to add
|
that's it, thx |
Hi @theorlangur ,
I think this issue has been fixed in esp-zigbee-sdk v1.6.2, please test again with the new libs. If it works, please consider closing this ticket. |
@xieqinan |
Answers checklist.
IDF version.
v5.3-369-g466a392a76
esp-zigbee-lib version.
1.6.1
esp-zboss-lib version.
1.6.1
Espressif SoC revision.
ESP32H2
What is the expected behavior?
I'm implementing a presence sensor that should support direct binding. When presence is detected an 'on' command is sent to bound devices.
I expect sending commands with
esp_zb_zcl_on_off_cmd_req
/esp_zb_zcl_on_off_on_with_timed_off_cmd_req
just work.And it does work, the commands are sent, the light is turned on (or off).
What is the actual behavior?
However it seems that issuing such a command occupies slots for for alarms and doesn't free them. What I observe is that when I create alarms via
esp_zb_scheduler_user_alarm
at some point I cannot, I get aESP_ZB_USER_CB_HANDLE_INVALID
value as a handle back. I have verified that doing all the things my app is doing but without actually issueing on/off command requests - no alarm handles seem to be leaking (I was waiting for a long time and handles returned by esp_zb_scheduler_user_alarm did not have a tendency for rising). With those command requests issued - at some point I get 0 back (ESP_ZB_USER_CB_HANDLE_INVALID
).esp32h2 is configured as an ED, not a router. 2 devices are bound to it: coordinator and IKEA lamp.
Steps to reproduce.
More Information.
When device ends up in this state when alarm slot handles are exhausted, when trying to send the on/off command next time - it doesn't send anything, however I observe several attribute report commands/responses.
The text was updated successfully, but these errors were encountered: