Important is this line:
WiFi.config(INADDR_NONE, INADDR_NONE, INADDR_NONE);
which seems to reset the settings. My ESP32 showed up as "Espressif"
WiFi.config(INADDR_NONE, INADDR_NONE, INADDR_NONE);
which seems to reset the settings. My ESP32 showed up as "Espressif"
B4X:
Private Sub SetHostName
Dim bb() As Byte = "TheHostname"
RunNative("SetHostName", bb)
End Sub
#if C
void SetHostName(B4R::Object* o) {
B4R::Array* b = (B4R::Array*)B4R::Object::toPointer(o);
char* c = (char*)b->data;
[B]WiFi.config(INADDR_NONE, INADDR_NONE, INADDR_NONE);
WiFi.setHostname( c );[/B]
}
#end if