How to sync real-time clock with network-time on Telit modules


You can configure the Telit GM cellular modem to set its internal real-time clock to the network time and have this value automatically updated each time the module is powered on. Here are the AT commands that you need to issue (I’ve omitted the AT response codes):

AT#SELINT=2
AT#NITZ=7,0 // sync network time to internal clock
AT&P0 // profile to be loaded on startup
AT&W0 // store the complete profile
AT#SHDN // this will turn off the modem
// now power on the modem
AT+CCLK? // get current time
// time response is +CCLK: "09/06/29,15:25:32-28"
// time format is yy/MM/dd,hh:mm:ss±zz

The command AT#NITZ=7,0 on your specific modem may not work, check the range of valid inputs for this command using AT#NITZ=?. If you’ve an old module from sparkfun.com then AT#NITZ=? may return #NITZ:(0-1),(0-7). More recent firmwares return #NITZ:(0-7)(0,1). If you’ve an older firmware, then you should set the AT#NITZ=1,0. The difference is that with newer firmware, you will also get the time-zone zz, not so with the older firmware. If you set AT#NITZ=7,1, then when the module gets the network time it is supposed to be echoed as an unsolicited message on the serial port. This didn’t work in my tests. Just as well. In this case, I rather not deal with unsolicited messages for network time, since I can use the real-time clock to get the time when I want to (getting unsolicited messages for AT+CREG is valuable, however).

What do I mean by older firmware? The GM862 module that I bought from sparkfun.com has this firmware:

AT+CGMR
PS:5.02.203/AL:6.04.204-GM862 QUAD

The module that I purchased from SemiConductorStore has this firmware:

AT+CGMR
07.03.600

17 Responses to “How to sync real-time clock with network-time on Telit modules”

  1. rc Says:

    Shahram

    im also working with a gm862 and it seems as though some of my modules get reset and disconnected from the ATT/Jasper Wireless network
    after a couple of days ( i have a feeling its due to the large cap thats required on the output of the 3.8 LDO regulator) you mentioned that you placed a 100mF capacitor low esr and purchased it from DK, however i could not find a 100mF tant cap from DK, did you mean 100uF low esr 600m0hm instead?

    ————————————-
    Well I read this point about a low ESR capacitor in the Telit’s hardware guide and didn’t think much about it. I used a 100μF capacitor, but it was not tantalum nor was it low ESR, and guess what it didn’t work. First I thought that it was my battery, a 19AH 3.6V Lithium Ion battery from Jameco. But after reading this very informative forum entry, I learned that the capacitor was the problem.

    The only adequate capacitor that I had was a 1F (yes a monster 1F) capacitor from Sparkfun. I used this capcitor and after giving a few minutes for the capacitor to charge, the circuit worked and GM862 was able to register with the network.

    Well I thought it worked with the 1F capacitor, but the reason was that GM862 was connected via the USB in addition to the battery, and after it registered with the network, I disconnected from the USB and it was able to continue with the operation using the battery. But I’m unable to start GM862 with the battery.

    I’ve ordered a low ESR 100 mF Tantalum (with a 600 m Ohm ESR) from digikey – $7 each. I suspect that with this capacitor, I’ll be able to start the module with the battery.

    • Shahram Javey Says:

      Hi, The only way that I could reliably start GM862 modules is to use two super caps (10 F) in series.

      • rc Says:

        so what would happen to the gm862 when using the 100uf low esr caps? my modules power and status leds turn off and on some modules i hear a buzzing noise during network registration and my whole circuit resets, what kind of antenna are you using? its hard to believe that telit hasnt released any app note regarding this issue.

  2. Nazeem Says:

    This does not work on the gt863-py modem here is South Africa.

    Also the time is always reset to 0 when the power is turned off and back on. So how do I read or set the network time automatically each time the modem is started up?

    I used AT#NITZ=1,0, and the rest as original above commands.

    Any body got a solution?

  3. Shahram Javey Says:

    I’ve used both of the antennas that Sparkfun.com sells. Both work fine. Without the super-caps the Telit modem would not start or would fail to register. I’ve been able to start it with the rechargeable Lithium Ion (4.2 V) battery from sparkfun. But in our application a rechargeable battery is not going to be acceptable.

    To get the Network time you must use the AT+CCLK? command. In US on AT&T Network, I have had to use AT#NITZ=7,0 before hand for the AT+CCLK? to actually return the network time. I suspect that each network could be different in this regard.

  4. rc Says:

    sharam,

    where did you place your super caps, im assuming right on the output of your 3.8 regulator? what about any additional circuitry that you added for these super caps? did you do anything to limit the inrush current, when the modules ?

  5. rc Says:

    did you do anything to limit the inrush current with supercaps being involved.

  6. Shahram Javey Says:

    Hi rc, put the super-caps in series as close to the Telit modules 3.8 V and GND pins as possible.

  7. Jason Says:

    Hi Shahram

    Sorry wrong place for this comment, but I cant seem to post on another older article. I would love some help with your “Map Player”. Please email so we could corrispnd it you have time.

    Thanks Jason

  8. John Says:

    Shahram– great post. I spent a couple of days trying to get SNTP implemented on a UC864-G (Telit’s UMTS 3G module). If the UC864-G had a python interpreter then it would have been no problem at all. After a lot of wasted time I found your post about a handy little AT command by the name of “NITZ”. I would have discovered it eventually but you probably saved me another day or two of wasted time. Problem solved and in one line! Keep up the great work. Your notes have helped me out on many occasions.

  9. Philippe Says:

    I guess I would never have found the way to use the NITZ command without this explaination.
    Thank you!

  10. VVARGA Says:

    The above solution is working correctly on Telit GT-864-PY. I am using T-Mobile network in Hungary. I have used AT#REBOOT intstead of AT#SHDN.

    Thanks 🙂

  11. Brad Nelson Says:

    Thanks for the awesome tip!

  12. Tyler James Martin Says:

    Thanks! this helped me with my project!

  13. MANJU Says:

    Hi, I am using Ublox Leon-g200 modem(gprs and gsm) and i am not found this AT#NITZ=7,0 command in my manual to sync network time to internal clock. instead i am having AT+CTZU=1 Enable automatic time zone via NITZ

    BUT THIS NOT WORKING PLZZ DO HELP ME

  14. MANJU Says:

    how to sync network time with RTC in ublox modem?

    thanks in advance.

Leave a comment