B4R Question My esp8266 recive an IP but It is cut off immediately

vali khandangoll

Active Member
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.
 

candide

Active Member
Licensed User
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
 
Upvote 0

rbghongade

Active Member
Licensed User
Longtime User
Hi, it could be the ESP8266 Arduino core issue. I faced the same , but long back, please check the core version.
 
Upvote 0
Top