Skip to content

NTP time was wrong #32

Closed
Closed

Description

@yangh

In the SetWIFI app, connect to a WIFI, then the time received from NTP was wrong:

I (33703) example: Boot count: 1
I (33705) example: The current date/time in New York is: Mon Jan 28 00:36:05 2036
I (33705) example: The current date/time in Shanghai is: Mon Jan 28 13:36:05 2036
I (33731) wifi:state: run -> init (0)
I (33732) wifi:pm stop, total sleep time: 1668823 us / 3087396 us

The NTP server pool.ntp.org works fine for Linux

ntpdate -q pool.ntp.org
2026-01-15 11:52:56.470801 (+0800) +0.585304 +/- 0.664114 pool.ntp.org 185.209.85.222 s2 no-leap

Why it doesn't work for Cardputer?

Thanks

Activity

  1. Forairaaaaa commented on Jul 17, 2026

    @Forairaaaaa
    Contributor

    Thanks. From this log, SNTP does not appear to have started. The current code only requests NTP time when the existing system year is earlier than 2016. Since the device already reported 2036, synchronization was skipped:
    https://github.com/m5stack/M5Cardputer-UserDemo/blob/main/main/apps/utils/sntp_wrap/sntp_wrap.c#L67-L76

    Please fully power-cycle the device, retry with the latest firmware, and provide the complete serial log including Initializing SNTP and the synchronization notification.

  2. Forairaaaaa commented on Nov 5, 2026

    @Forairaaaaa
    Contributor

    Thanks for reporting! The fixes have been merged into both main and CardputerADV.

    Time synchronization now relies on actual SNTP completion rather than the existing clock date. The original Cardputer firmware also retries synchronization when SetWiFi connects and reports a failure if it times out.

    Please rebuild from the latest branch for your device. Closing as fixed; if the issue persists, please reopen with the complete serial log.

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

Metadata

Metadata

Assignees

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