Chat freely about anything...

User avatar
By dataguy
#72781 I've just made a small webserver project which serves an html page (duh) and takes some input via post. All works well and functions correctly. However, on monitoring the wifi signals it appears that the esp is transmitting all the time. No other wifi connected devices show up on the scan apart from the router. Current consumption is fairly high ~ 70mA or so.

Any pointers or info much appreciated.

Best Regards

Dataguy


The main loop is simply :-

void loop() {
server.handleClient(); // Listen for HTTP requests from clients
}

and the basic wifi stuff is :-

WiFi.config(ip, gateway, subnet); //set static ip here - according to webpage should be OK with just ip address but will not compile.
WiFi.begin(ssid, password);

// check for connection etc here

Serial.print("Connected to ");
Serial.println(WiFi.SSID()); // Network connected to


//now start the webpage server
server.on("/", HTTP_GET, handleRoot); // Call the 'handleRoot' function when a client requests URI "/"
server.on("/upd", HTTP_POST, handleupd); // Call the 'upd' function when a POST request is made to URI "/upd"
server.onNotFound(handleNotFound); // When a client requests an unknown URI (i.e. something other than "/"), call function "handleNotFound"

server.begin(); // Actually start the server
User avatar
By dataguy
#72877 Ok I have finally sorted it. Added :-

WiFi.mode(WIFI_STA); // Station mode only

Looks like the default is Station mode and Access point.

This has reduced the current from 80mA to 24mA, and hidden the device from casual wifi scanning.

Best Regards

dataguy