Inkplate 5 Gen2 RTC setEpoch offset and GPIO 36 wake button issues

Customer:

I have an Inkplate 5 Gen2 and two main questions:

  1. When I set the time in the RTC using display.rtcSetEpoch(), I get nonsense data displayed. I tried the example Inkplate5V2_RTC_simple but setting the time with display.rtcSetEpoch still gives nonsense date and time. However, if I add an offset equal to UL (using display.rtcSetEpoch(display.rtcGetEpoch() + UL)), I get the correct data displayed. The same happens when setting an RTC alarm: to set an alarm that triggers after 30s I need to use display.rtcSetAlarmEpoch(display.rtcGetEpoch() – UL + 30, RTC_ALARM_MATCH_DHHMMSS). I haven’t found any information about this offset online and discovered it through testing. Is this intended behavior or is there an issue with the RTC on my board or a bug in the RTC library?

  2. I wrote a script that reads data from an InfluxDB database, displays it, then sleeps for 1200s. The device should wake either after 1200s or when the wake button connected to GPIO 36 is pressed. The problem is that sometimes the ESP32 wakes up before 1200s without me pressing the button. Once awake, the code shows the button is randomly pressed while I’m not touching it. I had to modify the code so the button needs at least 2 seconds of pressing before executing any action. I suspect the 100kOhm pull-up resistor R41 connected to the wake button is too large and cannot keep GPIO 36 high when the button is not pressed. Have you noticed similar issues?

Originally submitted via email support on 15 April 2025. Migrated to the forum for community visibility.

Soldered Support:

We’re aware of some potential issues with the RTC in the Inkplate library related to setting the time by Epoch. Please try using setDate and setTime to set the RTC instead of setting by Epoch: Inkplate-Arduino-library/src/include/System.cpp at 2dd263f2f9548aadac8638413a143beddf068a64 · SolderedElectronics/Inkplate-Arduino-library · GitHub

This should produce consistent meaningful data without requiring an offset. There should indeed not be an offset. We’ve investigated this and thought it could be hidden differences between RTC chips which are supposed to be the same - it may be a batch-by-batch variation. We tried to replicate this before and setting by Epoch worked on the Inkplates we had in our office.

Soldered Support:

Regarding the button: try using a 10k resistor and you can also put 100nF in parallel with the switch as filtering. Usually we haven’t had this issue with the button and were unable to replicate it.

Customer:

Thank you for the fast reply. Using setDate and setTime I do get the correct date and time displayed. However, for setting an RTC timer (for example 30s), what would be the equivalent of this function without using display.rtcGetEpoch() (which is also affected by the issue)?

display.rtcSetAlarmEpoch(display.rtcGetEpoch() - OFFSET + 30, RTC_ALARM_MATCH_DHHMMSS);

Regarding the wake button: I agree with your suggestion and I also considered soldering a lower value resistor in parallel to R41, but wanted to check with you first. Can you confirm that R41 is the resistor I highlighted? The problem doesn’t occur very often - around once every two days - but I can clearly see it happens as I monitor with the RTC every time the ESP32 wakes up.

Attachment omitted in migration: image.png

Soldered Support:

We’re going to look into the RTC issue as soon as we’re able to. For now, you can use ESP32’s sleep function to set deep sleep wake up time instead: Inkplate-Arduino-library/examples/Inkplate5V2/Projects/Inkplate5V2_Image_Frame_From_Web/Inkplate5V2_Image_Frame_From_Web.ino at 2dd263f2f9548aadac8638413a143beddf068a64 · SolderedElectronics/Inkplate-Arduino-library · GitHub

The resistor you highlighted is correct.

Attachment omitted in migration: image.png

Attachment omitted in migration: image.png