2 Replies Latest reply on Nov 26, 2015 8:47 AM by s89

    Clock resets after power off?

    s89

      I’m using Edison to log data in a prototype that’s deployed without an internet connection. The device is turned off during the night. Now that I’m reading out the logged data, it seems like all sessions start at the same time: November 9, 17:08, continuing up to different end times. This may well have been the last time the Edison had an internet connection, so my hypotheses right now are:

       

      (A) The internal clock doesn’t continue when the device is powered off (using the ON/OFF switch on the SparkFun Battery Block). This seems to be why there is a V_VBAT_BKUP pin mentioned in the Hardware Guide; the Battery Block (schematic) doesn’t seem to connect to this pin.

      (B) The internal clock resets when powered on again. The reset time seems to be the last NTP sync time, and not the last time recorded when it was turned on.

       

      I’ve got three questions:

       

      1. Is this right?

      2. What can I do about it in the future? E.g., connecting to V_VBAT_BKUP using the Battery Block, turning off NTP sync. Right now my plan is to assign subsequent IDs to each session, so that I at least know in which order they were created.

      3. Each session has a separate log file. Right now I can’t verify the order in which these were created. Each file is an sqlite3 database. Is there a way to still make a good guess about the order in which the already recorded logs were created?

        • 1. Re: Clock resets after power off?
          Intel_Alvarado

          Hi,

           

          Yes, the clock stops working if the Edison is turned off. In order to have the clock working while the Edison is powered off you need to power V_VBAT_BKUP. According to the Hardware guide you should connect an external power source to pin 23. The voltage and ampere values are programmable. The default settings are 2.5V/10uA. You can see a discussion about that here I need "V_VBAT_BKUP" pin specification . When the RTC is being powered I don’t see the need to have NTP enabled, try turning it off.

           

          As for the log files, I’m not sure if there are some kind of timestamps that can help you tell the order of creation of the file. Take a look here SQLite Query Language: Date And Time Functions . Hopefully you find this useful.

           

          Sergio

          1 of 1 people found this helpful
          • 2. Re: Clock resets after power off?
            s89

            Thank you Sergio. It seems the SparkFun blocks don’t break out or connect to pin 23, I don’t have an Intel breakout board and soldering to the header appears risky. So I’ll try to have the prototype fully powered continuously during next deployment. For accidental power loss I’ll see whether disabling NTP or regularly setting the hwclock helps.