<?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[M5stickc plus2 DeepSleep]]></title><description><![CDATA[<p dir="auto">Hello!</p>
<p dir="auto">I use UIFlow 1.13.4  and M5stickc plus2</p>
<p dir="auto">def buttonA_wasDoublePress():<br />
global peer_mac, data, Sleep, Speed, Rudder_Angle, Select, cnt_succes, flag_cb<br />
M5pwr.brightness(0)<br />
p37 = machine.Pin(37, mode = <a href="http://machine.Pin.IN" target="_blank" rel="noopener noreferrer nofollow ugc">machine.Pin.IN</a>, pull = machine.Pin.PULL_UP)<br />
p37.irq(trigger = machine.Pin.WAKE_LOW, wake = machine.DEEPSLEEP)<br />
machine.deepsleep(20000)<br />
pass<br />
btnA.wasDoublePress(buttonA_wasDoublePress)</p>
<p dir="auto">I'm trying to add a deep sleep mode. But the device simply turns off when you press button A twice.</p>
<p dir="auto">Tell me how to realize deep sleep in UIFlow on M5stickc plus2.</p>
<p dir="auto">Thanks a lot.</p>
]]></description><link>https://community.m5stack.com/topic/6394/m5stickc-plus2-deepsleep</link><generator>RSS for Node</generator><lastBuildDate>Tue, 17 Mar 2026 09:08:13 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/6394.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 29 Apr 2024 13:37:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to M5stickc plus2 DeepSleep on Wed, 09 Jul 2025 00:03:13 GMT]]></title><description><![CDATA[<p dir="auto">And I just noticed that <a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/4037">@felmue</a> has an Arduino example of exactly that here: <a href="https://github.com/felmue/MyM5StackExamples/blob/main/M5StickCPlus2/SleepAndPowerOffTest/SleepAndPowerOffTest.ino" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/felmue/MyM5StackExamples/blob/main/M5StickCPlus2/SleepAndPowerOffTest/SleepAndPowerOffTest.ino</a></p>
]]></description><link>https://community.m5stack.com/post/29433</link><guid isPermaLink="true">https://community.m5stack.com/post/29433</guid><dc:creator><![CDATA[wjcarpenter]]></dc:creator><pubDate>Wed, 09 Jul 2025 00:03:13 GMT</pubDate></item><item><title><![CDATA[Reply to M5stickc plus2 DeepSleep on Tue, 08 Jul 2025 23:05:09 GMT]]></title><description><![CDATA[<p dir="auto">Thanks to those who provided information about this in this thread. I can see in retrospect that it is explained on the P2 documentation page, though in a way that makes a casual observer (like me :-) ) think "why are they telling me this? doesn't seem like something I need to know."</p>
<p dir="auto">I don't use UIFlow, so I had to do a little detective work to figure out how to do the equivalent in the Arduino framework. AFAIK, Arduino doesn't know anything about "hold", and you have to call an ESP32 native function to achieve it.</p>
<p dir="auto">Here's what worked for me:</p>
<pre><code>pinMode(4, OUTPUT);
digitalWrite(4, HIGH);
gpio_hold_en(GPIO_NUM_4);  // this is the interesting line
esp_sleep_enable_timer_wakeup(6 * 1000 * 1000);
esp_deep_sleep_start();
</code></pre>
]]></description><link>https://community.m5stack.com/post/29432</link><guid isPermaLink="true">https://community.m5stack.com/post/29432</guid><dc:creator><![CDATA[wjcarpenter]]></dc:creator><pubDate>Tue, 08 Jul 2025 23:05:09 GMT</pubDate></item><item><title><![CDATA[Reply to M5stickc plus2 DeepSleep on Wed, 01 May 2024 19:42:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/97714">@hopichek</a>,<br />
While Felix's method do work, please note it is only putting the ESP32 itself  in deep sleep  not the rest of the board. I don't know your power saving requirements for the sleeping periods,  but with the suggestion* I described above you'll probably get an even lower power consumption during deep sleep.</p>
<p dir="auto">*) if it works 😏</p>
]]></description><link>https://community.m5stack.com/post/25028</link><guid isPermaLink="true">https://community.m5stack.com/post/25028</guid><dc:creator><![CDATA[Cognitive5525]]></dc:creator><pubDate>Wed, 01 May 2024 19:42:20 GMT</pubDate></item><item><title><![CDATA[Reply to M5stickc plus2 DeepSleep on Wed, 01 May 2024 18:25:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/4037">@felmue</a> Thanks a lot, everything is working!</p>
]]></description><link>https://community.m5stack.com/post/25027</link><guid isPermaLink="true">https://community.m5stack.com/post/25027</guid><dc:creator><![CDATA[Hopichek]]></dc:creator><pubDate>Wed, 01 May 2024 18:25:23 GMT</pubDate></item><item><title><![CDATA[Reply to M5stickc plus2 DeepSleep on Mon, 29 Apr 2024 22:47:50 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/30733">@Cognitive5525</a></p>
<p dir="auto">I don't have an M5StickCPlus2 so I cannot do the necessary measurements. But in the past I measured the M5Paper power consumption for both sleep and shutdown modes. Please see <a href="https://www.gwendesign.ch/kb/m5stack/m5paper/#light-sleep-deep-sleep-and-shutdown-current" target="_blank" rel="noopener noreferrer nofollow ugc">here</a>. The power consumption in shutdown mode (only RTC running) drops to about 2.7 uA.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/24996</link><guid isPermaLink="true">https://community.m5stack.com/post/24996</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Mon, 29 Apr 2024 22:47:50 GMT</pubDate></item><item><title><![CDATA[Reply to M5stickc plus2 DeepSleep on Mon, 29 Apr 2024 20:45:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/4037">@felmue</a> said in <a href="/post/24993">M5stickc plus2 DeepSleep</a>:</p>
<blockquote>
<p dir="auto">the HOLD pin (GPIO4) needs to stay high during deep sleep to keep the ESP32 powered.<br />
Try the following to keep the value of the HOLD pin during deep sleep:<br />
from machine import Pin, deepsleep<br />
Pin(4, Pin.OUT, value=1, pull=Pin.PULL_HOLD) # HOLD PIN - UIFlow1<br />
#Pin(4, Pin.OUT, value=1, hold=True) # HOLD PIN - UIFlow2<br />
deepsleep(20000)</p>
</blockquote>
<p dir="auto">Here the system power is kept on - how is the power consumption compared to when only the BM8563 RTC is powered?</p>
]]></description><link>https://community.m5stack.com/post/24995</link><guid isPermaLink="true">https://community.m5stack.com/post/24995</guid><dc:creator><![CDATA[Cognitive5525]]></dc:creator><pubDate>Mon, 29 Apr 2024 20:45:17 GMT</pubDate></item><item><title><![CDATA[Reply to M5stickc plus2 DeepSleep on Mon, 29 Apr 2024 20:37:49 GMT]]></title><description><![CDATA[<p dir="auto">If you look at the electric diagram I referenced you'll see that there is a power circuit that relies on a software implemented power-on hold function.<br />
The ESP32 must pull up GPIO4 ("HOLD") to keep the system power on which include the power for the ESP32 itself.<br />
When you call the standard machine.deepsleep() which is designed to use the ESP32 <em>internal</em> deep-sleep which relies on power to the ESP32, then the GPIO4 will turn low and cause the external power circuit to cut power to the entire system  - expect for the BM8563 RTC. Now the ESP32 has no power and will never wake up again.<br />
The only way to power on again is to press the power button (designated S3 on the diagram) or if the BM8563 RTC pulls down the INT signal at some point. The BM8563 must be set up on beforehand with a timeout or date to pull the the INT signal.<br />
"Under the hood" in UIFlow firmware the GPIO4 will be pulled high just after boot i.e. when the power is turned on either by the power button or the INT signal from the BM8563 RTC. That is also why you have to keep the power button pressed a few seconds for the system to start - the ESP32 has to reach the point where it holds power on by itself - i.e. pulling GPIO4 high.</p>
<p dir="auto">I had a look at the UIFlow 1.x for M5stickC Plus 2 and there are some functions under RTC where you can set timeout and interrupt. I think you might bee able to do the following:</p>
<ul>
<li>Enable timer interrupt (from RTC section)</li>
<li>set timer value (from RTC section)</li>
<li>power off (from Power section)</li>
</ul>
]]></description><link>https://community.m5stack.com/post/24994</link><guid isPermaLink="true">https://community.m5stack.com/post/24994</guid><dc:creator><![CDATA[Cognitive5525]]></dc:creator><pubDate>Mon, 29 Apr 2024 20:37:49 GMT</pubDate></item><item><title><![CDATA[Reply to M5stickc plus2 DeepSleep on Mon, 29 Apr 2024 20:36:19 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/97714">@Hopichek</a></p>
<p dir="auto">the HOLD pin (GPIO4) needs to stay high during deep sleep to keep the ESP32 powered.<br />
Try the following to keep the value of the HOLD pin during deep sleep:</p>
<pre><code>from machine import Pin, deepsleep
Pin(4, Pin.OUT, value=1, pull=Pin.PULL_HOLD) # HOLD PIN - UIFlow1
#Pin(4, Pin.OUT, value=1, hold=True) # HOLD PIN - UIFlow2
deepsleep(20000)
</code></pre>
<p dir="auto">Note: verified with an M5Paper which has a similar power architecture.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/24993</link><guid isPermaLink="true">https://community.m5stack.com/post/24993</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Mon, 29 Apr 2024 20:36:19 GMT</pubDate></item><item><title><![CDATA[Reply to M5stickc plus2 DeepSleep on Mon, 29 Apr 2024 17:54:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/30733">@cognitive5525</a></p>
<p dir="auto">The problem is that I created a fairly large project in Flow 1.13 using functions that are not in Flow 2. Therefore, the question is rather how to implement deep sleep specifically in Flow 1.13. And I don't understand why the standard function doesn't work(</p>
<p dir="auto">The whole project is written in blocks in flow and in python I want to finish writing a deep sleep.</p>
]]></description><link>https://community.m5stack.com/post/24989</link><guid isPermaLink="true">https://community.m5stack.com/post/24989</guid><dc:creator><![CDATA[Hopichek]]></dc:creator><pubDate>Mon, 29 Apr 2024 17:54:19 GMT</pubDate></item><item><title><![CDATA[Reply to M5stickc plus2 DeepSleep on Mon, 29 Apr 2024 16:54:54 GMT]]></title><description><![CDATA[<p dir="auto">And maybe also upgrade to version 2.0.4:<br />
<img src="/assets/uploads/files/1714409689503-9410cad1-deab-49ce-9c75-58f0b056d21b-image-resized.png" alt="0_1714409688082_9410cad1-deab-49ce-9c75-58f0b056d21b-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.m5stack.com/post/24988</link><guid isPermaLink="true">https://community.m5stack.com/post/24988</guid><dc:creator><![CDATA[Cognitive5525]]></dc:creator><pubDate>Mon, 29 Apr 2024 16:54:54 GMT</pubDate></item><item><title><![CDATA[Reply to M5stickc plus2 DeepSleep on Mon, 29 Apr 2024 16:56:20 GMT]]></title><description><![CDATA[<p dir="auto">The "deepsleep" function of the M5StickC PLUS2 is taken care of by an external hardware-RTC (<s>RTC</s>BM8563). Have a look at the electric diagram on the <a href="https://docs.m5stack.com/en/core/M5StickC%20PLUS2" target="_blank" rel="noopener noreferrer nofollow ugc">doc page</a>.  I don't think you can use the "generic" Micropython machine.deepsleep()</p>
<p dir="auto">You should use the Power.timerSleep(sec) which is a part of the "built-in" M5 library.</p>
<p dir="auto">A tip if you are programming directly in Micropython and uploading via the serial port. You can use the <a href="https://uiflow2.m5stack.com/" target="_blank" rel="noopener noreferrer nofollow ugc">UIFlowl web site</a> as a kind of "API-reference". Go in and find the UIFlow "brick/function" you'll like to use and then see what Micropython code it generates.Here is an example:</p>
<p dir="auto"><img src="/assets/uploads/files/1714408872306-3a54a202-cfd4-4979-bbf1-a68a13917ceb-image-resized.png" alt="0_1714408864101_3a54a202-cfd4-4979-bbf1-a68a13917ceb-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.m5stack.com/post/24987</link><guid isPermaLink="true">https://community.m5stack.com/post/24987</guid><dc:creator><![CDATA[Cognitive5525]]></dc:creator><pubDate>Mon, 29 Apr 2024 16:56:20 GMT</pubDate></item></channel></rss>