<?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[Sleep Mode Description]]></title><description><![CDATA[<p dir="auto">How does sleep work, help doc doesn't explain it?  When the device goes to sleep, what memory is retained?  Does it continue from where it left off or restarts boot &amp; main.    Did I miss the doco for this?</p>
]]></description><link>https://forum.pycom.io/topic/4304/sleep-mode-description</link><generator>RSS for Node</generator><lastBuildDate>Sun, 14 Jun 2026 00:51:29 GMT</lastBuildDate><atom:link href="https://forum.pycom.io/topic/4304.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 30 Jan 2019 12:52:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Sleep Mode Description on Wed, 30 Jan 2019 12:52:20 GMT]]></title><description><![CDATA[<p dir="auto">How does sleep work, help doc doesn't explain it?  When the device goes to sleep, what memory is retained?  Does it continue from where it left off or restarts boot &amp; main.    Did I miss the doco for this?</p>
]]></description><link>https://forum.pycom.io/post/25336</link><guid isPermaLink="true">https://forum.pycom.io/post/25336</guid><dc:creator><![CDATA[misterlisty]]></dc:creator><pubDate>Wed, 30 Jan 2019 12:52:20 GMT</pubDate></item><item><title><![CDATA[Reply to Sleep Mode Description on Wed, 30 Jan 2019 15:08:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/1981">@misterlisty</a> If you mean deep sleep, in all cases, all CPU memory and CPU state is lost, and on wake-up it's like the module was just powered on.</p>
<p dir="auto">This is in the docs, though it's perhaps not that clear.</p>
<p dir="auto">For <code>machine.deepsleep</code>:</p>
<p dir="auto"><a href="https://docs.pycom.io/firmwareapi/pycom/machine/#machinedeepsleeptimems" target="_blank" rel="noopener noreferrer nofollow">https://docs.pycom.io/firmwareapi/pycom/machine/#machinedeepsleeptimems</a></p>
<blockquote>
<p dir="auto">Stops the CPU and all peripherals, including the networking interfaces (except for LTE). <strong>Execution is resumed from the main script, just as with a reset</strong>.</p>
</blockquote>
<p dir="auto">Note that at the ESP32 level the RTC domain including its memory is kept active, but there's no support for that at the micropython level.</p>
<p dir="auto">In the case of Pysense/Pytrack/Deep Sleep Shield-controlled deep sleep, it's even worse, as power to the ESP32 is cut.</p>
]]></description><link>https://forum.pycom.io/post/25341</link><guid isPermaLink="true">https://forum.pycom.io/post/25341</guid><dc:creator><![CDATA[jcaron]]></dc:creator><pubDate>Wed, 30 Jan 2019 15:08:59 GMT</pubDate></item><item><title><![CDATA[Reply to Sleep Mode Description on Wed, 30 Jan 2019 16:03:07 GMT]]></title><description><![CDATA[<p dir="auto">The wording on that isnt brilliant. but yes. it restarts from the top of <a href="http://main.py" target="_blank" rel="noopener noreferrer nofollow">main.py</a> again. ill update the docs to be clearer</p>
]]></description><link>https://forum.pycom.io/post/25347</link><guid isPermaLink="true">https://forum.pycom.io/post/25347</guid><dc:creator><![CDATA[Paul Thornton]]></dc:creator><pubDate>Wed, 30 Jan 2019 16:03:07 GMT</pubDate></item><item><title><![CDATA[Reply to Sleep Mode Description on Wed, 30 Jan 2019 17:21:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/3525">@paul-thornton</a> To be precise, it actually starts from the top of <a href="http://boot.py" target="_blank" rel="noopener noreferrer nofollow">boot.py</a> :-)</p>
<p dir="auto">While you're in the docs, I don't think the read_battery_voltage method for the Pysense/Pytrack/etc. is in the docs, you may want to add that as well.</p>
]]></description><link>https://forum.pycom.io/post/25352</link><guid isPermaLink="true">https://forum.pycom.io/post/25352</guid><dc:creator><![CDATA[jcaron]]></dc:creator><pubDate>Wed, 30 Jan 2019 17:21:41 GMT</pubDate></item><item><title><![CDATA[Reply to Sleep Mode Description on Wed, 30 Jan 2019 21:23:58 GMT]]></title><description><![CDATA[<p dir="auto">From what i read above, it would also restart <a href="http://boot.py" target="_blank" rel="noopener noreferrer nofollow">boot.py</a>?</p>
]]></description><link>https://forum.pycom.io/post/25367</link><guid isPermaLink="true">https://forum.pycom.io/post/25367</guid><dc:creator><![CDATA[misterlisty]]></dc:creator><pubDate>Wed, 30 Jan 2019 21:23:58 GMT</pubDate></item><item><title><![CDATA[Reply to Sleep Mode Description on Wed, 30 Jan 2019 23:06:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/1981">@misterlisty</a> Yes, it acts exactly as on a power on, it executes <code>boot.py</code> then <code>main.py</code>.</p>
<p dir="auto">The only way to know whether it's a power on or a wake from sleep (and what the reason for the wake up was) is to call <a href="https://docs.pycom.io/firmwareapi/pycom/machine/#machinewakereason" target="_blank" rel="noopener noreferrer nofollow"><code>machine.wake_reason</code></a>.</p>
<p dir="auto">The possible reasons are listed in the constants at the bottom of the page: <code>machine.PWRON_WAKE</code>, <code>machine.PIN_WAKE</code>, <code>machine.RTC_WAKE</code>, <code>machine.ULP_WAKE</code>.</p>
]]></description><link>https://forum.pycom.io/post/25370</link><guid isPermaLink="true">https://forum.pycom.io/post/25370</guid><dc:creator><![CDATA[jcaron]]></dc:creator><pubDate>Wed, 30 Jan 2019 23:06:30 GMT</pubDate></item><item><title><![CDATA[Reply to Sleep Mode Description on Thu, 31 Jan 2019 11:04:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/1538">@jcaron</a> said in <a href="/post/25352">Sleep Mode Description</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/3525">@paul-thornton</a> To be precise, it actually starts from the top of <a href="http://boot.py" target="_blank" rel="noopener noreferrer nofollow">boot.py</a> :-)<br />
While you're in the docs, I don't think the read_battery_voltage method for the Pysense/Pytrack/etc. is in the docs, you may want to add that as well.</p>
</blockquote>
<p dir="auto">Thanks ill get this added today if its missing.</p>
]]></description><link>https://forum.pycom.io/post/25415</link><guid isPermaLink="true">https://forum.pycom.io/post/25415</guid><dc:creator><![CDATA[Paul Thornton]]></dc:creator><pubDate>Thu, 31 Jan 2019 11:04:12 GMT</pubDate></item></channel></rss>