RTC initialisation



  • Hi.
    I am using LoPy4 & FiPy in a remote environmental monitoring/alarm application.
    I have a desire to set up the RTC (only needs accuracy within a few seconds) to time stamp various events and to assist with timing of various activities during deepsleep (reading and comparison of stored time after coming out of deepsleep).

    I need to be able to use LoRaWAN, SigFox or NB-IoT. Only one of these networks will be connected for a specific installation.
    The end product has no user interface, so it is not possible for a human to set the intitial time within the RTC. I need the RTC to be automatically initialised by my application code after powerup.

    As the equipment is solar/battery powered, it theoretically never powers down. So once the RTC is set, it will need to maintain time for long periods (maybe with a synchronisation adjustment every week/month).

    What is the best way to initialise the RTC value? I do not have WiFi, so connection to the internet to obtain time from a traditional NTP service is not practical.

    Is there some way to extract time from the metadata used for LoRaWAN, Sigfox and NB-IoT? If so, are there library functions in MicroPython that make this easy to achieve?

    Any assistance would be greatly appreciated.

    Peter.



  • @tuftec
    In fact, lorawan callback in the network operator that i have used (objenious and orange) doesn't allow dynamic downlink data setup via callback service. I have to prepare the downlink data and when (even several hours/day later) the device send an uplink message the downlink data is send to the device.

    So, if you know the periodicity of your uplink frame you can predict the time to send to your device on his next uplink frame and set your operator downlink frame in advance.

    With Sigfox, when the device send an uplink frame with download request bit (by device choice) set, there 2 choices
    -default call back method can send back to the device network time and some static data
    -you have 20 secondes to send back from your device (from your own callback service) some data and time.

    With NB-IOT , network time availability is not mandatory so it depend of your network provider.



  • @eric73 thanks for that. I will do a bit more research.
    I guess if using LoRaWAN I may have to build some sort of crude time serving function into my application. I only need to have the time accurate to the minute mark. A simple time serving function, would probably work for me across all network connections that I plan to use.



  • @tuftec
    Hello, in fact with Sigfox you can obtain a valid time indication by the callback service. You have to send a Sigfox Downlink request from your card and in your callback service you have to set the {time} answer. LoRaWan currently, doesn't offer this service.
    Once your device have receive it's time indication (confirmed by your software sending another uplink frame) you have to move your sigfox device type to another device type or change your callback service to send another data.


 

Pycom on Twitter