Managing date/time [clock] on offline devices

Hi. I’m using a Core in a remote location - no cell service, no wifi. When I get to the location, I connected everything up [probably hit the reset button on the Core], and the clock on my device went back to December 1969.

Is there any way to update the date/time using a USB cable & CLI? Or more broadly phrased, how do I manage time on an offline device after it gets reset, and what other events (ie dead battery) might cause a date/time reset?

Yes, I’m new at this, this is my first post, and I really hope this question isn’t dumb.

Thanks
David

you can do it via serial using setTime().

Thanks. By serial you mean using the USB cable & CLI? If not, I could use a few more keywords to point me in the right direction. I’ve used serial to get information from the Core - for debugging - but I’m not seeing how to execute commands like setTime().

Since the Core doesn't feature a battery buffered RTC and Backup RAM everything that clears the RAM will also cause the RTC to reset.

  • HW reset
  • SW reset
  • deep sleep
  • power outage
  • ...

USB yes (most comfortably), CLI no.
While you can use the RX/TX lines instead of USB for serial communication, USB is usually the simplest.
And you can use any serial terminal program that can access the virtual serial port via USB (e.g. PuTTY, TeraTerm, ...)

Thanks. I found the Serial tutorial post and I can get connected now, but it seems I’m limited to entering a small set of single characters, like ‘m’ to get MAC address or ‘i’ for device ID. That works.

But I can’t figure out how to send any kind of commands, like setTime(). I tried Shell menu | New Command option but I’m hitting dead ends. I can’t find a tutorial for this stuff anywhere. Do I need to preface setTime() with something or wrap it in some other code?

Your code must do the reading, interpreting and applying of the serial data.

The singel-char commands only work in Listening Mode (blinking blue), but in your own code you can have commands as long as you wish.

oh that makes sense. I was thinking I could just send ad-hoc commands, like read/write pins and change the date/time, through the connection. Thank again.