B4R Question ESP32 change ip address

Jpiti

Member
Licensed User
Longtime User
Hello,
I have no idea why the ip address from the esp32 is not changed.
here is a code snippet:

B4X:
Private Sub AppStart
    Serial1.Initialize(115200)
    Log("AppStart Version 1.0")
    WiFi.StartAccessPoint2("ssid","password")
    RunNative( "SetIP" , Null )
    SDcard.Initialize(5)
    server.Initialize(80, "server_NewConnection")
    server.Listen
    Log(WiFi.AccessPointIp)
End Sub

#if C
  void SetIP(B4R::Object* o) {
  IPAddress ip(192, 168, 123, 1); 
  IPAddress gateway(192, 168, 123, 1);
  IPAddress subnet(255, 255, 255, 0);
   WiFi.config(ip, gateway, subnet);
  }
  #end if

Log(Wifi.AccessPointIp) returns 192.168.4.1 wich is it the standart IP for ESP32.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…