Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Data transfer between GPRS modem and Remote server

Status
Not open for further replies.

Suganiya

Newbie level 1
Joined
Apr 18, 2009
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,385
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.
:cry: 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
 

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@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: [url]www.google.com[/url]
>> Connection: Keep-Alive
>> Accept: */*
>> Accept-Language: en-us
>> 
<< data from server returned - Server will return data here
 
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.
 

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

<%
	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:
GET /LogGprs.asp?Data=123456 HTTP/1.1

A good web site for information on server side scripting is: https://www.w3schools.com/
 
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.
 
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 :)
 

send data with gprs to server

kejuqeju said:
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 said:
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.
 

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

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?
 

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
 
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: [url]www.yahoo.comCRLF[/url]
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.
 
  • Like
Reactions: rafati

    rafati

    Points: 2
    Helpful Answer Positive Rating
I am new to GPRS technology. All the posts are helpful to get started in this technology. Kindly clarify the below doubts

AT+CGDCONT=1,"IP","internet"
In the above AT command what is the word internet specifies? Is it mandatory to specify only as 'internet'.

AT+CDNSCFG="62.40.32.33","62.40.32.34"
in the above AT command , how did you choose these DNS addresses?

Thanks in advance
 

    V

    Points: 2
    Helpful Answer Positive Rating
raja.krishnan3 said:
AT+CGDCONT=1,"IP","internet"
In the above AT command what is the word internet specifies? Is it mandatory to specify only as 'internet'.
This is the APN. GSM networks use an APN (Access Point Name) to determine how the carrier network passes IP traffic from the device to the host network. It determines what IP addresses are assigned to the device, which security methods are utilized and how the GSM data network connects to the customer’s network. APNs can be general-purpose (available to multiple customers) or can be specific to a customer. You can get the APN for your network and plan from your service provider.


raja.krishnan3 said:
AT+CDNSCFG="62.40.32.33","62.40.32.34"
in the above AT command , how did you choose these DNS addresses?
You can use the DNS Servers provided by your service provider, or a public DNS. You may find the performance is improved if you use servers that are located near you. You can search the internet for lists of public DNS servers.
 
  • Like
Reactions: rafati

    rafati

    Points: 2
    Helpful Answer Positive Rating
Hi I got the reply from the server... But after that i lost the connection. is it not possible to keep the connection alive....
 

Depending on the type of request you are making, the server may terminate the connection after it sends its response. For example, if you are making an HTTP request, have you included the line "Connection: Keep-Alive" in your header?
 

Ya i have included the line Connection: Alive in the header then also the connection is getting closed....

Added after 3 hours 13 minutes:

After at+cipsend i am passing the following code

GET /gprs.php?val=1222 HTTP/1.1
Host: www.sketchme.in
Connection: Keep-Alive
Accept: */*
Accept-Language: en-us

The replay i got is

SEND OK
+IPD216:HTTP/1.1 200 OK
Date: Wed, 27 Jan 2010 09:28:21 GMT
Server: Apache/2.2.0 (Fedora)
X-Powered-By: PHP/5.2.6
Content-Length: 25
Connection: close
Content-Type: text/html; charset=UTF-8

Returned value is 1222
CLOSED

But i am passing in the header as Connection: Keep-Alive.... Now if i want to send data means again i have to start from at+cipshut till the end.... Pls tell how to over come this problem...

Added after 1 hours 10 minutes:

Sorry after the reply from the server the connection is closed i have to start from

AT+CIPSTART="TCP","www.yahoo.com","80"

not from AT+CIPSHUT

Pls reply.
 

Thanks for your information.... I have to configure in the server side.. Now its working fine....:D

Added after 3 hours 15 minutes:

One more doubt... Is it possible read any data in the server... Is there any command to read data in the server... Pls reply...
 

vivekraju said:
One more doubt... Is it possible read any data in the server... Is there any command to read data in the server... Pls reply...
I'm sorry, but I don't know what you mean by that. Do you mean "get" data fom the server and receive it at the modem?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top