OTA Update Problem Due To Alarm.delay(1000); from ESP8266TimeAlarms.h

I have purposely titled this the same as this topic:
https://forum.arduino.cc/t/ota-udate-problem-due-to-delay-function/695925

In this topic the solution was to use the delay function as shown:

uint32_t moment = millis();
while (millis() - moment < 200) {
  ArduinoOTA.handle();
  yield();
}

But for me this will not work as my code needs this:

void loop()
{
   Alarm.delay(1000); // wait one second between clock display
   ArduinoOTA.handle();
}

Where the Alarm.delay(1000); where it must be one second (I learned the hard way through many hours of seaching that it must be at least 1 second) which is too long for ArduinoOTA.handle(); to work.

If I use 100ms then ArduinoOTA will work but the Alarm.delay works erratically (which consumed many hours of messing around)

Then i tried this:

void loop()
{
  int del;
  for (del = 0; del <= 10; del++)
  {
    ArduinoOTA.handle();
    Alarm.delayOTA(100); 
  }
}

But OTA will not work. Even if I reduce Alarm.delay to 10ms and increase the loop count to 100 it still does not work.

So how do I solve this?

Hello

Try increase OTA timeout

Thank you for your reply guix. I have googled this and I am not able to figure out how to do this. Could you provide details of how to do this?

Thank you.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.