This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Datetime/RTC example

Hi,

Are there any examples utilizing the nRF9160 RTC? I want to timestamp my data that I send to the cloud because my use-case involves queuing up data for extended periods of time (a few hours) and then sending it all at once. It would be nice if I could timestamp the data with actual timestamps instead of just milliseconds since boot. What are my options for this?

Thanks

Parents Reply
  • Hi Hakon,

    Maybe this is a separate issue but even when accounting for the timezone difference from CCLK, it is still inaccurate unless it has been set properly. I expected it to automatically get the correct time from the cellular network but it looks like it doesn't do that.

    What I ended up doing is using this sample to get the time using NTP, which I then use to set the modem RTC with AT+CCLK=___. Then I was able to get accurate timestamps from the AT+CCLK? command.

Children
Related