I have an issue that when I call "deepsleep" from a rule in my code as last action,
the ESP still needs >15secs to go really into deepsleep.
Do you have an idea what could be the root cause for that behaviour?
I am using an ESP32 and "ESP_Easy_mega_20211224_display_ESP32_4M316k Dec 24 2021".
Basically, what the application does (or shall do):
1. wake up ESP32
2. read out values of ADS1115 ADC and BME280 through I2C and display them on OLED
3. transmitt the values via SentToHTTP to ThingSpeak
4. if a dedicated GPIO input (StayAwake#State) is not set to LOW, go into deepsleep, otherwise stay away (I use that for doing debugging or extending the code)
This is the code I am using:
Code: Select all
On Rules#Timer=3 do // stay awake until StayAwake#state is FALSE
TimerSet,3,0
Pulse,13,1,20
Pulse,13,0,150
Pulse,13,1,20
if [StayAwake#State]=1
TimerSet,3,2
else
TimerSet,3,0
event,GeheSchlafen
endif
endon
on GeheSchlafen do
TimerSet,1,0
TimerSet,2,0
TimerSet,3,0
TimerSet,4,0
Pulse,13,1,20
Pulse,13,0,150
Pulse,13,1,20
oledframedcmd,display,off
gpio,19,0 // +3V3_SW
gpio,18,0 // GSM_Wakeup
gpio,27,0
Deepsleep,30 //go to deepsleep for x seconds
endon
Looking into the weblog, this happens (deepsleep is called at line 31368):
Code: Select all
....
31311: Pulse,13,1,20
31311: Par1: 13 Par2: 1 Par3: 20 Par4: 0 Par5: 0
31333: GPIO : port 13. Pulse set for 20 ms
31338: ACT : oledframedcmd,display,off
31339: Command: oledframedcmd
31339: oledframedcmd,display,off
31340: Par1: 1073420576 Par2: 1073420576 Par3: 0 Par4: 0 Par5: 0
31346: ACT : gpio,19,0
31348: Command: gpio
31348: gpio,19,0
31348: Par1: 19 Par2: 0 Par3: 0 Par4: 0 Par5: 0
31349: GPIO : port#19: set to 0
31354: ACT : gpio,18,0
31355: Command: gpio
31355: gpio,18,0
31355: Par1: 18 Par2: 0 Par3: 0 Par4: 0 Par5: 0
31356: GPIO : port#18: set to 0
31360: ACT : gpio,27,0
31362: Command: gpio
31362: gpio,27,0
31362: Par1: 27 Par2: 0 Par3: 0 Par4: 0 Par5: 0
31363: GPIO : port#27: set to 0
31368: ACT : Deepsleep,30
31370: Command: Deepsleep
31370: Deepsleep,30
31370: Par1: 30 Par2: 0 Par3: 0 Par4: 0 Par5: 0
31371: EVENT: Time#Set
31962: EVENT: Time#Set Processing time:592 milliSeconds
31967: EVENT: ADC#VBatt=12.97
32433: EVENT: ADC#VBatt=12.97 Processing time:467 milliSeconds
32437: EVENT: ADC#VBatt=12.97
32860: EVENT: ADC#VBatt=12.97 Processing time:423 milliSeconds
32864: EVENT: ADC#VBatt=12.97
33329: EVENT: ADC#VBatt=12.97 Processing time:465 milliSeconds
33333: EVENT: ADC#VBatt=12.83
33779: EVENT: ADC#VBatt=12.83 Processing time:446 milliSeconds
33784: EVENT: BME280_1#Temp=25.1
34244: EVENT: BME280_1#Temp=25.1 Processing time:461 milliSeconds
34248: EVENT: BME280_1#Hum=21
34669: EVENT: BME280_1#Hum=21 Processing time:421 milliSeconds
34673: EVENT: BME280_1#Pres=1032
35088: EVENT: BME280_1#Pres=1032 Processing time:414 milliSeconds
35091: EVENT: ADC#VBatt=12.93
35542: EVENT: ADC#VBatt=12.93 Processing time:451 milliSeconds
35546: EVENT: ADC#VBatt=12.97
35936: EVENT: ADC#VBatt=12.97 Processing time:390 milliSeconds
35940: EVENT: ADC#VBatt=12.97
36368: EVENT: ADC#VBatt=12.97 Processing time:428 milliSeconds
36372: EVENT: ADC#VBatt=12.97
36731: UDP : 60:01:94:9E:61:77,192.168.1.113,113
36769: EVENT: ADC#VBatt=12.97 Processing time:397 milliSeconds
36773: EVENT: ADC#VBatt=12.97
37176: EVENT: ADC#VBatt=12.97 Processing time:403 milliSeconds
37180: EVENT: BME280_1#Temp=25.1
37350: UDP : 5C:CF:7F:78:65:D2,192.168.1.105,105
37620: EVENT: BME280_1#Temp=25.1 Processing time:440 milliSeconds
37624: EVENT: BME280_1#Hum=21
38020: EVENT: BME280_1#Hum=21 Processing time:396 milliSeconds
38024: EVENT: BME280_1#Pres=1032
38410: EVENT: BME280_1#Pres=1032 Processing time:386 milliSeconds
38414: EVENT: ADC#VBatt=12.85
38839: EVENT: ADC#VBatt=12.85 Processing time:425 milliSeconds
38844: EVENT: ADC#VBatt=12.97
39230: EVENT: ADC#VBatt=12.97 Processing time:387 milliSeconds
39234: EVENT: ADC#VBatt=12.90
39619: EVENT: ADC#VBatt=12.90 Processing time:385 milliSeconds
39623: EVENT: ADC#VBatt=12.97
40050: EVENT: ADC#VBatt=12.97 Processing time:427 milliSeconds
40054: EVENT: ADC#VBatt=12.89
40442: EVENT: ADC#VBatt=12.89 Processing time:388 milliSeconds
40446: EVENT: BME280_1#Temp=25.1
40832: EVENT: BME280_1#Temp=25.1 Processing time:386 milliSeconds
40836: EVENT: BME280_1#Hum=21
41263: EVENT: BME280_1#Hum=21 Processing time:427 milliSeconds
41267: EVENT: BME280_1#Pres=1032
41655: EVENT: BME280_1#Pres=1032 Processing time:388 milliSeconds
41659: EVENT: ADC#VBatt=12.83
42041: EVENT: ADC#VBatt=12.83 Processing time:382 milliSeconds
42046: EVENT: ADC#VBatt=12.97
42472: EVENT: ADC#VBatt=12.97 Processing time:427 milliSeconds
42476: EVENT: ADC#VBatt=12.97
42859: EVENT: ADC#VBatt=12.97 Processing time:383 milliSeconds
42863: EVENT: ADC#VBatt=12.83
43073: UDP : F4:CF:A2:D0:5A:09,192.168.1.158,158
43264: EVENT: ADC#VBatt=12.83 Processing time:401 milliSeconds
43268: EVENT: ADC#VBatt=12.97
43709: EVENT: ADC#VBatt=12.97 Processing time:441 milliSeconds
43713: EVENT: ADC#VBatt=12.97
44102: EVENT: ADC#VBatt=12.97 Processing time:389 milliSeconds
44107: EVENT: ADC#VBatt=12.97
44493: EVENT: ADC#VBatt=12.97 Processing time:387 milliSeconds
44497: EVENT: ADC#VBatt=12.97
44609: UDP : 5C:CF:7F:78:6E:22,192.168.1.108,108
44952: EVENT: ADC#VBatt=12.97 Processing time:455 milliSeconds
44956: EVENT: ADC#VBatt=12.97
45350: EVENT: ADC#VBatt=12.97 Processing time:394 milliSeconds
45354: EVENT: BME280_1#Temp=25.1
45779: EVENT: BME280_1#Temp=25.1 Processing time:425 milliSeconds
45783: EVENT: BME280_1#Hum=20
46041: UDP : 80:7D:3A:67:E4:20,192.168.1.118,118
46183: EVENT: BME280_1#Hum=20 Processing time:400 milliSeconds
46187: EVENT: BME280_1#Pres=1032
46353: UDP : 50:02:91:7A:0F:52,192.168.1.152,152
46600: EVENT: BME280_1#Pres=1032 Processing time:413 milliSeconds
46604: EVENT: ADC#VBatt=12.97
47054: EVENT: ADC#VBatt=12.97 Processing time:450 milliSeconds
47058: EVENT: ADC#VBatt=12.97
47442: EVENT: ADC#VBatt=12.97 Processing time:384 milliSeconds
47446: EVENT: ADC#VBatt=12.97
47475: UDP : 60:01:94:75:23:A5,192.168.1.110,110
47869: EVENT: ADC#VBatt=12.97 Processing time:423 milliSeconds
47873: EVENT: ADC#VBatt=12.97
47889: UDP : C4:4F:33:8C:A7:69,192.168.1.140,140
48332: EVENT: ADC#VBatt=12.97 Processing time:459 milliSeconds
48336: EVENT: ADC#VBatt=12.97
48766: EVENT: ADC#VBatt=12.97 Processing time:430 milliSeconds
48770: EVENT: System#Sleep
altough I did not call them and also during the other stages of the program, they do not occur in such
a high frequency than now after calling deepsleep.
Do you have any idea for the root cause why the deepsleep of my ESP32 is delayed by >15sec after calling the command?
Any advice is appreciated.
Thanks in advance,
AO16
P.S.: The timers 1..4 that I set to zero are already set to zero during earlier rules
- so this here in the last rule is just a last "cleanup" as I thought that maybe a false timer is blocking me from deepsleep.
The "pulse command" is connected to a LED that I also use for debugging, so here to see when "GeheSchlafen" has beed called.