<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How long M5stack-paper can sleep for?]]></title><description><![CDATA[<p dir="auto">I have programmed M5stack-Paper in a way that it connects to the WiFi, read data from Firebase and sleep for provided seconds using "M5.shutdown(Secs)". <a href="https://docs.m5stack.com/en/api/m5paper/system_api" target="_blank" rel="noopener noreferrer nofollow ugc">read documentation here</a></p>
<p dir="auto">It is working fine if the sleep duration is less than 4 hours.<br />
If the sleep duration is more than 4 hours then the M5 paper is waking up properly according to the given sleep duration but waking up randomly after 2 - 3 hours .<br />
I also tried "M5.shutdown( const rtc_date_t &amp;RTC_DateStruct, const rtc_time_t &amp;RTC_TimeStruct)" but it didn't work as well.</p>
<ol>
<li>Is there any limitation regarding the sleep duration for M5stack-paper?</li>
<li>Is there any other shutdown function which can be used to wake it up for longer durations?</li>
</ol>
]]></description><link>https://community.m5stack.com/topic/5671/how-long-m5stack-paper-can-sleep-for</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 06:21:00 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/5671.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 26 Sep 2023 19:15:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How long M5stack-paper can sleep for? on Thu, 02 Nov 2023 18:24:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a> Hello Felix.<br />
Thank you very much for your help.<br />
I get it working using the hour field with some little changes.</p>
]]></description><link>https://community.m5stack.com/post/22633</link><guid isPermaLink="true">https://community.m5stack.com/post/22633</guid><dc:creator><![CDATA[ScheduleDisplay]]></dc:creator><pubDate>Thu, 02 Nov 2023 18:24:43 GMT</pubDate></item><item><title><![CDATA[Reply to How long M5stack-paper can sleep for? on Fri, 29 Sep 2023 07:44:50 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/scheduledisplay" aria-label="Profile: ScheduleDisplay">@<bdi>ScheduleDisplay</bdi></a></p>
<p dir="auto">please find an example <a href="https://github.com/felmue/MyM5StackExamples/blob/main/M5Paper/ShutdownWakeAfterHours/ShutdownWakeAfterHours.ino" target="_blank" rel="noopener noreferrer nofollow ugc">here</a> which (when turned on by power button) shuts down and wakes up from RTC about 7 hours later.</p>
<p dir="auto">Note: only using the hour field gives you a maximum of 23 hours. If you need more you'll need to also use the day and maybe year fields.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/22363</link><guid isPermaLink="true">https://community.m5stack.com/post/22363</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Fri, 29 Sep 2023 07:44:50 GMT</pubDate></item><item><title><![CDATA[Reply to How long M5stack-paper can sleep for? on Thu, 28 Sep 2023 15:50:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a> Hello Felix.<br />
Is it possible to provide me the working code snippet with longer than 4 hours sleep duration?</p>
<p dir="auto">Or</p>
<p dir="auto">Can you please check if there is any problem with the code snippet I posted earlier?</p>
<p dir="auto">Thanks</p>
]]></description><link>https://community.m5stack.com/post/22356</link><guid isPermaLink="true">https://community.m5stack.com/post/22356</guid><dc:creator><![CDATA[ScheduleDisplay]]></dc:creator><pubDate>Thu, 28 Sep 2023 15:50:15 GMT</pubDate></item><item><title><![CDATA[Reply to How long M5stack-paper can sleep for? on Thu, 28 Sep 2023 12:11:54 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/scheduledisplay" aria-label="Profile: ScheduleDisplay">@<bdi>ScheduleDisplay</bdi></a></p>
<p dir="auto">No, if the touch is enabled (first true) then that already is done there. See <a href="https://github.com/m5stack/M5EPD/blob/main/src/M5EPD.cpp#L54" target="_blank" rel="noopener noreferrer nofollow ugc">here</a>.</p>
<p dir="auto">Ok - battery - I am afraid I am not sure why it would fail then.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/22346</link><guid isPermaLink="true">https://community.m5stack.com/post/22346</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Thu, 28 Sep 2023 12:11:54 GMT</pubDate></item><item><title><![CDATA[Reply to How long M5stack-paper can sleep for? on Thu, 28 Sep 2023 11:03:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a> Hello Felix.</p>
<ol>
<li>
<p dir="auto">I also already had <code>delay (10)</code> before <code>M5.shutdown();</code><br />
Do I2CEnable need to be TRUE in M5 initialization? to use I2C commands?<br />
I have it False in M5 initialization call <code>  M5.begin(true, false, true, true, false);</code>, could this be a problem?<br />
However, it is working fine if the sleep duration is less than 4 hours</p>
</li>
<li>
<p dir="auto">M5Paper has 100% battery, I can restart it manually by pressing the side button. The battery is showing as 100%</p>
</li>
</ol>
]]></description><link>https://community.m5stack.com/post/22344</link><guid isPermaLink="true">https://community.m5stack.com/post/22344</guid><dc:creator><![CDATA[ScheduleDisplay]]></dc:creator><pubDate>Thu, 28 Sep 2023 11:03:37 GMT</pubDate></item><item><title><![CDATA[Reply to How long M5stack-paper can sleep for? on Thu, 28 Sep 2023 10:38:24 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/scheduledisplay" aria-label="Profile: ScheduleDisplay">@<bdi>ScheduleDisplay</bdi></a></p>
<p dir="auto">no, I don't think there is a limitation. This is a regular alarm function of the RTC which should allow an alarm even years from now.</p>
<p dir="auto">But I noticed that the code in the library adds a small <code>delay(10)</code> to make sure the I2C command to set the alarm time has finished before powering off.</p>
<p dir="auto">The only other reason I could think of that the M5Paper doesn't wake up anymore would be a flat battery.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/22343</link><guid isPermaLink="true">https://community.m5stack.com/post/22343</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Thu, 28 Sep 2023 10:38:24 GMT</pubDate></item><item><title><![CDATA[Reply to How long M5stack-paper can sleep for? on Thu, 28 Sep 2023 09:47:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a> I tried longer sleep duration of 9 hours and unfortunately the device didn't wakeup.<br />
Is it possible that <code>M5.RTC.setAlarmIRQ(wakeupDate, wakeupTime);</code> also has a limitaiton of max 4 hours of sleep duration?</p>
]]></description><link>https://community.m5stack.com/post/22341</link><guid isPermaLink="true">https://community.m5stack.com/post/22341</guid><dc:creator><![CDATA[ScheduleDisplay]]></dc:creator><pubDate>Thu, 28 Sep 2023 09:47:41 GMT</pubDate></item><item><title><![CDATA[Reply to How long M5stack-paper can sleep for? on Wed, 27 Sep 2023 15:43:16 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/scheduledisplay" aria-label="Profile: ScheduleDisplay">@<bdi>ScheduleDisplay</bdi></a></p>
<p dir="auto">it doesn't really matter as `M5.shutdown( wakeupDate, wakeupTime) essentially does the same. See <a href="https://github.com/m5stack/M5EPD/blob/main/src/M5EPD.cpp#L135" target="_blank" rel="noopener noreferrer nofollow ugc">here</a>.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/22326</link><guid isPermaLink="true">https://community.m5stack.com/post/22326</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Wed, 27 Sep 2023 15:43:16 GMT</pubDate></item><item><title><![CDATA[Reply to How long M5stack-paper can sleep for? on Wed, 27 Sep 2023 12:39:56 GMT]]></title><description><![CDATA[<p dir="auto">Hello Felix,<br />
Thank you very much for your reply.</p>
<p dir="auto">I updated the code according to your suggestion.</p>
<ol>
<li>I know the actual time so I set the actual date and time of RTC.</li>
</ol>
<pre><code>  rtc_date_t RTCDate;
  rtc_time_t RTCtime;

  RTCDate.year = year();
  RTCDate.mon  = month();
  RTCDate.day  = day();
  M5.RTC.setDate(&amp;RTCDate);

  RTCtime.hour = hour();
  RTCtime.min  = minute();
  RTCtime.sec  = second();
  M5.RTC.setTime(&amp;RTCtime);

  Serial.print("\n Actual RTC date and time  =&gt;" + String(RTCDate.day) + "-" + String(RTCDate.mon) + "-" + String(RTCDate.year) + " " + String(RTCtime.hour) + ":" + String(RTCtime.min) + ":" + String(RTCtime.sec) );

</code></pre>
<ol start="2">
<li>I also know the sleep duration in secs. for example <code>30 minutes (1800 secs)</code>. So I added these secs into the current time to get the wakeup time in the future.</li>
</ol>
<pre><code>int nextRereshTimeInSecs = now() + 1800;
setTime(nextRereshTimeInSecs);
</code></pre>
<ol start="3">
<li>Then I set the alarm using <code>setAlarmIRQ(const rtc_date_t &amp;date, const rtc_time_t &amp;time)</code> and shut down the M5stack-paper.</li>
</ol>
<pre><code>    rtc_date_t wakeupDate;
    rtc_time_t wakeupTime;

    int currentYear = year();
    int8_t int8_year = currentYear % 100;
    int8_t int8_month = month();
    int8_t int8_day = day(); 
    
    // Populate rtc_date_t structure
    wakeupDate.year = int8_year ;
    wakeupDate.mon = int8_month ;
    wakeupDate.day = int8_day;

    int8_t int8_hour = hour();
    int8_t int8_minute = minute();
    int8_t int8_second = second(); 
    // Populate rtc_time_t structure
    wakeupTime.hour = int8_hour;
    wakeupTime.min = int8_minute;
    wakeupTime.sec = int8_second;

    Serial.print("\n Future RTC date and time  =&gt;" + String(wakeupDate.day) + "-" + String(wakeupDate.mon) + "-" + String(wakeupDate.year) + " " + String(wakeupTime.hour) + ":" + String(wakeupTime.min) + ":" + String(wakeupTime.sec) );

    delay(300);
    M5.RTC.clearIRQ();
    M5.RTC.setAlarmIRQ(wakeupDate, wakeupTime);

    delay(10);
    M5.shutdown();
</code></pre>
<p dir="auto">Currently, I am testing it with the sleep duration of 30 minutes and it looks like working. I will test it for more than 4 hours tonight.</p>
<p dir="auto">The question is that, do I have to use<br />
<code>M5.shutdown( wakeupDate, wakeupTime)</code></p>
<p dir="auto">OR</p>
<p dir="auto">is it OK what I am currently using<br />
<code>M5.RTC.setAlarmIRQ(wakeupDate, wakeupTime);</code><br />
<code>M5.shutdown();</code></p>
]]></description><link>https://community.m5stack.com/post/22324</link><guid isPermaLink="true">https://community.m5stack.com/post/22324</guid><dc:creator><![CDATA[ScheduleDisplay]]></dc:creator><pubDate>Wed, 27 Sep 2023 12:39:56 GMT</pubDate></item><item><title><![CDATA[Reply to How long M5stack-paper can sleep for? on Tue, 26 Sep 2023 21:14:23 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/scheduledisplay" aria-label="Profile: ScheduleDisplay">@<bdi>ScheduleDisplay</bdi></a></p>
<p dir="auto"><code>M5.shutdown(secs)</code> uses the <code>timer</code> function of the RTC. According to the <a href="https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/BM8563_V1.1_cn.pdf" target="_blank" rel="noopener noreferrer nofollow ugc">documentation</a> the timer is 8 bits and it slowest clock source is 1/60 Hz. So you get about 255 x 60 s = 15300 s which is roughly 4 h (= 14400 s).</p>
<p dir="auto">Re 1.) So yes, there is a  limitation of the sleep duration when using the <code>timer</code> function of the RTC.</p>
<p dir="auto">If you need longer period than 4 hours you need to look into the <code>alarm</code> functionality of the RTC. E.g. you first need to read the RTC time, add the amount you want to sleep to it and then set the alarm accordingly.</p>
<p dir="auto"><code>M5.shutdown(const rtc_date_t &amp;RTC_DateStruct, const rtc_time_t &amp;RTC_TimeStruct)</code> can be used to set the alarm, but it only works when you first calculate the alarm time in relation the <code>actual</code> time in the RTC.</p>
<p dir="auto">Note: the <code>actual</code> time in the RTC resets when there is no USB and the battery has run out of juice. The <code>actual</code> time is not automatically the time on you wall clock (except when you actually set it in the RTC). But for the <code>alarm</code> function to be used it doesn't have to be synced with the wall clock - it's only important that you know the time the RTC so you can calculate the difference and set the alarm.</p>
<p dir="auto">Re 2.) so no other shutdown function is needed.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/22323</link><guid isPermaLink="true">https://community.m5stack.com/post/22323</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Tue, 26 Sep 2023 21:14:23 GMT</pubDate></item></channel></rss>