RTC not keeping time #50

Closed
opened 2023-09-17 16:32:12 -05:00 by W1CDN · 14 comments
Owner

Not quite the same as #27.

On reboot, the time reported on the serial connection is sometimes out of date.

I spent a bunch of time on this at #24 (comment) and prior comments. It may be time to buy a better RTC and try that.

Ugh, this important if you want to run more than one transmitter at once.

Not quite the same as #27. On reboot, the time reported on the serial connection is sometimes out of date. I spent a bunch of time on this at https://amiok.net/gitea/W1CDN/vulpes/pulls/24#issuecomment-1240 and prior comments. It may be time to buy a better RTC and try that. Ugh, this important if you want to run more than one transmitter at once.
W1CDN added the
bug
hardware
labels 2023-09-17 16:32:13 -05:00
Author
Owner

"Sometimes" being the word. I can refresh the date using the webform, unplug the device for a few minutes, plug it back in, reboot on serial connection, and the time will be right (i.e., it will match the time it was rebooted, not the last time that was set using the webform).

Is the webform ever giving an old time? But still, it should keep counting. Maybe it keeps counting from an old time?

"Sometimes" being the word. I can refresh the date using the webform, unplug the device for a few minutes, plug it back in, reboot on serial connection, and the time will be right (i.e., it will match the time it was rebooted, not the last time that was set using the webform). Is the webform ever giving an old time? But still, it should keep counting. Maybe it keeps counting from an old time?
Author
Owner
These seem interesting: - https://forum.arduino.cc/t/ds3231-time-not-increasing/459796/2 - https://forum.arduino.cc/t/ds3231-time-not-increasing/459796/12
Author
Owner

Still counting time.

Still counting time.
Author
Owner

Still counting time...

I've been plugging in to serial monitor but not refreshing web page, to check the RTC time on boot.

Still counting time... I've been plugging in to serial monitor but not refreshing web page, to check the RTC time on boot.
Author
Owner

Still counting time, made it overnight.

One thought I had is that I don't know if shorting any of the pins (if board powered off and RTC on battery) causes anything weird to happen. I've set this board on my metal MBP lid before without insulation.

Still counting time, made it overnight. One thought I had is that I don't know if shorting any of the pins (if board powered off and RTC on battery) causes anything weird to happen. I've set this board on my metal MBP lid before without insulation.
Author
Owner

Hey, this is interesting, but does it apply here?

The datasheet reccomends a delay before setting: “Communication with the I²C should be held off at least for the first 2 seconds after a valid power source has been established. It is during the first 2 seconds after power is established that the accurate RTC starts its oscillator, recalls calibration codes, initiates a temperature sensor read, and applies a frequency correction.” https://thecavepearlproject.org/2014/05/21/using-a-cheap-3-ds3231-rtc-at24c32-eeprom-from-ebay/

Hey, this is interesting, but does it apply here? > The datasheet reccomends a delay before setting: “Communication with the I²C should be held off at least for the first 2 seconds after a valid power source has been established. It is during the first 2 seconds after power is established that the accurate RTC starts its oscillator, recalls calibration codes, initiates a temperature sensor read, and applies a frequency correction.” https://thecavepearlproject.org/2014/05/21/using-a-cheap-3-ds3231-rtc-at24c32-eeprom-from-ebay/
Author
Owner

Added delay(2000); before reporting RTC time on boot.

Added `delay(2000);` before reporting RTC time on boot.
Author
Owner

Set this for 20:30 CDT (should be 01:30 UTC), it came on at 15:30 CDT.
image

Checked the time with serial on reboot, it is correct: 20:30 UTC (15:30 CDT).

Does this mean I added a timezone problem somewhere?

The 20:30 CDT entered on the webform should have translated to 1:30 UTC (the next day), but serial reports that the alarm was set for 20:30.

Set this for 20:30 CDT (should be 01:30 UTC), it came on at 15:30 CDT. ![image](/attachments/36733b4d-5319-4d99-b873-d72f905ba48b) Checked the time with serial on reboot, it is correct: 20:30 UTC (15:30 CDT). Does this mean I added a timezone problem somewhere? The 20:30 CDT entered on the webform should have translated to 1:30 UTC (the next day), but serial reports that the alarm was set for 20:30.
4.1 KiB
Author
Owner

image
Alarm 1 set for at 21:05:00 Fri, 19 May 2000 (only HH:MM:SS day-of-month are accurate)

This started up on schedule.

Maybe something weird if you go over the UTC day?

![image](/attachments/54029555-229b-408f-ab4e-321e2ebb3ce5) `Alarm 1 set for at 21:05:00 Fri, 19 May 2000 (only HH:MM:SS day-of-month are accurate)` This started up on schedule. Maybe something weird if you go over the UTC day?
Author
Owner

image
Alarm 1 set for at 02:10:00 Sat, 20 May 2000 (only HH:MM:SS day-of-month are accurate)

It did not start at 16:10 CDT. This is correct, but also confusing.

Noting that only HH:MM:SS and day-of-month are used by the RTC alarm might still be important.

![image](/attachments/bcd98a6f-c4d8-4631-a0c1-935b41f1e269) `Alarm 1 set for at 02:10:00 Sat, 20 May 2000 (only HH:MM:SS day-of-month are accurate)` It did *not* start at 16:10 CDT. This is correct, but also confusing. Noting that only HH:MM:SS and day-of-month are used by the RTC alarm might still be important.
Author
Owner

There it is. I put this handy thing at the top, and it's showing UTC, not local time:
image

EDIT: But only on Windows! This is what I see on macOS:
image

This is the same thing I see on Node-RED with a time-series plot. On macOS and Android, the time is local, but on Windows (checked two machines) it is UTC.

All Firefox.

There it is. I put this handy thing at the top, and it's showing UTC, not local time: ![image](/attachments/fde1cc4a-4302-4b4a-9918-1d64a2d36ad6) EDIT: But only on Windows! This is what I see on macOS: ![image](/attachments/1996bf30-1b85-4b00-a548-924e147d0bb2) This is the same thing I see on Node-RED with a time-series plot. On macOS and Android, the time is local, but on Windows (checked two machines) it is UTC. All Firefox.
Author
Owner

I think it is this: https://superuser.com/a/1777971

One setting you can check in about:config does affect the time zone which gets reported to web sites: if privacy.resistfingerprinting is set to true, then Firefox will always report UTC to avoid leaking information about you that could be used to generate a unique fingerprint and let web sites track you even without cookies.

If I switch it to false on Windows, it shows local time.

If I switch it to true on Mac, it shows UTC.

I think it is this: https://superuser.com/a/1777971 > One setting you can check in about:config does affect the time zone which gets reported to web sites: if privacy.resistfingerprinting is set to true, then Firefox will always report UTC to avoid leaking information about you that could be used to generate a unique fingerprint and let web sites track you even without cookies. If I switch it to `false` on Windows, it shows local time. If I switch it to `true` on Mac, it shows UTC.
Contributor

It's been unplugged for over a day, plugged in and the time is correct.

It's been unplugged for over a day, plugged in and the time is correct.
W1CDN closed this issue 2023-09-25 21:14:58 -05:00
Author
Owner

Checked after several days, time is still fine. If/when I build more, will have to see if the charging circuit removal is needed or not.

Checked after several days, time is still fine. If/when I build more, will have to see if the charging circuit removal is needed or not.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: W1CDN/vulpes#50
No description provided.