#include const char* ssid = "TIM"; const char* password = "mypass"; WiFiServer server(80); void setup() { Serial.begin(115200); Serial.println(); Serial.printf("Connecting to %s ", ssid); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(" connected"); server.begin(); Serial.printf("Web server started, open %s in a web browser\n", WiFi.localIP().toString().c_str()); } // prepare a web page to be send to a client (web browser) String prepareHtmlPage() { String htmlPage = String("HTTP/1.1 200 OK\r\n") + "Content-Type: text/html\r\n" + "Connection: close\r\n" + // the connection will be closed after completion of the response "Refresh: 5\r\n" + // refresh the page automatically every 5 sec "\r\n" + "" + "" + "Analog input: " + String(analogRead(A0)) + "" + "\r\n"; return htmlPage; } void loop() { WiFiClient client = server.available(); // wait for a client (web browser) to connect if (client) { Serial.println("\n[Client connected]"); while (client.connected()) { // read line by line what the client (web browser) is requesting if (client.available()) { String line = client.readStringUntil('\r'); Serial.print(line); // wait for end of client's request, that is marked with an empty line if (line.length() == 1 && line[0] == '\n') { client.println(prepareHtmlPage()); break; } } } delay(1); // give the web browser time to receive the data // close the connection: client.stop(); Serial.println("[Client disonnected]"); } } terminal output using OPERA: ................................................................................................................................ [Client connected] GET / HTTP/1.1 Host: 192.168.1.241 Connection: keep-alive Cache-Control: max-age=0 Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36 OPR/63.0.3368.107 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 Accept-Encoding: gzip, deflate Accept-Language: it-IT,it;q=0.9,en-US;q=0.8,en;q=0.7 [Client disonnected] [Client connected] ............................................................................................................................... The systems locks up for about one minute then it shows : [Client disonnected] and becomes ready for a new request. The page is NOT refreshed every 5 secs. terminal output using EDGE: ............................................................................................................................... [Client connected] GET / HTTP/1.1 Cache-Control: max-age=0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3 Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/18.17763 Accept-Encoding: gzip, deflate Host: 192.168.1.241 DNT: 1 Connection: Keep-Alive [Client disonnected] ............................................................................................................................... The system does not lock up and the page is refreshed every 5 secs correctly. terminal output using CHROME: .............................................................................................................................. [Client connected] GET / HTTP/1.1 Host: 192.168.1.241 Connection: keep-alive Cache-Control: max-age=0 Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3 Accept-Encoding: gzip, deflate Accept-Language: it-IT,it;q=0.9,en-US;q=0.8,en;q=0.7 [Client disonnected] [Client connected] .............................................................................................................................. The systems locks up for about one minute then it shows : [Client disonnected] and becomes ready for a new request. The page is NOT refreshed every 5 secs. Using FIEFOX : the browser replies saying there is an error loading the page !!!