Inkplate-Arduino-library
Inkplate-Arduino-library copied to clipboard
No RTC Wake Up
No RTC wake up after deep sleep.
examples/Inkplate6COLOR/Advanced/DeepSleep/Inkplate6COLOR_RTC_Alarm_With_Deep_Sleep/Inkplate6COLOR_RTC_Alarm_With_Deep_Sleep.ino
I am trying to use this example but with no success. Board goes to deepsleep but never wakes up. Used battery for RTC, RTC works in other context. Are there any known issues?
Any help would be great. Thank you!
Hi @okklar
Thanks for reporting it, dropping by to let you know we're investigating this and will let you know ASAP what the cause might be.
@okklar , So I just ran the example, and I'm getting an interrupt and the screen refreshes, in the example, there don't seem to be any other sources of wakeup so I imagine it's GPIO_NUM_39 (RTC interrupt) causing the wakeup.
I ran the Inkplate6COLOR_RTC_Alarm_With_Deep_Sleep example on the latest version of the Inkplate library main branch. The board definition for Inkplate 6COLOR shouldn't have changed in time, so the one you have is fine.
Could you please check if you have the latest version of the library? Could you check if your Inkplate 6COLOR uses the PCAL or by any chance MCP GPIO expander? You can see this on the back of the device - the gpio expander pins are next to the device's logo printed on the PCB and they should be labeled with the name of the expander.
Hi @rsoric thank you so much for you help and investigating that issue for me. Unfortunately I had the same result as before, after I tried your suggestions. The Inkplate Library is on version 8.0.0, I didn't find a later one. Also I copied the code from github, just to double check I didn't change the local copy of the example code by accident. No success so far.
I am not sure if I found the right GPIO Expander but if I am not mistaken it says NXP L16A 0303 ZSD201A. I will attach an picture of it. I also see the GPIO 39 pinout on the side with the GPIO pins that are labeled with Esp32.
Once again, thanks for your help!
I see, that would be the PCAL GPIO expander, I just wanted to rule out the possibility that this was causing the error.
Having a look at the schematic, could you somehow check the connection on Jumper 5 - if it's fully connected to GPIO39?
Here's how it looks in the schematic:
As you can see, it's what connects the RTC's interrupt to the ESP32. This could be a potential cause of the error.
Here's where it is on the board:
The middle pad should be connected to the left pad.
Hi @rsoric . Thank you very much for your help!
No, it is not connected, sorry, my bad – I wasn't aware of that. So I can simply connect those two pads by soldering them? Just to double check, it these two pads, right?
@okklar Yes, those are the ones that should be connected - they ought to be connected by default on the PCB but it doesn't hurt to reinforce this connection so we can rule it out as a possible fault.
Hi @rsoric , I connected the pad this evening and I also can confirm now that they were already connected as you said. But nothing changed unfortunately. The code is the same, but the board still doesn't wake up after the 60 seconds. Do you have any further things that I could check.
Sorry for that stress.
Thank you
@okklar please don't worry, we're always happy to help Inkplate users get things working :)
I'm gonna try a couple more things later today to figure out what could be causing this issue.
@okklar Sorry for the delayed reply, could you please open a support ticket with the same info you've provided here via our contact form: so we can help solve your issue
@okklar, could you please give this branch a try on your device: https://github.com/SolderedElectronics/Inkplate-Arduino-library/tree/ip6ColorSleepFix
This has an updated driver for Inkplate 6COLOR which could fix this issue, we're currently testing it. If you're going to test it with your code, note that you have to call
display.sleepColorPanel();
just before
esp_deep_sleep_start();
Hi @rsoric, I'm was having the same trouble with the the Inkplate6COLOR_RTC_Alarm_With_Deep_Sleep
example on the Inkplate6COLOR. I did these two things and now it is working
- [x] HW: Checked the connection between the
GPIO39
(pin 5 in ESP32-WROVER-E) and theINT
(pin 4 PCF85063A) - [x] SW: Used the library from this the ip6ColorSleepFix branch (17-dec-2023)
PS. My board is different from the ones in the pictures above. I got it in the CrowdSupply campaign.
EDIT: It is working properly.
@rsoric, After some tests, I figured out (may it is obvious) that it necessary to upload another program (let's call it reset_rtc
) to reset the RTC before uploading the Inkplate6COLOR_RTC_Alarm_With_Deep_Sleep
example code to make it work properly (setting the RTC). This is to say:
- Upload the
reset_rtc
code - Upload the
Inkplate6COLOR_RTC_Alarm_With_Deep_Sleep
example - It works as expected (update every 60 seconds) ✅
This is the code I'm using for reset_rtc
:
#ifndef ARDUINO_INKPLATECOLOR
#error "Wrong board selection for this example, please select Soldered Inkplate 6COLOR in the boards menu."
#endif
#include "Inkplate.h" // Include Inkplate library to the sketch
#include "driver/rtc_io.h" // Include ESP32 library for RTC pin I/O (needed for rtc_gpio_isolate() function)
#include <rom/rtc.h> // Include ESP32 library for RTC (needed for rtc_get_reset_reason() function)
Inkplate display; // Create an object on Inkplate library
void setup() {
// put your setup code here, to run once:
display.begin(); // Init Inkplate library (you should call this function ONLY ONCE)
display.rtcReset();
display.setCursor(50, 250);
display.setTextSize(3);
display.setTextColor(INKPLATE_BLACK, INKPLATE_WHITE); // Set text color and background
display.print("RTC has been reset");
display.display();
}
void loop() {
// put your main code here, to run repeatedly:
}
However, there is a problem that I cannot figure out, the interruption does not work if I change the date in the RTC. For example following these steps:
- Upload the
reset_rtc
code - Modify the year in the line
display.rtcSetDate(1, 5, 12, 2022);
to be2023
. - Upload the modified
Inkplate6COLOR_RTC_Alarm_With_Deep_Sleep
- It does not update anymore ❌
Am I missing something?
Reply to my own question:
Yes, I was missing this: Beside changing the year, it is necessary to also change the day, as it was different. 5-dec-2023 was Tuesday (week of the day = 2
). Thus, the proper date setting is display.rtcSetDate(2, 5, 12, 2022);
Hi @rcassani ,
sorry about the delayed reply, a lot of us were on holiday for a while. Thanks for letting us know about this, we're going to make sure it's clear in a later update
-Rob
Hi @rsoric, from my side everything is working fine. Tested with the latest release 10.0.0 If the RTC wake is working as well for @okklar, this issue could be closed
Hi @rsoric sorry for that very very late reply – this is literally the first day, I could test the code with the new board.
So I tested the board with the code that you flashed onto it, before sending to me – it worked fine. It woke up after 60 seconds. Then I uploaded another inkplate example code for display test. After that I came back to the RTC Wake Up Code again and ran into the same issue I had last year. It didn't wake up anymore. But I know it worked, when I powered up the board with your code. So I found a thing.
If I set the time with "rtcSetTime()" and "rtcSetDate()" it sets up and displays the time and date correctly, but it doesn't enable the wake up alarm. If i use the "rtcSetEpoch()" to set up the time and date, the alarm is enabled correctly and it works fine again.
At the moment I have no clue, what could be the reason for that, but that is what I investigated so far. But maybe for someone who is smater than me, that already makes perfect sense. –T
@BornaBiro, could you have a look at this, "rtcSetTime()" and "rtcSetDate()" apparently don'tt set up the alarm correctly but "rtcSetEpoch()" does.
@okklar I don't see how one would enable or disable the RTC alarm. By looking at the rtcSetTime(), rtcSetDate and rtcSetEpoch it just sends data directly to the RTC IC. Only difference is that rtcSetEpoch() sends all time and data at one, while rtcSetTime() and rtcSetDate() splits them.
There is note in the datasheet page 22. stating that it good to read/write all time and date in one go due possible corruption. But they also said that all R/W must be done within one seconds which does happen, so this should not be a issue, especially since you can read the RTC T&D correctly. We can make a method for writing time and date at once and see the behavior.
Is this our example or your own code? Did you try to reset RTC between testing with rtcSetEpoch() and rtcSetTime()/rtcSetDate()?