i write a simple code to connect to wifi ap,but when esp try to connect wifi, esp will reset.
below is error message:
here is my project
please anyone help me!
thanks!
below is error message:
B4X:
load 0x4010f000, len 3584, room 16
tail 0
chksum 0xb0
csum 0xb0
v2843a5ac
~ld
AppStart
ConnectToNetwork
Trying to connect to: TEST password: TEST123456789
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
Exception (3):
epc1=0x4010078c epc2=0x00000000 epc3=0x00000000 excvaddr=0x4006eac1 depc=0x00000000
>>>stack>>>
ctx: cont
sp: 3ffffb10 end: 3fffffc0 offset: 0190
3ffffca0: feefeffe feefeffe feefeffe feefeffe
3ffffcb0: feefeffe feefeffe feefeffe feefeffe
3ffffcc0: feefeffe feefeffe feefeffe 3ffffe70
3ffffcd0: 0000049c 0000049c 00000020 40100974
3ffffce0: feefeffe feefeffe feefeffe feefeffe
3ffffcf0: 00000000 400042db 000000fd 40100bc4
3ffffd00: 40004b31 00001000 000000fd 401002f0
3ffffd10: 40105b24 feefeffe feefeffe 4022ebe1
3ffffd20: 401001cd 4022eccb 3ffef69c 0000049c
3ffffd30: 000000fd 3ffffe70 3ffef69c 4022ecae
3ffffd40: ffffff00 55aa55aa 0000000b 00000020
3ffffd50: 00000020 000000ac 000000ac aa55aa55
3ffffd60: 000000ff 4022f1ae 3ffef69c 3ffef69c
3ffffd70: 000000ff 0000017a 0000017a 401006bb
3ffffd80: 401001cd 00000001 3ffef6ac 4022f3ce
3ffffd90: 00000005 3ffef69c 000000ff 3ffffe70
3ffffda0: 3ffffe90 3ffef6d3 0000000b 00000020
3ffffdb0: 3ffef75c 3ffffed1 00000001 4022f47e
3ffffdc0: 3ffffe70 4023aa30 00000000 0000000d
3ffffdd0: 3ffefa9c 3ffffe90 3fff59d4 4022f44d
3ffffde0: 3ffef69c 4022f4b4 3ffe84cc 3ffe863c
3ffffdf0: 402020ca 3ffe863c 3ffe8641 4020201f
3ffffe00: 4d494445 00005841 00000000 3fff0760
3ffffe10: 3fff0730 0000000a 00000000 40209880
3ffffe20: 3631686b 64353340 74323134 38373834
3ffffe30: 00000000 4bc6a7f0 249ba5e3 00000000
3ffffe40: 00000000 00000000 4bc6a7f0 00000000
3ffffe50: 3fff0730 00000004 4010026c 00000354
3ffffe60: 021f8000 007eecb4 000a0d03 40203ef1
3ffffe70: 54534554 00000000 00000000 3fffff00
3ffffe80: 3ffffed0 0000000a 00000000 40202da8
3ffffe90: 54534554 34333231 38373635 40200039
3ffffea0: 00000000 4bc6a7f0 7d2f1a9f 00000000
3ffffeb0: 00000000 00000000 4bc6a7f0 00000000
3ffffec0: 3ffffed0 00000004 40100274 0000005b
3ffffed0: 00000000 00000066 3ffe8681 00000002
3ffffee0: 00000004 00000000 3ffee388 00000001
3ffffef0: 4023b6d0 3ffee366 3ffe8655 00000000
3fffff00: 0000005b 00000000 3ffee388 40201753
3fffff10: 3ffe863c 00000066 4023b6b8 00000065
3fffff20: 3ffe863c 00000066 00000001 00000000
3fffff30: 3fffff60 00000065 3fffff68 402017ac
3fffff40: 3fffff60 00000065 3fffff68 4020161d
3fffff50: 4023b6ac 00000065 3ffe8641 00000521
3fffff60: 3ffe8641 00000001 3ffe863c 40100901
3fffff70: 3fffdad0 00000000 3ffee3e0 3ffee518
3fffff80: 3fffdad0 00000000 3ffee348 402016aa
3fffff90: feefeffe 00000000 3ffee4d8 402017dc
3fffffa0: feefeffe feefeffe feefeffe 40202ebc
3fffffb0: feefeffe feefeffe 3ffe84e4 40100bf9
<<<stack<<<
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
ets Jan 8 2013,rst cause:1, boot mode:(3,6)
load 0x4010f000, len 3584, room 16
tail 0
chksum 0xb0
csum 0xb0
v2843a5ac
here is my project
B4X:
#Region Project Attributes
#AutoFlushLogs: True
#CheckArrayBounds: True
#StackBufferSize: 600
#End Region
Sub Process_Globals
Public Serial1 As Serial
Public WiFi As ESP8266WiFi
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
ConnectToNetwork
End Sub
Public Sub ConnectToNetwork
Log("ConnectToNetwork")
Dim SSID As String = "TEST"
Dim Password As String = "TEST123456789"
Log("Trying to connect to: ", SSID, " password: ", Password)
If WiFi.Connect2(SSID, Password) Then
Log("Connected successfully to: ", SSID)
Log("Local IP: ", WiFi.LocalIp)
RunNative("SetSTA", Null)
Else
Log("Failed to connect.")
End If
End Sub
#if C
void SetSTA(B4R::Object* o) {
WiFi.mode(WIFI_STA);
}
#End If
please anyone help me!
thanks!