[ad_1]
I need to create a webServer with esp32 as AP. Now the problem is that the ESP32 gives a
ESSID not the IP handle.
Here is my code
#embody <ESPAsyncWebServer.h>
#embody <SPIFFSEditor.h>
// #embody <LiquidCrystal_I2C.h>
#embody <WiFi.h>
#embody <WiFiAP.h>
// LiquidCrystal_I2C liquid crystal display(0x27, 16, 2);
AsyncWebServer server(80);
const char* ssid = "ESP-NAS";
const char* password = "NAS26672";
void setup() {
// liquid crystal display.init();
// liquid crystal display.backlight();
// liquid crystal display.setCursor(0, 0);
Serial.start(115200);
Serial.println();
Serial.println("Configuring entry level...");
// You possibly can take away the password parameter if you need the AP to be open.
// a legitimate password should have greater than 7 characters
if (!WiFi.softAP(ssid, password)) {
log_e("Mushy AP creation failed.");
whereas (1);
}
IPAddress myIP = WiFi.softAPIP();
Serial.print("AP IP handle: ");
Serial.println(myIP);
// liquid crystal display.print(ssid);
// liquid crystal display.setCursor(0, 1);
// liquid crystal display.print(myIP);
delay(500);
server.on("/",HTTP_ANY,[](AsyncWebServerRequest *req)
{
req->send_P(200,"plain/textual content","Hink");
});
}
void loop() {
}
I can connect with the WiFi however there’s no assigned IP handle.
!
[ad_2]