Page 1 of 1

ESP32 deep sleep wakestub i2c EEPROM access and wake with timer

Posted: Mon Aug 17, 2020 10:30 am
by dovov97815
Hello,
My goal is to wake up ESP32 from deep sleep on time basis and also wants to count gpio wake interrupt count, if count is maximum than setted value or timer interrupt occurs rhen ESP32 needs to go to main run mode, otherwise it should remain in deep sleep. I want to know that how to configure wakestub functions to read/write I2C EEPROM and also manage wake time, like every 24 hours.

Thank You
Devov

Re: ESP32 deep sleep wakestub i2c EEPROM access and wake with timer

Posted: Mon Aug 17, 2020 2:45 pm
by lbernstone
Rewriting the wake stubs requires recompilation of the arduino libraries, and a strong knowledge of the hardware.
Even if you do that, it is not possible to access I2C within the stub.
Any processing you wish to do during sleep can only be done with the ULP (the main processor is asleep)
Waking from deep sleep via rtc timer has a good example.
https://github.com/espressif/arduino-es ... /DeepSleep
https://github.com/lbernstone/NTP_sleep

Re: ESP32 deep sleep wakestub i2c EEPROM access and wake with timer

Posted: Tue Aug 18, 2020 4:39 am
by dovov97815
Thanks for response
I used a wakestub https://gist.github.com/igrr/54f7fbe051 ... d7fbecfeab in arduino and it works. but I didn't know how to configure this to work as both Pulse counting and time based wakeup.
If I can't access I2C then, its ok, but can I acheive pulse count and time based wakeup.

Thank You