Sparked
Newbie level 3
Hi,
sorry if this is a bit of a noob question as I am new to digital communications.
I am currently building a data logger and am using a SIM900 chip to send e-mails containing data.
I would like this data to be timestamped but to keep it accurate I need to update my SIM900's RTC with a time stamp received from a NTP time server.
Unfortunately the AT+CLTS (get local timestamp) returns an error. I assume its just the network I am on.
As an alternative I need to send a UDP packet to an NTP time server, but I am completely lost on how this would be done.
Could anyone post a list of the required AT commands that I need to use to do this?
My best guess was to use:
AT+CSTT=apn,username,password //Start task and set APN, username, and password
AT+CGATT //Check if connected to the GPRS network
AT+CIICR //I think this command is used to bring up wireless connection with GPRS, or CSD?
AT+CIPSTART=UDP,"time.digibase.ca",123 //This command starts a UDP connection with the NTP server
AT+CIPSEND //Tell the SIM900 I want to send a message
(Type my packet here)
<sub> //sub command to end "CIPSEND"
and then I would assume/hope that the response from the server would be available at the SIM900's rxd/txd port
Am I way off here, because it is not working?
sorry if this is a bit of a noob question as I am new to digital communications.
I am currently building a data logger and am using a SIM900 chip to send e-mails containing data.
I would like this data to be timestamped but to keep it accurate I need to update my SIM900's RTC with a time stamp received from a NTP time server.
Unfortunately the AT+CLTS (get local timestamp) returns an error. I assume its just the network I am on.
As an alternative I need to send a UDP packet to an NTP time server, but I am completely lost on how this would be done.
Could anyone post a list of the required AT commands that I need to use to do this?
My best guess was to use:
AT+CSTT=apn,username,password //Start task and set APN, username, and password
AT+CGATT //Check if connected to the GPRS network
AT+CIICR //I think this command is used to bring up wireless connection with GPRS, or CSD?
AT+CIPSTART=UDP,"time.digibase.ca",123 //This command starts a UDP connection with the NTP server
AT+CIPSEND //Tell the SIM900 I want to send a message
(Type my packet here)
<sub> //sub command to end "CIPSEND"
and then I would assume/hope that the response from the server would be available at the SIM900's rxd/txd port
Am I way off here, because it is not working?