Deep sleep not working in ESP32

Posted on
  • hi ,

    I am using esp32 huzza32 board . i want to deepsleep my device for several time . but i am unable to sleep my device it restart but never sleep.

    My code:

    E.on('init',function() {

    digitalWrite(new Pin(13), 0); 
    var count = 0 ;  
    setInterval(function() {   
      count++;     
        console.log(count);
        if(count >= 10 ){
           ESP32.deepSleep(100000);
        }
    }, 100);
    

    });

    Output :

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    ets Jun 8 2016 00:22:57
    rst:0x5 (DEEPSLEEP_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div:2
    load:0x3fff0018,len:4
    load:0x3fff001c,len:2364
    load:0x40078000,len:0
    load:0x40078000,len:10880
    entry 0x40078c4c

  • The timeout is in microseconds (don't ask why!), so 100000 is 0.1 seconds. So it's probably working just fine.

    ESP8266/ESP32 deep sleep does work by completely rebooting the device. If you want something that doesn't then buy an official Espruino board which can sleep without losing the contents of memory.

  • You need to go to settings communication and on the end of the list is Save and Send and select Direct to flash (execute code at boot)

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Deep sleep not working in ESP32

Posted by Avatar for Saurabh @Saurabh

Actions