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

    Serial.println(WIFI_SSID);

    //wifi_set_phy_mode(PHY_MODE_11N);
    WiFi.mode(WIFI_STA);
    WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
    WiFi.hostname("esp-bedroomlight");

  ArduinoOTA.setPassword(OTA_PASSWORD);
  ArduinoOTA.onStart([]() 
  { 
     //ticker.attach(0.1, tick); 
  });
  ArduinoOTA.onEnd([]() { });
  ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) { });
