-
Notifications
You must be signed in to change notification settings - Fork 725
sync clock and time commands will fail on repeater if repeaters clock is in future #1332
Copy link
Copy link
Open
Description
How ever this could happen ... if repeaters clock gone in future time, you will not be able to correct this without cutting of power-suply including battery and solar-power. The firmware doesn't accept to correct the clock backwards.
I suggest to apply the following change in the firmware - file CommonCLI.cpp ...
} else if (memcmp(command, "time ", 5) == 0) { // set time (to epoch seconds)
uint32_t secs = _atoi(&command[5]);
uint32_t curr = getRTCClock()->getCurrentTime();
if (secs > curr) {
getRTCClock()->setCurrentTime(secs);
uint32_t now = getRTCClock()->getCurrentTime();
DateTime dt = DateTime(now);
sprintf(reply, "OK - clock set: %02d:%02d - %d/%d/%d UTC", dt.hour(), dt.minute(), dt.day(), dt.month(), dt.yea>
} else if (secs == 0) {
getRTCClock()->setCurrentTime(1767225600);
uint32_t now = getRTCClock()->getCurrentTime();
DateTime dt = DateTime(now);
sprintf(reply, "OK - clock RESET: %02d:%02d - %d/%d/%d UTC", dt.hour(), dt.minute(), dt.day(), dt.month(), dt.y>
} else {
strcpy(reply, "(ERR: clock cannot go backwards)");
}
after this change admins can reset repeaters clock by sending time 0 as a command to a epoch-time in past.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels