Sync Time offline - RTC



  • Hello,

    In my project I need to get the current time, but based on my application the following solutions are not applicable:

    • Connecting the FiPy to the internet to sync the RTC with the NTP server.
    • Adding an external back up battery.
    • Setting the time manually on each power-up.

    So, based on these conditions, how can I sync the RTC?

    Thank you.



  • @Miguel-Moreno Thanks a lot!
    Indeed currently I am syncing the RTC with the NTP server by connecting the FiPy to the internet. But sometimes I am in places with no coverage (I connected it to my phone's hotspot), and since my application is to scan for WiFi and Bluetooth outside, the internet is not always available. That's why I need to get the current time offline and not to be hard coded.



  • @jcaron The FiPy is powered by a power bank battery, and it should be active the whole time since I need to scan for a whole day for Bluetooth and WiFi (The FiPy is not fixed, it should be with me wherever I go to scan).



  • @livius said in Sync Time offline - RTC:

    maybe you can use DCF77 signal.

    Or one of the many many other radio broadcasts of the current time: https://en.wikipedia.org/wiki/Radio_clock



  • @Jana-Koteich is your device powered externally (so you can keep it active the whole time) or battery-powered (so you need deep sleep)? What kind of precision do you need?



  • Hello @Jana-Koteich .

    Why would you NOT use the internet to sync the RTC with an NTP server ? ...

    If you have a FiPy, then your device is capable ( and sort of intended/expected ) to connect to the Internet.

    If definitely you plan to use the FiPy in completely isolated mode ( no external connectivity whatsoever ) then your only choice is to add an external battery-backed standalone RTC module and poll it from the FiPy every time it powers on to update the internal RTC.

    There are plenty of choices out there "of-the-shelf" RTC solutions, such as these quick examples:

    Both of these samples include MicroPython libraries ( in CircuitPython, to be precise ) ... so it should be almost straightforward to use them with your FiPy.



  • @Jana-Koteich
    I see two possibilities:

    1. Use GPS module to retrive current time.
    2. I do not know your location, but maybe you can use DCF77 signal.

Log in to reply
 

Pycom on Twitter