You are reading a single comment by @allObjects and its replies. Click here to read the full conversation.
  • @pankleks, to understand what you are stating:

    Both micro python codes of post #1 and post #16 produce the same temperature of 51 C?

    If so, is a mystery to me too, because as you say: you go not to sleep, you just check time over and over until satisfied.

    This makes me conclude 2..3 things:

    • micropython implements the sleep just as you did with your time tick check (hard to believe... since python can do better... last but not least because it has multi threading and use timers/interrupts, etc... but why not go the cheap route? ...did not take a look at its implementation)
    • running Espruino keeps something else powered / alive that produces the heat...
    • in addition to 2nd bullet item, Espruino also does implement setInterval() without timers (which I hardly can believe... since it used timers/interrupts from the very beginning... but it may not use hw interrupts but software interrupts... I did not look (yet) at the implementation either... so I may be totally off... :/ )
  • I don't have any boards right now with me, but in #4 I measured the "idle" and "blink" power consumption of ESP32 & MicroPython board.
    In "idle" - connected to the REPL via USB - no code running, but ready for input, I measured 48mA.
    With the "blink" code from #1 with time.sleep_ms(1000), I measured 50mA.
    That's ~1/3 of Espruino's power consumption.

    Looked at Espruino's ESP32 code, and as far as I can tell, Espruino does not go to sleep mode with the ESP32 port at all. In ESP32 jshardware.c jshSleep does nothing. In other boards it does a bunch of checks, and goes to sleep if nothing is going on. For example nRF52

    Not sure what MicroPython does so far, and don't have a real micropython board to check their power consumption. But reading the docs, it looks like it doesn't go to sleep by default as much as an nRF Espruino, you have to explicitly send to sleep if you want to achieve really low power. "Just idles".

    But what is not right: According to the ESP32 datasheet, the power consumption in "modem sleep" with dual cores running at 240MHz should be 30-68mA. (the highest without radio). MicroPython is in this range. But in my measurements Espruino by default is well over this range. Ok, I must admit, I can't reliably switch off BLE and Wifi the same time. Goes into an endless reboot loop, and only reflashing helps. (I will post the console output later).
    So my hunch is the Espruino ESP32 maybe doesn't turn off the radio? Ok, probably does not make any difference if you are using Wifi...

About

Avatar for allObjects @allObjects started