-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
Zigbee: problem with battery powered devices after power off/on #10612
Comments
Hi @michapr, Thanks for the report. I will take a look and try to reproduce. |
Today have seen that my "solution" is not working stable - after some time reporting stop with error: log looks like:
And - in the morning the device after power on (with changed code) was still rebooting again for some time - then was starting reporting. Thanks for checking! |
I was able to reproduce it with C6, however with ESP32-H2 there is no issue. Will continue in the investigation. btw. the message |
As the example with/without selecting power source works on H2, I assume there must be some error in the esp-zigbee-sdk for C6. It may take more time to fix. I will keep this issue updated when I get any news. |
Have changed the lines in lib files - but no changes in original Temperature sample code (after power off / on - no reporting more)
|
I assume you removed the device from your system and do a factory reset. |
I removed, erased flash while programming, restarted Zigbee2MQTT (in database it is deleted, nothing more in memory) - so it should be new device... |
Time to time that happens to me also, but lets say 1 out of 10 times. |
Can you try to flash other ESP32C6/H2 with Thermostat example and try to connect to that one? To check if its related to the Zigbee2MQTT? |
I have installed the Zigbee2MQTT add-on in my HomeAssistant. |
Yes,... I have tried several times, the device is not reporting values more after power off/on... I do not have a second ESP32C6 in this time, wanted to test at first how Zigbee is working with ESP32 ;) As far as I understood the thermostat sample is not an end device, but is waiting for any other temperature sensor device right? In my Zigbee2MQTT installation are 14 other devices connected, sensors, plugs and thermostats (valves) - they do not have such problems, so I hope, that Z2M installation is not the problem. As I wrote, the color_dimmable_light is working fine, even after power off/on. Any other idea? |
Does the board reboots after the stack fails to initialize? That's the behavior I added to reset the board after I am really not sure what is happening on your side, this is not happening to me. I will try to investigate more but its hard when I am not able to replicate it. |
IF you can try to sniff the packets going between the coordinator and the ESP that can help. |
No, board does not reboot in my case (with temperature sketch). It only does not report more values - looks like does not join again. What I just have tried - I added again a dely between some lines:
Now it "can happen" that device is reporting value after power off/on. If not reporting - I do not see any packets in Z2M debug log from the device. |
looks like with this settings (delay) device is reporting after power off/on every time:
Not sure at what place it is right/needed - maybe you have an idea ;) |
Can you just add a bigger delay after the |
this did not help at all - up to 5000ms (removed other delays) Maybe that reporting starts before the stack was initialized? |
ok,.... have two different debug logs - one for working, second for not working device. Difference is after the "After Setup End" section - maybe you know why there can be different result?? NOT WORKING:
WORKING:
|
Hi @michapr, yeah there is nothing more to see then the failure of the Zigbee stack: I am sometimes getting this error too, so that's why I added a reboot if this initialization fails. I will try to discuss it with a colleague working the Zigbee stack. |
Just have tried without delay - no success at all, all fails
Can you post a working debug log, just out of interest, I would like to compare it ?
Why does it not reboot here? I have added the 3 lines from your PR EDIT: Sorry, my fault - have commented it out, because didn't want the reboot while debugging ... |
ok,.. last result.... After about 5 minutes rebooting the device was responding with other state (interesting why.... I think it could be a timing problem):
all cycles before:
After that device is reporting again. So something is wrong there "anywhere" ;) |
Last for today.... an interesting fact: If I set in the IDE the CPU Frequency to 80MHz - looks like all is working, without reboots after power off/on .... |
That is an interesting fact. Nice investigation. I will report all the info and also check if there is anything suspicious why that "fixed" the issue. Thank you again, great work. |
Have you tried to wait for |
You can add to the code to wait for Zigbee stack to be ready. But I think we have tired that and it did not help at all. But can you give it a try?
|
This will help a bit - device is rebooting sometimes (in my case up to 16 times) and then is responding. (additional delay did not change anything)
How this could be done? |
More or less the wait for started does it. |
Once have seen one reboot only. On second try power off/on I have switched of after 45 reboots....
|
cannot get the options in this time - looks like IDE is caching old options anywhere. |
@michapr Are you using the old IDE or DE 2.0? in the new 2.0 ice there is some problem with caches. For old Ideas it should work. Or you can delete the cached files for sure :) (delete |
Just for record.... Clear the cache for fixing the board.txt issue:
Here final is the log - at the end after some reboots the device is reporting.
|
Thank you for the log :) I am getting exact same error in the log. I have reported that and waiting for a reply what can we do with that. Once I get any news I will update here. Btw, if you set the frequency to 80MHz the issue is gone right? |
I must say, that I have seen now reboots even at 80MHz :( But I have also seen a reboot while first joining - have not noticed about this before:
|
Additional....
some lines before: |
I have "fixed" it for me for further testing |
Board
ESP32C6
Device Description
DevKit
Hardware Configuration
No external connections, only modul.
Version
latest development Release Candidate (RC-X)
IDE Name
Arduino IDE
Operating System
Windows 11
Flash frequency
80MHz
PSRAM enabled
no
Upload speed
921600
Description
Using Zigbee2MQTT battery powered device will be recognized and values will be reported as expected.
After power on/off device (remove power) the device will not more join and send values to the network and reboots regularly.
Have seen that this is happen only for battery powered devices.
If adding some delay after
Zigbee.addEndpoint(&zbTempSensor);
and afterZigbee.begin();
device will not reboot, but will also not join again / report values (some other debug messages).Sketch
Debug Message
Other Steps to Reproduce
Removing from
esp_zb_task(void *pvParameters)
in ZigbeeCore.cpp the workaround device will join and report values after power off/on (without described delay device will reboot before stable work 2-3 times...) :I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: