Hi all of you.
I have an esp8266 and used this code.
+------------------------------------------------------------------
Sub Process_Globals
Public Serial1 As Serial
Private wifi As ESP8266WiFi
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
'example of connecting to a local network
If wifi.Connect2("PHOENIX", "1Harrypotter!") Then
Log("Connected to network")
Log(wifi.LocalIp)
Else
Log("Failed to connect to network")
End If
End Sub
+-------------------------------------------------------------
my esp8266 can receive an IP but It is cut off immediately.
i tested your basic code on my esp8266 and it is working well with board selected "Generic ESP8266 Module"
B4X:
Sub Process_Globals
Public Serial1 As Serial
Private wifi As ESP8266WiFi
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
'example of connecting to a local network
If wifi.Connect2("xxxx", "xxxxxxxxxxxx") Then
Log("Connected to network")
Log(wifi.LocalIp)
CallSubPlus("test",5000,0)
Else
Log("Failed to connect to network")
End If
End Sub
Sub test(tag As Byte)
Log(wifi.LocalIp)
CallSubPlus("test",5000,0)
End Sub