Professional Documents
Culture Documents
Quectel UC20 Time Synchronization Application Note V1.0
Quectel UC20 Time Synchronization Application Note V1.0
Time Synchronization
Application Note
Rev. UC20_Time_Synchronization_Application_Note_V1.0
Date:2019-04-09
Status: Released
www.quectel.com
UMTS/HSPA Module Series
UC20 Time Synchronization Application Note
Our aim is to provide customers with timely and comprehensive service. For any
assistance, please contact our company headquarters:
GENERAL NOTES
QUECTEL OFFERS THE INFORMATION AS A SERVICE TO ITS CUSTOMERS. THE INFORMATION
PROVIDED IS BASED UPON CUSTOMERS’ REQUIREMENTS. QUECTEL MAKES EVERY EFFORT
TO ENSURE THE QUALITY OF THE INFORMATION IT MAKES AVAILABLE. QUECTEL DOES NOT
MAKE ANY WARRANTY AS TO THE INFORMATION CONTAINED HEREIN, AND DOES NOT ACCEPT
ANY LIABILITY FOR ANY INJURY, LOSS OR DAMAGE OF ANY KIND INCURRED BY USE OF OR
RELIANCE UPON THE INFORMATION. ALL INFORMATION SUPPLIED HEREIN IS SUBJECT TO
CHANGE WITHOUT PRIOR NOTICE.
COPYRIGHT
THE INFORMATION CONTAINED HERE IS PROPRIETARY TECHNICAL INFORMATION OF QUECTEL
WIRELESS SOLUTIONS CO., LTD. TRANSMITTING, REPRODUCTION, DISSEMINATION AND
EDITING OF THIS DOCUMENT AS WELL AS UTILIZATION OF THE CONTENT ARE FORBIDDEN
WITHOUT PERMISSION. OFFENDERS WILL BE HELD LIABLE FOR PAYMENT OF DAMAGES. ALL
RIGHTS ARE RESERVED IN THE EVENT OF A PATENT GRANT OR REGISTRATION OF A UTILITY
MODEL OR DESIGN.
Copyright © Quectel Wireless Solutions Co., Ltd. 2019. All rights reserved.
UC20_Time_Synchronization_Application_Note 1 / 14
UMTS/HSPA Module Series
UC20 Time Synchronization Application Note
History
UC20_Time_Synchronization_Application_Note 2 / 14
UMTS/HSPA Module Series
UC20 Time Synchronization Application Note
Contents
1 Introduction .......................................................................................................................................... 4
UC20_Time_Synchronization_Application_Note 3 / 14
UMTS/HSPA Module Series
UC20 Time Synchronization Application Note
1 Introduction
This document provides instructions on how to synchronize time of Quectel UC20 module.
UC20_Time_Synchronization_Application_Note 4 / 14
UMTS/HSPA Module Series
UC20 Time Synchronization Application Note
This command is used to enable and disable automatic time zone update via NITZ. The configuration is
stored in NV automatically.
OK
Write Command Response
AT+CTZU=<onoff> OK
OK
Maximum Response Time 300ms
Parameter
<onoff> Integer type. The mode of automatic time zone update.
0 Disable automatic time zone update via NITZ
1 Enable automatic time zone update via NITZ
UC20_Time_Synchronization_Application_Note 5 / 14
UMTS/HSPA Module Series
UC20 Time Synchronization Application Note
Example
AT+CTZU?
+CTZU: 0
OK
AT+CTZU=?
+CTZU: (0,1)
OK
AT+CTZU=1
OK
AT+CTZU?
+CTZU: 1
OK
This command is used to enable and disable the reporting of time zone change event. If the reporting is
enabled, the MT (mobile terminal) returns the unsolicited result code +CTZV: <tz> or +CTZE:
<tz>,<dst>,<time> whenever the time zone is changed. The configuration is stored in NV automatically.
OK
Write Command Response
AT+CTZR=<reporting> OK
OK
Maximum Response Time 300ms
UC20_Time_Synchronization_Application_Note 6 / 14
UMTS/HSPA Module Series
UC20 Time Synchronization Application Note
Parameter
Example
AT+CTZR=2
OK
AT+CTZR?
+CTZR: 2
OK
UC20_Time_Synchronization_Application_Note 7 / 14
UMTS/HSPA Module Series
UC20 Time Synchronization Application Note
This command is used to obtain the latest time synchronized through network.
OK
Maximum Response Time 300ms
Parameter
<time> String type. The format is "yy/mm/dd,hh:mm:ss±zz", indicating year (two last digits),
month, day, hour, minutes, seconds and time zone (indicates the difference, expressed in
quarters of an hour, between the local time and GMT; range -48...+56). E.g. 6th of May
2004, 22:10:00 GMT+2 equals to "04/05/06,22:10:00+08.
<ds> Daylight saving time.
This command is used to manage real time clock (RTC) of the module. The current setting is retained until
the module is totally disconnected from power.
OK
Write Command Response
AT+CCLK=<time> OK
UC20_Time_Synchronization_Application_Note 8 / 14
UMTS/HSPA Module Series
UC20 Time Synchronization Application Note
Parameter
<time> String type. The format is "yy/mm/dd,hh:mm:ss±zz", indicating year (two last digits), month,
day, hour, minutes, seconds and time zone (indicates the difference, expressed in quarters
of an hour, between the local time and GMT; range -48...+56). E.g. May 6th, 1994, 22:10:00
GMT+2 equals to "94/05/06,22:10:00+08".
<err> An error related to mobile equipment or network. For more details, please refer to Chapter
14.5 of Quectel_UC20_AT_Commands_Manual.
Example
AT+CCLK? //Query the local time
+CCLK: "08/01/04,00:19:43+00"
OK
NTP is intended to synchronize the Coordinated Universal Time (UTC) with the time server. Before using
NTP, the host should activate the context corresponding to <contextID> via AT+QIACT first. Depending
on the network, it will take at most 125 seconds to return the result.
OK
Read Command Response
AT+QNTP? If in the process of synchronizing local time:
+QNTP: <server>,<port>
OK
Or else, response:
ERROR
UC20_Time_Synchronization_Application_Note 9 / 14
UMTS/HSPA Module Series
UC20 Time Synchronization Application Note
+QNTP: <err>,<time>
Parameter
UC20_Time_Synchronization_Application_Note 10 / 14
UMTS/HSPA Module Series
UC20 Time Synchronization Application Note
The first way is highly recommended, but if the local network does not support NITZ, synchronizing time
with NTP should be taken.
To synchronize time via NITZ, customers should set AT+CTZU=1 to enable automatic time zone update.
In addition, customers can check the time zone reporting by setting AT+CTZR=1 or AT+CTZR=2. The
settings of these commands will be saved automatically without using AT&W.
The settings of AT+CTZU=1 and AT+CTZR=1 or AT+CTZR=2 will take effect after rebooting. After
rebooted, the module will report the current GMT time once the network time information is received.
Example
//When AT+CTZR=2:
AT+CTZU=1
OK
AT+CTZR=2
OK
UC20_Time_Synchronization_Application_Note 11 / 14
UMTS/HSPA Module Series
UC20 Time Synchronization Application Note
+CFUN: 1
+CPIN: READY
+QUSIM: 1
OK
//When AT+CTZR=1
AT+CTZU=1
OK
AT+CTZR=1
OK
+CFUN: 1
+CPIN: READY
+QUSIM: 1
OK
UC20_Time_Synchronization_Application_Note 12 / 14
UMTS/HSPA Module Series
UC20 Time Synchronization Application Note
Before using NTP server, the host should activate the context corresponding to <contextID> via
AT+QIACT first. And then, Customers should set AT+QNTP to synchronize the local time via NTP.
Example
OK
AT+QIACT=1 //Activate the context
OK
AT+QNTP=1,"time.windows.com",123 //Synchronize the local time via NTP
OK
OK
NOTE
If customers need to setup time zone, the command AT+CCLK=<time> should be used, for the time zone
cannot be synchronized via NTP.
UC20_Time_Synchronization_Application_Note 13 / 14
UMTS/HSPA Module Series
UC20 Time Synchronization Application Note
Power on
AT+CTZU=1
AT+CTZR=1/2
UC20_Time_Synchronization_Application_Note 14 / 14