-->
Page 2 of 3

Re: Problem with deep sleep mode

PostPosted: Sun Mar 10, 2019 11:02 pm
by Arieel
schufti wrote:if you are using latest esp arduino core, switch back to 2.4.2


the same thing is happening with this version

Re: Problem with deep sleep mode

PostPosted: Mon Mar 11, 2019 2:27 am
by schufti
hi,
the boot message looks ok and it looks like it starts the usercode.
Upload with "erase whole flash".
Maybe try to reduce your code to the bare minimun and see if this improves stability.
If this doesn't help, provide this minimum sketch.

p.s.: do not hardwire gpio0/2 use pull-ups, keep the diode between gpio16/rst, have a pull-up on rst.
esp is sensitive if during boot rx is ??? (high/low can't remember) best disconnect rx/tx.
try moving diode from rst to en (have pull-up on en).

Re: Problem with deep sleep mode

PostPosted: Tue Mar 12, 2019 12:39 am
by Arieel
hi Schufti.
i changed the board for 2.4.2 as you said and doesn't work.
Also, upload the code with the option "Erase Flash: All flash contents" and the same problem.
I have the pull up/down resistors.
If i put the diode between gpio16 and ch_pd doesn't work, and this is in the console when its time to wake up (first time):
Code: Select all ets Jan  8 2013,rst cause:0, boot mode:(3,6)

unknown reset
ets_main.c βΈ®


This is my code (very simple to tray the deep sleep mode)
Code: Select allint LED = 5;                     
uint32_t TIEMPO_DeepSleep = 4e6; 

void setup() {         
  Serial.begin(115200);
  pinMode(LED, OUTPUT);         
  digitalWrite(LED, HIGH);                             
 // TIEMPO_Referencia = millis();
  }
 
void loop() {
 
  if (millis() > 3000){
    Serial.println();
    ESP.deepSleep(TIEMPO_DeepSleep, WAKE_RF_DISABLED);     
    }
  }


The problem is the same, randomly when its time to wake up doesnt run the code, but i think that the esp wakes up because the console sows the same as when it works correctly and the on board blue led blinks one time
Code: Select allets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
vbb28d4a3
~ld


another idea to try to solve this problem?
thanks!

Re: Problem with deep sleep mode

PostPosted: Tue Mar 12, 2019 2:46 am
by schufti
If it doesn't work at all with the diode, then there is a hw problem.
Make sure you have a pull-up on rst and the diode from rst -->|-- gpio16 (cathode or ring to gpio16)
for best result use a schottky type (low forward voltage)
You can try and remove the connection to see the different behaviour and bootmessage.
There has been a similar probleme not long ago: viewtopic.php?p=80901

In your sketch, insert a delay(100) after the deepsleep.
In 2.4.2 the deepsleep is defined uint64_t