I have Arduino Leonardo and Seeedstudio GPRS Shield v2.0 (http://www.seeedstudio.com/wiki/GPRS_Shield_V2.0). Both of them working seamlessly. Following tutorial on main gprs shield link here http://www.seeedstudio.com/wiki/GPRS_Shield_V2.0, I’ve succesfully compiled the following code to arduino:
#include <SoftwareSerial.h>
SoftwareSerial GPRS(7, 8);
unsigned char buffer[64]; // buffer array for data recieve over serial port
int count=0; // counter for buffer array
void setup()
{
GPRS.begin(19200); // the GPRS baud rate
Serial.begin(19200); // the Serial port of Arduino baud rate.
}
void loop()
{
if (GPRS.available()) // if date is comming from softwareserial port ==> data is comming from gprs shield
{
while(GPRS.available()) // reading data into char array
{
buffer[count++]=GPRS.read(); // writing data into array
if(count == 64)break;
}
Serial.write(buffer,count); // if no data transmission ends, write buffer to hardware serial port
clearBufferArray(); // call clearBufferArray function to clear the storaged data from the array
count = 0; // set counter of while loop to zero
}
if (Serial.available()) // if data is available on hardwareserial port ==> data is comming from PC or notebook
GPRS.write(Serial.read()); // write it to the GPRS shield
}
void clearBufferArray() // function to clear buffer array
{
for (int i=0; i<count;i++)
{ buffer[i]=NULL;} // clear all index of array with command NULL
}
the code above takes AT Command from serial as input and pass it to gprs module. So, I could type something like: “ATD + +1XXXXXXXX” which code to call numbers, and it worked. The problem is I can’t get response from gprs module serial, it’s just blank. I read that the right response to serial terminal should be: “OK”. My questions are:
a. Is there something I missed? I want to get response written to the terminal.
b. I want to make http request, does someone has experience how to do it? What I mean is this gprs opening website blablablabla.com/cs/blabla.php?name=blabla
thx before