Skip to content

sync clock and time commands will fail on repeater if repeaters clock is in future #1332

Closed as not planned

Description

@do6uk

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.

Activity

  1. IoTThinks commented on Jan 9, 2026

    @IoTThinks
    Contributor

    Let me test your code.
    I have "clock fsync" to force the timesync.

    I'm thinking to let repeater to sync time from companions.

  2. do6uk commented on Jan 10, 2026

    @do6uk
    Author

    That sounds also nice. I just added this few lines quick and dirty - a special command would be fine.

  3. csrutil commented on Jan 10, 2026

    @csrutil
    SponsorContributor

    See #1326

  4. themelisx commented on Feb 14, 2026

    @themelisx

    Let me test your code. I have "clock fsync" to force the timesync.

    I'm thinking to let repeater to sync time from companions.

    This does not work to esp32-s3 cause soft reboot will keep the clock.
    You need to send the command "clkreboot" and then "clock sync".

    In any case it's annoying to cannot set time backwards.

  5. PeterAlfonsLoch commented on Feb 23, 2026

    @PeterAlfonsLoch

    Let me test your code. I have "clock fsync" to force the timesync.
    I'm thinking to let repeater to sync time from companions.

    This does not work to esp32-s3 cause soft reboot will keep the clock. You need to send the command "clkreboot" and then "clock sync".

    In any case it's annoying to cannot set time backwards.

    This is really helpful, Thank you.

  6. IoTThinks commented on Feb 24, 2026

    @IoTThinks
    Contributor

    You can try CLI clkreboot and click sync again.

    clock fsync is only valid in my variant PowerSaving 11 and 12.
    clkreboot was added so I dont put in PowerSaving 13.
    In new PR1687, much less timedrift.

  7. weebl2000 commented on Feb 27, 2026

    @weebl2000
    Contributor

    See #1349

  8. github-actions commented on Jul 10, 2026

    @github-actions
    Contributor

    This issue is stale because it has been open for 60 days with no activity. Remove the stale label or add a comment if this issue is still relevant, otherwise this issue will automatically close in 7 days.

  9. github-actions commented on Aug 30, 2026

    @github-actions
    Contributor

    This issue was closed because it has been inactive for 7 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions