B4R Question DeepSleep problem

Humberto

Active Member
Licensed User
Longtime User
When I call DeepSleep when the Wifi is configurate as client it works.

When I call deepsleep when the wifi is as server occurs this error.

I try the command "WiFi.Disconnect" and 4 seconds timer before deepsleep


I could not find how to disconect as server
B4X:
 ets Jan  8 2013,rst cause:4, boot mode:(3,6)
wdt reset
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v10e0c112
~ld
AppStart

B4X:
Public Sub deepsleep(ms As ULong)
Log ( "dormindo....")   
    RunNative("deepSleep", ms * 1000)
End Sub

#if C
void deepSleep(B4R::Object* o) {
   ESP.deepSleep(o->toULong());
}
#end if
 

Humberto

Active Member
Licensed User
Longtime User
Erel

You must set SSID and Password

I put a Button to Pin_ESP.D2 pull-up. If you restart with that pin pressed the software enter in a Server mode. And the led is blinking ( NODEMCU ), after 10 seconds we can press again the button and it should be in sleepmode but it restart end send a solicitation to a server and then goes to sleep mode.


Another question when the wifi connection fails it keep trying to connect and I need that it cames back so I can try another SSID

Thanks


Humberto
 

Attachments

  • problemaSleep.zip
    7.6 KB · Views: 294
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

Humberto

Active Member
Licensed User
Longtime User
I just Call "eepsleep(0)" direct instead off put the LED ON and wait 3 seconds and works

I still don´t know why it happens even if I just wait even 2 seconds before go to sleepmode.

Thanks
 
Upvote 0
Top