GPRS communication with Arduino and SIM300 DZ - Connecting to Time Server using NTP

Friday, 05 July 2013 03:54 Mada Jimmy
PDF
User Rating: / 3
PoorBest 
Article Index
GPRS communication with Arduino and SIM300 DZ
Connecting to Time Server using NTP
All Pages

 

Getting timestamp from NTP server

In order to get time information from time server, we have to send 48 Bytes packet data using UDP connection.  After succesfully sending AT+CIPSTART to modem (Connect OK), send the packet and wait for the response from the modem.  The size of data is also 48 Bytes.  Refer to Network Time Protocol to understand the meaning of each byte.

Here is the example of communication between Arduino and SIM300

AT+CIPSTART="UDP","0.pool.ntp.org","123"

OK

(wait.....)

CONNECT OK

AT+CIPSEND=48

>

(send 48 Bytes of data starting with 0x1B and continue with 0x00 in all the rest of data.)

1B 00 00 00 00 00 00 00 00 00 00 00

00 00 00 00 00 00 00 00 00 00 00 00

00 00 00 00 00 00 00 00 00 00 00 00

00 00 00 00 00 00 00 00 00 00 00 00

(wait for the response data)

1C 03 03 E9 00 00 21 7D 00 00 18 7B

76 62 40 C2 D5 86 33 70 53 8F F5 CE

00 00 00 00 00 00 00 85 D5 86 34 F8

4D 19 F8 9B D5 86 34 F8 4D 20 51 44

 

 

 

 



Last Updated on Sunday, 04 May 2014 07:39

Dreamstime

Stock Images