   wifi_set_phy_mode(PHY_MODE_11N);
   //wifi_set_channel(channel);
 
-  //WiFiClient::setLocalPortStart(micros());
+  //sslclient::setLocalPortStart(micros());
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
   WiFi.hostname("esp-swtemp");

      syslogPayload += lightoffmin;
      sendUdpSyslog(syslogPayload);
    }
  }  
}

void setup() {

  }
}

bool verifytls()
{
  Serial.print("[MQTT] tls connecting to ");
  Serial.println(mqtt_server);
  if (!sslclient.connect(mqtt_server, 8883))
  {
    Serial.println("[MQTT] tls connection failed");
    return false;
  }

  if (sslclient.verify(MQTT_FINGERPRINT, MQTT_SERVER_CN))
  {
    Serial.println("[MQTT] tls certificate matches");
    sslclient.stop();
    return true;
  }
  else
  {
    Serial.println("[MQTT] tls certificate doesn't match");
    sslclient.stop();
    return false;
  }
}

boolean reconnect() {
  if (!client.connected())
  {
    if (verifytls())
    {
      if (client.connect((char*) clientName.c_str(), MQTT_USER, MQTT_PASS, willTopic, 0, true, willMessage)) {
        client.publish(willTopic, "1", true);
        if ( ResetInfo == LOW) {
          client.publish(hellotopic, (char*) getResetInfo.c_str());
          ResetInfo = HIGH;
        } else {
          client.publish(hellotopic, "hello again 1 from switch");
        }

        client.loop();
        for (int i = 0; i < 3; ++i) {
          client.subscribe(substopic[i]);
          client.loop();
        }

        if (DEBUG_PRINT) {
          sendUdpSyslog("---> mqttconnected");
        }
      } else {
        if (DEBUG_PRINT) {
          syslogPayload = "failed, rc=";
          syslogPayload += client.state();
          sendUdpSyslog(syslogPayload);
        }
      }
    }
  }
