Getting Time And Date from GSM Modem.
elementzonline / December 28, 2016
We can configure the GSM Modem to keep time. So there is no need for a separate RTC to keep time. These AT commands are supported by the SIMCOM SIM900 and SIM800 series.
So the first step is to connect the modem to the computer. Then open a terminal using GtkTerm or PUTTY.
Send the following AT command.
AT+CLTS?
So if not configured the MODEM will reply +CLTS: 0. If the value returned is 0 it means network time updating is disabled.
So let us make that value 1. Then we should write it permanently to the modem. &W is used to write the state permanently to Modem. So even if the modem is restarted CLTS will be enabled.
Send the following AT command
AT+CLTS=1;&W
Now restart the modem using Software Restart command AT+CFUN=1,1 or you can hardware restart it.
AT+CFUN=1,1
Now you can see after Call Ready there is a new line *PSUTTZ: which won’t be there during normal startup. It shows the date and UTC time. Year – 2016. Month – 12. Date – 28. Hour – 10. Minute – 30. Second – 7. +22 indicates the time zone expressed in quarters of an hour, between the local time and UTC; range -47 to +48. Here in India the IST is UTC + 5:30. In 5 hours and 30 minutes there are 22 quarters of an hour.
You can confirm whether the modem is in CLTS mode by sending AT+CLTS?
AT+CLTS?
If the modem responds with 1, then CLTS mode is activated.
And finally to get the current time send AT+CCLK?
AT+CCLK?
Modem will return the current local time in “yy/mm/dd,hh:mm:ss+/-zz” format.
If the GSM Modem is connected to an embedded board like arduino then you must send these AT commands via UART.