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.

sending data through to web site through gprs

Status
Not open for further replies.

kunal123

Advanced Member level 4
Joined
Jan 24, 2011
Messages
105
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Location
mumbai
Activity points
1,961
hi everybody,
how i can send cellid, lac, mmc, mnc data to google.com through gprs.

thanks
 

here is a sample code to connect to web server
Code:
#include<string.h>
 
#include<reg51.h>
 
unsigned char x=0,i,g[20];
 
unsigned char s1[9]="AT\r\n";  //send "AT" command modem will response
 
unsigned char s2[18]="AT+CIPMODE=0\r\n";//Select TCPIP Application mode
 
unsigned char s3[30]="AT+CLPORT=\"UDP\",\"3500\"\r\n"; //set Local Port
 
unsigned char s4[45]="AT+CIPCSGP=1,\"airtelgprs.com\"\r\n";//set csd or GPRS for Connection mode "ur GPRS provide address"
 
unsigned char s5[15]="AT+CSTT\r";//Start Task and set apn
 
unsigned char s6[15]="AT+CIICR\r";//Bring up wireless connection with GPRS or CSD
 
unsigned char s7[15]="AT+CIFSR\r"; // Get Local Ip Address "is assign for GPRS Modem"
 
code unsigned char s8[50]="AT+CIPSTART=\"UDP\",\"219.64.118.125\",\"3500\"\r\n";  // Start Up TCP or Udp Connection
 
unsigned char s9[15]="AT+CIPSEND\r\n"; //Send Datat Through TCP or UDP Connection
 
unsigned char sd[46]="193308950\r\n"; // This is the Example Data Send through GPRS Modem
 
void call(unsigned char *z)
 
{
 
while(z[x]!='\0')
 
{
 
SBUF=z[x];
 
while(TI==0);
 
TI=0;
 
x++;
 
}
 
}
 
void send(unsigned char a)
 
{
 
SBUF=a;
 
while(TI==0);
 
TI=0;
 
}
 
void delay(unsigned int t)
 
{
 
unsigned int x1,y1;
 
for(x1=0;x1<t;x1++)
 
for(y1=0;y1<498;y1++);
 
}
 
void baud_rate_init()
 
{
 
TMOD=0x20;// Use Timer 1 8-bit Auto Reload mode
 
TH1=0xfd; //Baud Rate 9600
 
SCON=0X50;// 8 bit,1 stop bit
 
TR1=1;   // Start Timer 1 for Serial communication
 
}
 
void main()
 
{
 
baud_rate_init();
 
while(1)
 
{
 
x=0;
 
call(s1);
 
send(0x0d);
 
delay(1000);
 
x=0;
 
call(s2);
 
send(0x0d);
 
delay(2000);
 
x=0;
 
call(s3);
 
send(0x0d);
 
delay(3000);
 
x=0;
 
call(s4);
 
send(0x0d);
 
delay(5000);
 
x=0;
 
call(s5);
 
send(0x0d);
 
delay(6000);
 
x=0;
 
call(s6);
 
send(0x0d);
 
delay(10000);
 
delay(10000);
 
x=0;
 
call(s7);
 
send(0x0d);
 
delay(10000);
 
delay(10000);
 
x=0;
 
call(s8);
 
send(0x0d);
 
x=0;
 
call(s9);
 
send(0x0d);
 
x=0;
 
call(sd);
 
send(0x1a);
 
delay(1000);
 
} }
 

hi kvtal,
can u post me sample code for arduino uno to connect to web server or send data in url for e.g. https://www.google.com?a1=0xacd3&a2=404&a3=92&a4=0534
please reply me soon

thanks

here is a sample code to connect to web server
Code:
#include<string.h>
 
#include<reg51.h>
 
unsigned char x=0,i,g[20];
 
unsigned char s1[9]="AT\r\n";  //send "AT" command modem will response
 
unsigned char s2[18]="AT+CIPMODE=0\r\n";//Select TCPIP Application mode
 
unsigned char s3[30]="AT+CLPORT=\"UDP\",\"3500\"\r\n"; //set Local Port
 
unsigned char s4[45]="AT+CIPCSGP=1,\"airtelgprs.com\"\r\n";//set csd or GPRS for Connection mode "ur GPRS provide address"
 
unsigned char s5[15]="AT+CSTT\r";//Start Task and set apn
 
unsigned char s6[15]="AT+CIICR\r";//Bring up wireless connection with GPRS or CSD
 
unsigned char s7[15]="AT+CIFSR\r"; // Get Local Ip Address "is assign for GPRS Modem"
 
code unsigned char s8[50]="AT+CIPSTART=\"UDP\",\"219.64.118.125\",\"3500\"\r\n";  // Start Up TCP or Udp Connection
 
unsigned char s9[15]="AT+CIPSEND\r\n"; //Send Datat Through TCP or UDP Connection
 
unsigned char sd[46]="193308950\r\n"; // This is the Example Data Send through GPRS Modem
 
void call(unsigned char *z)
 
{
 
while(z[x]!='\0')
 
{
 
SBUF=z[x];
 
while(TI==0);
 
TI=0;
 
x++;
 
}
 
}
 
void send(unsigned char a)
 
{
 
SBUF=a;
 
while(TI==0);
 
TI=0;
 
}
 
void delay(unsigned int t)
 
{
 
unsigned int x1,y1;
 
for(x1=0;x1<t;x1++)
 
for(y1=0;y1<498;y1++);
 
}
 
void baud_rate_init()
 
{
 
TMOD=0x20;// Use Timer 1 8-bit Auto Reload mode
 
TH1=0xfd; //Baud Rate 9600
 
SCON=0X50;// 8 bit,1 stop bit
 
TR1=1;   // Start Timer 1 for Serial communication
 
}
 
void main()
 
{
 
baud_rate_init();
 
while(1)
 
{
 
x=0;
 
call(s1);
 
send(0x0d);
 
delay(1000);
 
x=0;
 
call(s2);
 
send(0x0d);
 
delay(2000);
 
x=0;
 
call(s3);
 
send(0x0d);
 
delay(3000);
 
x=0;
 
call(s4);
 
send(0x0d);
 
delay(5000);
 
x=0;
 
call(s5);
 
send(0x0d);
 
delay(6000);
 
x=0;
 
call(s6);
 
send(0x0d);
 
delay(10000);
 
delay(10000);
 
x=0;
 
call(s7);
 
send(0x0d);
 
delay(10000);
 
delay(10000);
 
x=0;
 
call(s8);
 
send(0x0d);
 
x=0;
 
call(s9);
 
send(0x0d);
 
x=0;
 
call(sd);
 
send(0x1a);
 
delay(1000);
 
} }
 

sory kunal123 i dont idea about adruino
but the commands to connect server are the same
u can change the syntax as u want
 

hi,
can enyone send me data transmit receive from server using gprs with sim300 & arduino uno.

thanks
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top