The use of the ESP8266 in the world of IoT

User avatar
By Momo06
#70489 Hi,

I m doing an IOT thermostat.

Code: Select allWiFiServer server(80);

void setup()
{
  initHardware();
  setupWiFi();
  server.begin();
}

void loop()
{
  thermostat();
  // Check if a client has connected
  WiFiClient client = server.available();
  if (!client) {
    return;
  }
....
}

void thermostat(){
//checking if the actual temperature is not higher than the temperature sets by the user. If so, heating start through a rele
}



I would like to update temperature value while there is no client connected. I make a thermostat() function called in the loop before creating WifiClient object. But the AP wifi doesn t show up or it s impossible to get connected to it.

I checked over the internet during hours whitout success.
I could called thermostat() function in setup and doing a ESP.reset() when there is no client connected but it s so dirty.
Any held would be appreciate

Thanks

Morgan