#include #include #include const char* ssid = "FabLabNet"; const char* password = "password9"; WiFiServer server(80); void setup() { Serial.begin(115200); delay(10); // Connect to the WiFi network Serial.println(); Serial.print("Connecting to "); Serial.println(ssid); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(""); Serial.println("WiFi connected"); Serial.println("IP address: "); Serial.println(WiFi.localIP()); // Create an Access Point WiFi.softAP("XiaoEsp32Network", "password"); // Start the server server.begin(); Serial.println("Server started"); } void loop() { WiFiClient client = server.available(); if (client) { Serial.println("New Client."); while (client.connected()) { if (client.available()) { String message = client.readStringUntil('\n'); Serial.print("Received message from client: "); Serial.println(message); } if (Serial.available()) { String message = Serial.readStringUntil('\n'); client.print(message); } } client.stop(); Serial.println("Client Disconnected."); } delay(100); }