• Really enjoying getting to know my Espruino Wifi. I'm trying to build a test simple device that wakes on a button press and sends a signal. I want it to be battery powered so was super excited about the very low power consumption in deep sleep mode and easy wake on interrupt.

    When I set this up to wake on a signal to A0, and then go back to sleep I still get a current draw of 2.3 mA (not the hoped for 0.05 mA). Is there something that I need to instruct to power down (like explicitly telling the wifi to power down) to get to the low power consumption?

    pinMode(A0, 'input_pulldown');
    setSleepIndicator(LED1);
    
    setWatch(function() {  
    
      // doing stuff
      console.log("doing stuff");
    
      setTimeout(function(){
          console.log("Going to sleep again");
          setDeepSleep(1);
        }, 2000);
      
    }, A0, {repeat: true, edge: 'rising'});
    
    console.log("Going to sleep");
    setDeepSleep(1);
    

    Thanks in advance,
    Narath

  • I see console.log("doing stuff"); in your code, but no serial port connected on the picture. Do you have data waiting at the serial port?

  • Sun 2020.02.23

    Good catch @maze1980.

    L10 console.log("Going to sleep again");

    It's very likely L7 is processed but not line 10, as the watch would trigger on the rising edge as the button is released. Two seconds elapse, the L10 log message is cued and Espruino immediately executes and enters Deep Sleep long before the (same for L16) log message is processed.

    EDIT: then again maybe not - Note from Power Consumption
    Bullet 3 'Not have any data waiting to be sent down Serial or USB'
    Note: Espruino won't enter deep sleep as soon as you execute setDeepSleep(1). It'll wait until all the bullet points above are satisfied, and then it'll enter it.

About

Avatar for maze1980 @maze1980 started