Skip to content

For using timers, OTA doesn't work smooth #320

@andybrk

Description

@andybrk

If I define a timer like:

hw_timer_t * timer = NULL;
void StartTimer(void) {
timer = timerBegin(0, 80, true);
timerAttachInterrupt(timer, &timer100msec, true);
timerAlarmWrite(timer, 100000, true);
timerAlarmEnable(timer);
Serial.println("Timer started");
}

void StopTimer(void) {
timerDetachInterrupt(timer);
timerStop(timer);
timerAlarmDisable(timer);
timerEnd(timer);
timer = NULL;
Serial.println("Timer stopped");
}

and start the timer in the SW then the OTA upgrade works very stuttery and breaks often (no response). I have to repeat more times for successful OTA programming. Serial flashing is no problem. First I try the timer stop with the command "timerEnd(timer)" only and add one by one command. Nothing did help.

This doesn't help, too:

ArduinoOTA.onStart( {
String type;
StopTimer();
if (ArduinoOTA.getCommand() == U_FLASH)
type = "sketch";
else // U_SPIFFS
type = "filesystem";

Serial.println("Start updating " + type);

});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions