Pages: [1] 2   Go Down
Author Topic: Timestamp from GSM Network  (Read 7684 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Montreal
Offline Offline
Edison Member
*
Karma: 23
Posts: 2485
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Madrid (Spain)
Offline Offline
Full Member
***
Karma: 0
Posts: 103
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?!?
Logged

Madrid (Spain)
Offline Offline
Full Member
***
Karma: 0
Posts: 103
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 32
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...

Logged

Johannesburg, South Africa
Offline Offline
Full Member
***
Karma: 0
Posts: 120
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Seattle, WA
Offline Offline
Newbie
*
Karma: 0
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

See: http://forum.arduino.cc/index.php?topic=163155.0
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 104
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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! smiley-wink
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 104
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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! smiley-wink

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 smiley-wink.
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...
Logged

Pages: [1] 2   Go Up
Jump to: