GPRS shield not responding to AT commands

Post Reply
nshah88
Posts: 3
Joined: Sat Jul 12, 2014 11:37 pm

GPRS shield not responding to AT commands

Post by nshah88 » Sat Jul 12, 2014 11:47 pm

output_of_power_on.png
Output when power button is pressed
output_of_power_on.png (99.14 KiB) Viewed 15536 times
Hi,

I just bought a GPRS shield from ebay (http://www.ebay.com/itm/321335842823?_t ... EBIDX%3AIT). I hooked it up to a Arduino UNO and now trying to use the serial monitor in the arduino IDE to communicate with the shield.

I used the test code given on your wiki (http://www.geeetech.com/wiki/index.php/GPRS_Shield_V2.0) and have connected the jumpers on the software serial side.

The shield is being powered from a arduino uno and when I press the power button (see attached screenshot for output) the red led turns on and stays on. The green LED as indicated turns on every 3000ms and then turns off.

I have attached a unlocked sim card from t-mobile to it. No external power supplies have been used.

Even after doing all this the shield is not responding to any AT commands.

Here is the code that I am using:

//Serial Relay - Arduino will patch a
//serial link between the computer and the GPRS Shield
//at 19200 bps 8-N-1
//Computer is connected to Hardware UART
//GPRS Shield is connected to the Software UART

#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 data 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=NULL;} // clear all index of array with command NULL
}

Please help.

thanks

-n

Lemon
Posts: 40
Joined: Thu Jul 03, 2014 9:13 am

Re: GPRS shield not responding to AT commands

Post by Lemon » Mon Jul 14, 2014 2:14 pm

Dear friend,
Thank you for your post and sincerely sorry for this inconvenience, but the most important thing I need to point out is all our products have been tested before shipped out. The problem probably have occurred in the course of transit, which is out of our control. But we are serious seller, we do not escape any problem from our customers', we will do whatever we can do for our customers. I hope I can solve your problem together with you.

According to your question, could you please be patient and try to test the items according to the following steps:
1.select the right baud rate which mate in your code
“Serial.begin(19200)”
1111.jpg
1111.jpg (19.47 KiB) Viewed 17939 times
If not receive right answer form serial monitor yet,maybe you shouid set GPRS’s baud rate via AT commands.
AT+IPG=19200 and serial monitor will return you a value “OK ”


2.connect GPRS and Iduino UNO
iduino UNO GPRS shield
TX ------------------RX(D7)
RX ------------------TX(D8)

After you finish tested, please tell me the details. Wish you can solve the problem out on the basis of these solutions.
Waiting your reply.
Best regards.

Lemon
Posts: 40
Joined: Thu Jul 03, 2014 9:13 am

Re: GPRS shield not responding to AT commands

Post by Lemon » Mon Jul 14, 2014 2:45 pm

Dear friend,
Could you plaese also check whether there is a problem of the serial port or not? Please upload the following code for Iduino UNO.

void setup()
{
Serail.begin(9600);
}
void loop()
{
Serial.println("hello World");
delay(1000);
}


If the serial port is normal, the serial port monitor data will prints hello world.

Please have a try. Waiting your reply. Best regards.

nshah88
Posts: 3
Joined: Sat Jul 12, 2014 11:37 pm

Re: GPRS shield not responding to AT commands

Post by nshah88 » Tue Jul 15, 2014 5:26 am

Hi,

I have matched the baud rate from my code to the serial monitor. The baud rate for both is 19200 as mentioned on this link (http://www.geeetech.com/wiki/index.php/GPRS_Shield_V2.0).

Also the second post says that I should test the serial communicatio with Arduino UNO. I tested that and the result is provided here.
helloworld.png
Out put of hello world program
helloworld.png (108.8 KiB) Viewed 15516 times
-n

Lemon
Posts: 40
Joined: Thu Jul 03, 2014 9:13 am

Re: GPRS shield not responding to AT commands

Post by Lemon » Tue Jul 15, 2014 2:11 pm

Dear friend,
Thank you for your reply.
According to the result you sent, the serial port has without problem.
1. Please do not use the way of sortware to test the GPRS module.
2.Connect GPRS with Iduino UNO
Iduino UNO GPRS shield
RX ----------------TX(D8)
TX-----------------RX(D7)

send the main AT commands
such as
AT // return value OK
AT+phoneNumber; //nake a call to phoneNumber
AT+IPR? //return GPRS's baud rate

After you finish tested, please don't forget to tell me the details.
Waiting your reply. Best regards.

nshah88
Posts: 3
Joined: Sat Jul 12, 2014 11:37 pm

Re: GPRS shield not responding to AT commands

Post by nshah88 » Tue Jul 15, 2014 7:36 pm

But I am connecting the shield on the arduino directly and I assume that the connections have been made accordingly to D7 and D8.

Isn't that the case?

Lemon
Posts: 40
Joined: Thu Jul 03, 2014 9:13 am

Re: GPRS shield not responding to AT commands

Post by Lemon » Wed Jul 16, 2014 9:50 am

Dear friend,
We treat Arduino board as a serial device when we use AT commands.
By default, the status of the Jumper Cap is close to D7 and D8, it has not connect directly to D7(RX) and D8(Tx).
What we do is just for communicating GPRS shield with PC(Serial Monitor), not for communicating with Arduino board.
GPRS 2 图片.png
GPRS 2 图片.png (379.95 KiB) Viewed 15492 times
GPRS串口原理图.png
GPRS串口原理图.png (29.11 KiB) Viewed 15492 times

jafarin
Posts: 6
Joined: Tue Jul 22, 2014 7:34 pm

Re: GPRS shield not responding to AT commands

Post by jafarin » Sun Jul 27, 2014 1:01 am

I have similar problem, but I get response for AT. Only by testing different baud rates. Some reason speed of shield changing by itself or what happens?

I used this code for hunting right baud rate. Do I have problem with power or shield?

Code: Select all

#include <SoftwareSerial.h>
SoftwareSerial SIM900(7, 8);
unsigned char buffer[64]; // buffer array for data recieve over serial port
int count=0;     // counter for buffer array 
int workingSpeed=0;

void setup()
{
  Serial.begin(9600);
}

void loop()
{
	Serial.println("Testing GSM shield...");
	int speed[] = {2400,4800,9600,14400,19200,115200};
	if (workingSpeed==0) for (int i = 0; i < 5;i++) 
	{
		startGSMtest(speed[i]);
		
	}
	while(true){};
}


void startGSMtest(int baud){
	SIM900.begin(baud);
	Serial.print(" start GSM speed ");
	Serial.print(baud);
	Serial.println(" baud");
	SIM900.println("AT");
	delay(1000);
	if (SIM900.available()) {
		while(SIM900.available())          // reading data into char array 
    	{
      		buffer[count++]=SIM900.read();     // writing data into array
      		if(count == 64)break;
  		}
  		if (buffer[0]='O'){
  			workingSpeed=baud;
  		}
    	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
	}
}

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
}

Post Reply