<?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[machine.sleep(time_in_millis) does time_in_millis has some limit? not works for 6 hours value...]]></title><description><![CDATA[<p dir="auto">Hi there,<br />
can someone please say me, if there any limit for argument passing to machine.deepsleep()? When I pass 600000 ms to the funciton it works just nicely, SiPY sends message every 10 minutes, but when I pass 21600000 which is 6 hours, then my SiPy start to send message every 2 minutes!</p>
<pre><code># 10 min
SLEEP_TIME_10M = 600000
# 6 hours
SLEEP_TIME_6H = 21600000
.... code ....
s.send(str(sensor1.distance_in_cm()))
machine.deepsleep(SLEEP_TIME_6H)
</code></pre>
<p dir="auto">Thanks in advance!</p>
]]></description><link>https://forum.pycom.io/topic/944/machine-sleep-time_in_millis-does-time_in_millis-has-some-limit-not-works-for-6-hours-value</link><generator>RSS for Node</generator><lastBuildDate>Thu, 12 Nov 2026 07:54:28 GMT</lastBuildDate><atom:link href="https://forum.pycom.io/topic/944.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 28 Mar 2017 16:10:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to machine.sleep(time_in_millis) does time_in_millis has some limit? not works for 6 hours value... on Tue, 28 Mar 2017 19:43:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jmarcelino" aria-label="Profile: jmarcelino">@<bdi>jmarcelino</bdi></a><br />
created<br />
<a href="https://github.com/pycom/pycom-micropython-sigfox/issues/1" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/pycom/pycom-micropython-sigfox/issues/1</a><br />
and also pull<br />
<a href="https://github.com/pycom/pycom-micropython-sigfox/pull/2" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/pycom/pycom-micropython-sigfox/pull/2</a></p>
]]></description><link>https://forum.pycom.io/post/5763</link><guid isPermaLink="true">https://forum.pycom.io/post/5763</guid><dc:creator><![CDATA[livius]]></dc:creator><pubDate>Tue, 28 Mar 2017 19:43:33 GMT</pubDate></item><item><title><![CDATA[Reply to machine.sleep(time_in_millis) does time_in_millis has some limit? not works for 6 hours value... on Tue, 28 Mar 2017 19:36:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/livius" aria-label="Profile: livius">@<bdi>livius</bdi></a><br />
I think the current one is <a href="https://github.com/pycom/pycom-micropython-sigfox" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/pycom/pycom-micropython-sigfox</a></p>
<p dir="auto">You'll be the very first issue ;-)</p>
]]></description><link>https://forum.pycom.io/post/5762</link><guid isPermaLink="true">https://forum.pycom.io/post/5762</guid><dc:creator><![CDATA[jmarcelino]]></dc:creator><pubDate>Tue, 28 Mar 2017 19:36:37 GMT</pubDate></item><item><title><![CDATA[Reply to machine.sleep(time_in_millis) does time_in_millis has some limit? not works for 6 hours value... on Tue, 28 Mar 2017 19:34:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jmarcelino" aria-label="Profile: jmarcelino">@<bdi>jmarcelino</bdi></a><br />
Do you know what repository is now valid?<br />
<a href="https://github.com/pycom/pycom-micropython" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/pycom/pycom-micropython</a><br />
<a href="https://github.com/pycom/pycom-micropython-sigfox" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/pycom/pycom-micropython-sigfox</a><br />
or current merging<br />
<a href="https://github.com/pycom/pycom-micropython-censis" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/pycom/pycom-micropython-censis</a></p>
]]></description><link>https://forum.pycom.io/post/5761</link><guid isPermaLink="true">https://forum.pycom.io/post/5761</guid><dc:creator><![CDATA[livius]]></dc:creator><pubDate>Tue, 28 Mar 2017 19:34:57 GMT</pubDate></item><item><title><![CDATA[Reply to machine.sleep(time_in_millis) does time_in_millis has some limit? not works for 6 hours value... on Tue, 28 Mar 2017 19:04:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/livius" aria-label="Profile: livius">@<bdi>livius</bdi></a><br />
You are right of course. I guess someone <a href="https://github.com/pycom/pycom-micropython-sigfox/issues" target="_blank" rel="noopener noreferrer nofollow ugc">should file it with github</a> let me know if you want me to do it.</p>
<p dir="auto">You can see the problem with  this small C test code:</p>
<pre><code>#include &lt;stdint.h&gt;

int in32 = 21600000;

void castresult () {
        uint64_t out64 = 0;
        out64 = (uint64_t) (in32 * 1000);
}

void casttime () {
        uint64_t out64 = 0;
        out64 = (uint64_t)in32 * 1000;
}
</code></pre>
<p dir="auto">Compile with: <code>xtensa-esp32-elf-gcc -c test.c</code><br />
then dump the generated Xtensa assembly code: <code>xtensa-esp32-elf-objdump -D test.o</code> and the difference - and problem - between the two becomes obvious.</p>
<pre><code class="language-plain">00000000 &lt;castresult&gt;:
   0:   006136          entry   a1, 48
   3:   017d            mov.n   a7, a1
   5:   000021          l32r    a2, fffc0008 &lt;casttime+0xfffbffd8&gt;
   8:   000031          l32r    a3, fffc0008 &lt;casttime+0xfffbffd8&gt;
   b:   0729            s32i.n  a2, a7, 0
   d:   1739            s32i.n  a3, a7, 4
   f:   000021          l32r    a2, fffc0010 &lt;casttime+0xfffbffe0&gt;
  12:   0238            l32i.n  a3, a2, 0
  14:   032d            mov.n   a2, a3
  16:   1122b0          slli    a2, a2, 5
  19:   c02230          sub     a2, a2, a3
  1c:   1122e0          slli    a2, a2, 2
  1f:   223a            add.n   a2, a2, a3
  21:   1122d0          slli    a2, a2, 3
  24:   0729            s32i.n  a2, a7, 0
  26:   312f20          srai    a2, a2, 31
  29:   1729            s32i.n  a2, a7, 4
  2b:   f03d            nop.n
  2d:   f01d            retw.n
        ...

00000030 &lt;casttime&gt;:
  30:   006136          entry   a1, 48
  33:   017d            mov.n   a7, a1
  35:   000081          l32r    a8, fffc0038 &lt;casttime+0xfffc0008&gt;
  38:   000091          l32r    a9, fffc0038 &lt;casttime+0xfffc0008&gt;
  3b:   0789            s32i.n  a8, a7, 0
  3d:   1799            s32i.n  a9, a7, 4
  3f:   000061          l32r    a6, fffc0040 &lt;casttime+0xfffc0010&gt;
  42:   0668            l32i.n  a6, a6, 0
  44:   064d            mov.n   a4, a6
  46:   316f60          srai    a6, a6, 31
  49:   065d            mov.n   a5, a6
  4b:   e8a362          movi    a6, 0x3e8
  4e:   828560          mull    a8, a5, a6
  51:   060c            movi.n  a6, 0
  53:   826460          mull    a6, a4, a6
  56:   886a            add.n   a8, a8, a6
  58:   e8a362          movi    a6, 0x3e8
  5b:   829460          mull    a9, a4, a6
  5e:   a23460          muluh   a3, a4, a6
  61:   092d            mov.n   a2, a9
  63:   483a            add.n   a4, a8, a3
  65:   043d            mov.n   a3, a4
  67:   0729            s32i.n  a2, a7, 0
  69:   1739            s32i.n  a3, a7, 4
  6b:   0729            s32i.n  a2, a7, 0
  6d:   1739            s32i.n  a3, a7, 4
  6f:   f03d            nop.n
  71:   f01d            retw.n
</code></pre>
]]></description><link>https://forum.pycom.io/post/5756</link><guid isPermaLink="true">https://forum.pycom.io/post/5756</guid><dc:creator><![CDATA[jmarcelino]]></dc:creator><pubDate>Tue, 28 Mar 2017 19:04:38 GMT</pubDate></item><item><title><![CDATA[Reply to machine.sleep(time_in_millis) does time_in_millis has some limit? not works for 6 hours value... on Tue, 28 Mar 2017 17:09:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/josua" aria-label="Profile: josua">@<bdi>josua</bdi></a><br />
I supposed then some range was reached<br />
but i see in source code cast to uint64</p>
<pre><code>STATIC mp_obj_t machine_deepsleep (uint n_args, const mp_obj_t *arg) {
    mperror_enable_heartbeat(false);
    bt_deinit(NULL);
    wlan_deinit(NULL);
    if (n_args == 0) {
        esp_deep_sleep_start();
    } else {
        esp_deep_sleep((uint64_t)(mp_obj_get_int(arg[0]) * 1000));
    }
}
</code></pre>
<p dir="auto">i do not known C but<br />
is this ok?<br />
<code>(uint64_t)(mp_obj_get_int(arg[0]) * 1000)</code><br />
or it should be?<br />
<code>(uint64_t)mp_obj_get_int(arg[0]) * 1000</code></p>
]]></description><link>https://forum.pycom.io/post/5754</link><guid isPermaLink="true">https://forum.pycom.io/post/5754</guid><dc:creator><![CDATA[livius]]></dc:creator><pubDate>Tue, 28 Mar 2017 17:09:46 GMT</pubDate></item></channel></rss>