| Author |
Message |
Suganiya
Joined: 18 Apr 2009 Posts: 1
|
18 Apr 2009 11:40 gprs data transfer |
|
|
|
|
hi,
i am new to GPRS communication, but i hav worked in appcation using GSM.
now i want develop application to transfer data between GPRS MODEM and a server kept in remote place. can anyone help me how to initialize the modem with GPRS mode for file transfer.
even i hope in my application i dont need internet pages to be accessed just want to send and get data from remote sever database.
thanks
Suganiya
|
|
| Back to top |
|
 |
GSM Man
Joined: 15 Apr 2009 Posts: 357 Helped: 46 Location: New Jersey, USA
|
18 Apr 2009 17:49 gprs server |
|
|
|
|
Here's the commands you need to send. In the example below '>>' indicates data you send to the module, while'<<' indicates data returned from the module. This example is for connecting through the AT&T/Cingular network. You'll need to get the APN, user name and password for the network you are using.
First you need to open a PDP context.
| Code: |
>> AT+CGATT=1 - Attach to GPRS Service
<< OK
>> AT+CGDCONT=1,"IP","wap.cingular" - Define PDP Context (cid, PDP type, APN)
<< OK
>> AT+CDNSCFG="208.67.222.222","208.67.220.220" - Configure Domain Name Server (primary DNS, secondary DNS)
<< OK
>> AT+CSTT="wap.cingular","wap(at)cingulargprs.com","cingular1" - Start Task & set APN, User ID, and password
<< OK
>> AT+CIICR - Bring up wireless connection with GPRS - THIS MAY TAKE A WHILE
<< OK
>> AT+CIFSR - Get Local IP address
<< 10.190.245.172 - returns IP address assigned to your module
<< OK
>> AT+CIPSTATUS - Get Connection Status
<< OK
<< STATE: IP STATUS - returns status of connection, needs to be 'IP STATUS' before you can connect to a server
|
After you have context, you need to make a connection to the server and then send your data.
| Code: |
>> AT+CIPHEAD=1 - Tells module to add an 'IP Header' to receive data
<< OK
>> AT+CDNSORIP=1 - Indicates whether connection request will be IP address (0), or domain name (1)
<< OK
>> AT+CIPSTART="TCP","www.google.com","80" - Start up TCP connection (mode, IP address/name, port)
<< OK
<< CONNECT OK - Indicates you've connected to the server - IT MAKE TAKE A WHILE FOR THIS TO BE RETURNED
>> AT+CIPSEND - Issue Send Command
<< > - wait for module to return'>' to indicate it's ready to receive data
>> GET / HTTP/1.1 - Send data - this example is an HTTP request for the default page
>> Host: www.google.com
>> Connection: Keep-Alive
>> Accept: */*
>> Accept-Language: en-us
>>
<< data from server returned - Server will return data here
|
|
|
| Back to top |
|
 |
kiranbdvt
Joined: 03 Jun 2009 Posts: 2
|
03 Jul 2009 13:40 data transfer through gprs |
|
|
|
|
HI GSM man,
thank you for the info. could you kindly let me know how i can collect the data at the server side( server side coding ) when its not an HTTP request? i have a problem. i am developing a web based remote data logger through GPRS.
|
|
| Back to top |
|
 |
GSM Man
Joined: 15 Apr 2009 Posts: 357 Helped: 46 Location: New Jersey, USA
|
03 Jul 2009 15:50 gprs modem |
|
|
|
|
On the server side you have several options depending on the type of server you are running. You can store the data in a text file, XML file, database, Spreadsheet, etc. The code below is written in VBScript and is for a Windows server running ASP:
| Code: |
<%@ LANGUAGE=VBSCRIPT %>
<% Option Explicit%>
<!-- #include file="adovbs.inc"-->
<%
If Err.Number <> 0 then
Response.Write(Err.Description)
Error.Clear
End If
Dim data_string, file_System, file_path, file
data_string = Request.QueryString("Data")
if data_string <> "" then
Set file_System = CreateObject("Scripting.FileSystemObject")
file_path = Server.MapPath("Data\LogData.txt")
Set file = file_System.OpenTextFile(file_path, 8, True) ' Open File for appending (8)
file.WriteLine (data_string & vbCrLf)
file.Close
Set file = Nothing
Set file_System = Nothing
response.write("OK")
else
response.write("No Data")
end if
%> |
You can remove the 2 'response.write' lines if you don't need confirmation on the GSM side.
On the GSM side you need to change the first line of your 'CIPSEND' command to include the page name and request data. For example, if the ASP page is named 'LogGprs.asp' and your data is '123456' the first line should be:
| Quote: |
| GET /LogGprs.asp?Data=123456 HTTP/1.1 |
A good web site for information on server side scripting is: http://www.w3schools.com/
|
|
| Back to top |
|
 |
GSM Man
Joined: 15 Apr 2009 Posts: 357 Helped: 46 Location: New Jersey, USA
|
03 Sep 2009 14:47 send data to local ip address |
|
|
|
|
| You need to contact to service provider and get a plan that allows you to accept incoming connections. When you have that you will be given a public IP address by their server.
|
|
| Back to top |
|
 |
kejuqeju
Joined: 03 Sep 2009 Posts: 2 Location: Indonesia
|
04 Sep 2009 18:14 gprs modem data transfer |
|
|
|
|
oh.. i see..
i'll try it. but i think it's hard to do because i don't think the provider will give me that plan.
how bout this.. if i send data via GPRS to a real IP, can i pull back some information or anything from the application that runs in the server? because i see in your previous post there is command GET .... and after that the server give back some information. maybe i can put or set something in the server's application that can be collected by SIM300?
btw i tried the command GET / HTTP/1.1, but there was no response at all. in the server side i got just "GET / HTTP/1.1" string.
why is that?
thx for your help
|
|
| Back to top |
|
 |
GSM Man
Joined: 15 Apr 2009 Posts: 357 Helped: 46 Location: New Jersey, USA
|
04 Sep 2009 18:42 send data with gprs to server |
|
|
|
|
| kejuqeju wrote: |
how bout this.. if i send data via GPRS to a real IP, can i pull back some information or anything from the application that runs in the server? because i see in your previous post there is command GET .... and after that the server give back some information. maybe i can put or set something in the server's application that can be collected by SIM300?
|
Yes, you can do that - we have several commercial applications on both Ethernet and GSM that use that technique.
| kejuqeju wrote: |
btw i tried the command GET / HTTP/1.1, but there was no response at all. in the server side i got just "GET / HTTP/1.1" string.
why is that? |
Did you include a blank line and the CTRL-Z? You may need to send the entire header - not just the "GET" line. Many servers will reject a simple request like that as being invalid.
|
|
| Back to top |
|
 |
Google AdSense

|
04 Sep 2009 18:42 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
mpch_elec
Joined: 22 Jul 2009 Posts: 24 Location: Tehran,Iran
|
05 Sep 2009 5:48 receiving data from gprs modem |
|
|
|
|
Hi friends,
I want to send data with GPRS.
My Modem is Mc39i for Siemens.
i connect to gprs with atd*99***1#
but i don't know what i should be do when connect to gprs.
how can i send data...
|
|
| Back to top |
|
 |
rus40
Joined: 15 Aug 2009 Posts: 5 Location: Bulgaria
|
16 Sep 2009 16:17 gprs for remote data transfer |
|
|
|
|
Hi,
what will happen if the Gprs connection suddenly will i gonna loose data and is there any AT command to prevent this?
|
|
| Back to top |
|
 |
MartinLintzgy
Joined: 26 Aug 2009 Posts: 2 Location: Ireland
|
19 Nov 2009 16:23 Re: Data transfer between GPRS modem and Remote server |
|
|
|
|
Hi,
I am stuck on this.
Using sIM300, trying to GET the homepage of a remote server for testing.
Eg Yahoo.
Problem is :- Where is the data ?
Here is hyperterminal log.
AT+CREG?
+CREG: 0,1
OK
AT+CGATT=1
OK
AT+CGDCONT=1,"IP","internet"
OK
AT+CDNSCFG="62.40.32.33","62.40.32.34"
OK
AT+CDNSORIP=1
OK
AT+CSTT="internet"
OK
AT+CIICR
OK
at+cifsr
10.36.124.132
AT+CIPSTATUS
OK
STATE: IP STATUS
AT+CIPHEAD=1
OK
AT+CIPSTART="TCP","www.yahoo.com","80"
OK
CONNECT OK
AT+CIPSEND
> GET /index.html HTTP/1.0
Host: www.yahoo.com
SEND OK
<No Data>
CLOSED <after a minute or so>
...And yes, i am sending out "\r\n" at end of the GET line
then another "\r\n" before the ^Z
The sim card has credit, and is enabled for data.
I have tried all manner of combinations for the GET command and html header.
i either get nothing, or i get a
+IPD1360:HTTP/1.0 400 Bad Request
Content-Type: text/html; charset=UTF-8
Content-Length: 1350
Date: Thu, 19 Nov 2009 15:17:23 GMT
Server: GFE/2.0
X-XSS-Protection: 0
Ayone any idea what i am doing wrong ?
-martin
|
|
| Back to top |
|
 |
GSM Man
Joined: 15 Apr 2009 Posts: 357 Helped: 46 Location: New Jersey, USA
|
19 Nov 2009 17:02 Re: Data transfer between GPRS modem and Remote server |
|
|
|
|
Two things to verify...
1 - The end of the header of your request must be a blank line - make sure there is no space or other character on the last line. Your request must look like this (where CR & LF are Carriage Return & Line Feed):
| Code: |
GET /index.html HTTP/1.0CRLF
Host: www.yahoo.comCRLF
CRLF^Z
|
2 - Some servers are particular about the end-of-line character sequence. They should be Carriage Return and then Line Feed. If you send Line Feed and the Carriage Return some servers will not accept your request.
|
|
| Back to top |
|
 |