-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Glitch during ESP32-C6 Startup #11230
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
Comments
Hi @def1149, How often this glitch happens? If its reproducible, can you try to set Core Debug Level to "Error" only or disable, to see if its related to the printing to UART/USB or if its something related to Zigbee. |
@P-R-O-C-H-Y I have noticed other unexplainable "flat" spots in the HA temperature plots of other sensors I've created to monitor freezers where temperatures naturally cycle higher and lower, using both C6 and H2 processors. When I couldn't find a cause in my code, I modified the example code to create a situation to more easily identify any missing data points, and logged while running the code. I've seen the glitch in the log previously and repeated the testing before opening the issue. It's not clear that this is a Zigbee problem because the glitch occurs during startup before any application code executes. I don't know what executes during board startup. I will repeat this test on a different board with error level logging |
Do you get the issue if you remove all the button logic? Please post code that matches the output. |
I haven't tried removing button logic, but I'm not activating that while testing so I doubt that it's an issue. "It's not clear that this is a Zigbee problem because the glitch occurs during startup before any application code executes. I don't know what executes during board startup." The posted code was used to create the log I'm not using delays for serial output, but to ensure the Zigbee stack has time to complete the transactions as there doesn't seem to be a function that returns something like transaction complete that I can wait on. I know that without a delay after reporting that data will sometimes not be transmitted even though zbTempSensor.report() returns true I'm using humidity and batteryPercentage to send some status values to help with debugging when I run with all logging and serial output disabled. I'm often running multiple test devices distributed at various distances from the controller to asses performance at low signal levels and can't hook up a PC to log output all of them. There doesn't seem to be an easy way to add additional "debug data clusters" to an endpoint to capture and transfer additional debug data to Home Assistant during testing. I'll be adding support for this device to my testing to capture and log data to a microSD card https://www.sparkfun.com/sparkfun-qwiic-openlog.html Some of these tests have to run for hours or days to expose intermittent issues |
Additional failure recorded as directed with Error level logging enabled, see ### annotations During a three hour run there were two occurences |
I cannot see the reason of failure which is described in the issue header. But in this last log you send, it seems that the Zigbee does not want to start. Are you using Zigbee debug libs for EndDevice or normal once? If not, can you please use the ones with Debug, so maybe we can have more logs. But overall, 2 failures during 3 hours of reporting every 30s, its approx 0,5% mistake. Which to be honest is not bad. |
There may be multiple causes for a failure to report. My strategy will shift from trying to identify and correct the cause to detecting and recovering as best I can. It's likely that any H/W, library, or my code issues will be sorted out over time. Thanks |
@P-R-O-C-H-Y After running more tests and spending time digging through the ZHA debug log I have three instances where no errors were produced in the EP application but three datapoints in a row were missed in Home Assistant. The missing values are not in the ZHA log. The test app ( based on the sleepy temperature sensor example) is sending temperature values about every 16 seconds. I've attached an annotated ZHA debug log using >>>> to mark the start of key entries At about 15:23:05 in the log is an entry that starts a series of records for temperature value 59.5 I expect that wireless protocols will experience data loss, it but as far as I understand it Zigbee uses a protocol that uses ACKS to confirm receipt of data, so I would expect an error to be signaled on the EP if it doesn't get an ACK from the coordinator. |
After a lot of tweaking of EP code for my ESP32-C6 Zigbee temperature sensor to detect and capture problems at key points (to minimize any logging impact), and sending log data via serial to separate ESP32 with an SD card. I've found three categories of data missing in HA.
The occasional glitching when the C6 wakes up from deep sleep appears to be due to something that happens in the startup code when Verbose logging is enabled. I didn't see it when log level was reduced to Error. At this point, I can create reliable enough Zigbee/ZHA sensors using the ESP32- C6/H2 so I'm replacing my power hungry Wi-Fi sensors and MQTT. |
Board
Adafruit ESP32-C6 Feather
Device Description
Nothing attached
Hardware Configuration
Nothing attached
Version
v3.2.0
IDE Name
Arduino 2.3.5
Operating System
Windows 11
Flash frequency
40 MHz
PSRAM enabled
no
Upload speed
921600
Description
Occasionally, expected Zigbee data transmission is missing in Home Assistant
To debug:
Using the Espressif Sleepy Temperature sensor example with modifications to log events of note and running in ESP32 debug mode
I created a test temperature generator that monotonically increases the temperature by 0.5C every wake-up cycle and I plot the values in Home Assistant. I expect to see a consistent stair-step pattern on the graph. Occasionally the pattern demonstrates missing values
The ESP32-C6 seems to experience an error on startup during initialization after awakening from sleep.
This is the annotated (####) corresponding log output.
Sketch
Debug Message
Other Steps to Reproduce
Program an ESP32-C6 with the script and enroll it as a Zigbee ZHA device on Home Assistant 2025.4.1
Use a history card to graph the temperature values reported by the device
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: