       delay (1);
     }
   }
+  delay (10);
   return otaSuccessVal;
 }
 

void setupOTA() {
  // Start up OTA
  // ArduinoOTA.setPort(8266); // Port defaults to 8266
  ArduinoOTA.setHostname(mqttNode.c_str()); // Hostname defaults to esp8266-[ChipID]
  ArduinoOTA.setPassword(otaPassword); // No authentication by default

  ArduinoOTA.onStart([]() {
    debugPrintln("OTA update start");
  });
  ArduinoOTA.onEnd([]() {
    debugPrintln("\nOTA update complete");
  });
  ArduinoOTA.onProgress([](unsigned int
  , unsigned int total) {
    //Serial.printf("Progress: %u%%\r", (progress / (total / 100)));
  });
  ArduinoOTA.onError([](ota_error_t error) {
    debugPrint("OTA Error: " + String(error));
    if (error == OTA_AUTH_ERROR) debugPrintln(" Auth Failed");
    else if (error == OTA_BEGIN_ERROR) debugPrintln(" Begin Failed");
    else if (error == OTA_CONNECT_ERROR) debugPrintln(" Connect Failed");
    else if (error == OTA_RECEIVE_ERROR) debugPrintln(" Receive Failed");
    else if (error == OTA_END_ERROR) debugPrintln(" End Failed");
  });
  ArduinoOTA.begin();
  debugPrintln("OTA firmware update ready");
}

////////////////////////////////////////////////////////////////////////////////////////////////////

  }
  // Catch 0x1A error, possibly from .val query against things that might not support that request
  if (nextionReturnBuffer[0] == 0x1A) {
    // 0x1A+End
    // ERROR: Variable name invalid
    // We'll be triggering this a lot due to requesting .val on every component that sends us a Touch Off
    // Just reset mqttGetSubtopic and move on with life.
    mqttGetSubtopic = "";
  }
}

////////////////////////////////////////////////////////////////////////////////////////////////////
