Open mycael opened 4 months ago
yes,please try new one. new one support sleep retention..
https://github.com/espressif/esp-idf/commit/27b2f7a10b662fdbe4991e12ba9c04870083a453
Currently this commit only exist on the master branch and release/v5.3 branch.
Thank you for your help ! I will try to move towards the new i2c drivers. Until now, I haven't found some example. This will help for sure. For now I managed to get I2C and light sleep mode to work by disabling the CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP option. But it's probably less effective, therefore.
@mycael Do you have any update on this issue? Could you close the issue if no further action required?
Answers checklist.
General issue report
Hello ! I am a beginner in the world of ESP and zigbee and I am building a CO2 measurement system using the zigbee network for home automation. I use an ESP32-C6 and an SCD40 component which works in I2C. So far, everything is working perfectly. The component joins the zigbee network well and regularly reports the values measured by the sensor and read by I2C. Since I would like the system to run on battery power, I want to use "light sleep" mode. I was inspired by the example provided in ESP-IDF: "Sleepy End Device Example".
In the _appmain function, I added the call to the function:
esp_zb_power_save_init();
With this function identical to the example:
In the function _static void esp_zbtask(void *pvParameters):
In the function _void esp_zb_app_signal_handler(esp_zb_app_signal_t *signalstruct):
My I2C initialization function :
The ESP switches to "light sleep" mode since I have the information on the console: "Zigbee can sleep" and I see that consumption is dropping. But the I2C communication no longer works and the reading functions return a timeout error code.
I use the old I2C driver (i2c.h) and not the new one (i2c_master.h). Is the new one likely to work better?
I must be missing something, but I don't see what... Any suggestions?
Thank you for your help !