 
 _config wmConfig;
 
-unsigned long mqttReconnectTime = 0;
-unsigned long staReconnectTime = 0;
-unsigned long ntpReconnectTime = 0;
+unsigned long mqttReconnectDelay = 0;
+unsigned long staReconnectDelay = 0;
+unsigned long ntpReconnectDelay = 0;
 time_t timeStart;
 
 /* If EXT_POWER_CONTROL is false and pin A0 should be not connected to anything */

  else mqttRestart = true;

  /* reconnect to mqqt broker one time in 10 sec. */
  if (mqttRestart && mqttReconnectTime+10000 < millis()) {
    if (staModeNow && WiFi.status() == WL_CONNECTED) {
      mqttClient.disconnect();
      mqttReconnect();
      printMqttState();
    }
    mqttReconnectTime = millis();
  }

  if (!offWiFi && wmConfig.apMode && !apModeNow && !staModeNow) {

  }

  /* checking connect to WiFi network one time in 30 sec */
  if (!offWiFi && !wmConfig.apMode && staConfigure && staReconnectDelay+30000 < millis() && 
         ((apModeNow || (staModeNow && WiFi.status() != WL_CONNECTED)) || (!apModeNow && !staModeNow))) {
    staReconnectDelay = millis();
    if (DEBUG) Serial.printf("Check WiFi network: %s\n", wmConfig.staSsid);
    int n = WiFi.scanNetworks(); 
    if (n != 0) {
