Go Down

Topic: Timestamp from GSM Network (Read 12756 times) previous topic - next topic

dtluigi

Dear all,
do you know if is it possible to know the current time (hh/mm/ss) from the GSM network with the GSM Shield?

Magician

GSM network doesn't have such service. GPRS, which is Internet over GSM, may work, same way like your OS getting timing from NTP, only you need a data in your GSM plan.

dtluigi

Is there any service then on arduino GSM shield in order to retrieve the timestamp from NTP?

dtluigi

How to setup an UDP communication over a GPRS network?
I am still missing something...

davidgoth


How to setup an UDP communication over a GPRS network?
I am still missing something...


Actual GSM library doesn't support UDP connections, but it is possible sending AT commands.
Read M10 manual for more information: http://arduino.cc/en/uploads/Main/Quectel_M10_AT_commands.pdf

dtluigi

Thank you for your reply, but I have now an issue when I have both the include:

#include <GSM.h>
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX

Do you know why?!?

davidgoth


Thank you for your reply, but I have now an issue when I have both the include:

#include <GSM.h>
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX

Do you know why?!?


Don't use SoftwareSerial and GSM library in the same sketch. They have conflicts with interruptions.

Try googling GSM_Location_ATC_V10 which seems to be floating around the net. It gives

AT+QIFGCNT=0 //Choose the contect 0 to activate GPRS/CSD context for the TCP/IP service.
AT+QICSGP=1,"bluevia.movistar.es"
AT+QGSMLOC=2 //Get the time

That will give you the current date and time.

Try AT+QGSMLOC=1 and you will get the longitude and latitude as well ;-) There is a AT+QGSMLOC=8 that should get better precision, but it's not working for me...


RudiAhlers

It's better / easier to use a GPS module if you need accurate time


dtluigi

Ok guys,
with gsmAccess(true) it is possible to send (and see on serial port) AT commands; following this step I have tried to send AT+CCLK? right now (2013-07-02 17:00:00) receiving as reply from the modem:
85 2>%13%%10%OK%13%%10%%13%%10%+CCLK: "08/01/01,01:39:15+00"%13%%10%%13%%10%OK%13%%10%

How can be possible that the timestamp that it gives to me is "08/01/01,01:39:15+00"?!?
What's wrong?

dtluigi

If the GSM TimeStamp is not affordable just like the previous one I reported here, I'll try to do a UDP connection with a NTP Server by GPRS.

MathiasVDA


If the GSM TimeStamp is not affordable just like the previous one I reported here, I'll try to do a UDP connection with a NTP Server by GPRS.


Hey dtluigi, have you managed to do this yet? UDP is supported but I have no clue how to use it.

dtluigi

AT+CCLK is a method to write the actual date and time in the GSM Module, and using its internal RTC it's possible anytime retrieving the timestamp with the same command.
It can't be used to know the Timestamp without first have written in it (in a GSM module setup phase).
So the only method I think to use to know the actual Timestamp is a NTP or Daytime service over internet.

For what concern NTP I am still at the beginning of my first sketch (it needs an UDP communication with a NTP server)...if someone could help us, it would be appreciated! ;)

MathiasVDA


AT+CCLK is a method to write the actual date and time in the GSM Module, and using its internal RTC it's possible anytime retrieving the timestamp with the same command.
It can't be used to know the Timestamp without first have written in it (in a GSM module setup phase).

Ok, that explains alot. I'm having trouble with getting the anwsers from my AT commands. For some reason, even in debuggin mode, I don't get the responeses that others get, for example in: http://forum.arduino.cc/index.php?topic=163155.0
Actually, the shield just returns nothing...


So the only method I think to use to know the actual Timestamp is a NTP or Daytime service over internet.

For what concern NTP I am still at the beginning of my first sketch (it needs an UDP communication with a NTP server)...if someone could help us, it would be appreciated! ;)


I'm currentely working on a project that needs to be finshed next week and I have a couple of other problems I need to overcome. I was thinking of doing something simply for the time being: letting a php script display te time on a server, important that into the arduino and using that as timestamp. I think that's the easiest and quiest solution. Not sure if it's the best ;).
I've been looking up about the NTP thing and the UDP connection and came across this page:
http://www.cooking-hacks.com/index.php/documentation/tutorials/arduino-3g-gprs-gsm-gps#step14
It's for a different gsm shield but the principle is the same I think. I guess all the elements are there to cover the UDP part, except I still have that problem with recieving the answer to my AT commands...

Go Up