       if (client.connected())
       {
          sendCheck();
-         client.loop();
       }
       lastRelayActionmillis = millis();
       bUpdated = false;


        client.subscribe(subscribe_topic);
        client.loop();
        Serial.println("[MQTT] mqtt connected");
        ticker.attach(1, tick);
      }
      else
      {
        Serial.print("[MQTT] mqtt failed, rc=");
        Serial.println(client.state());
        ticker.attach(0.5, tick);
      }
    }
  }

    receivedpayload += (char)inpayload[i];
  }

  parseMqttMsg(receivedpayload, receivedtopic);
}

bool verifytls()
{

  if (!sslclient.connect(mqtt_server, 8883))
  {
    return false;
  }

  if (sslclient.verify(MQTT_FINGERPRINT, MQTT_SERVER_CN))
  {
    sslclient.stop();
    return true;
  }
  else
  {
    sslclient.stop();
    return false;
  }
