GPRS - AT Responses

Hello,
i will buy a gprs (1.4), i can send sms, all work fine, but…

…but, i want read the AT responses for commands, and nothing …

(i use arduino mega R3)

i’ve tried :

void setup() {
mySerial.println(“ATZ”);
delay(100);
ShowSerialData();
mySerial.println(“AT+CSMINS=?”);
delay(100);
ShowSerialData();
mySerial.println(“AT+CSMINS=<”);
delay(100);
ShowSerialData();
(…)

void ShowSerialData() {
while (mySerial.available() != 0)
Serial.println(mySerial.read());
}

i ve try to pilot gprs by serial commands :

void loop() {

ShowSerialData();

if (Serial.available())
switch (Serial.read()) {
case ‘q’:
mySerial.println(“ATZ”);
break;
case ‘w’:
mySerial.println(“AT+CSMINS=?”);
break;
case ‘e’:
mySerial.println(“AT+CSMINS=<”);
break;
(…)

Could you get responses from Arduino IDE monitor or sscom32E by inputting AT commands to serial port derectly? Not by program.

nothing !

if i use arduino serial monitor or sscom32, i can send my command to arduino (and arduino to gprs and so, my sms is send all is perfect), but no feedback from gprs for all commands…
In arduino serial monitor or sscom32 just my Serial.print is display …

Serial.available() always ok : read my “extern” commands
mySerial.available() nothing … : no message received from gprs shield (all AT commands)

that sounds strange,could you show us some pictures while you have sent AT commands to GPRS through serial port.

hello,
here a quick test with the demo code from the seeeduino gprs tutorial.

sms is send, but no response from gprs.


[code]/*Note: this code is a demo for how to using gprs shield to send sms message, dial a voice call and
send a http request to the website, upload data to pachube.com by TCP connection,

The microcontrollers Digital Pin 7 and hence allow unhindered
communication with GPRS Shield using SoftSerial Library.
IDE: Arduino 1.0 or later
Replace the following items in the code:
1.Phone number, don’t forget add the country code
2.Replace the Access Point Name
3. Replace the Pachube API Key with your personal ones assigned
to your account at cosm.com
*/

#include <SoftwareSerial.h>

SoftwareSerial mySerial(7, 8);

String SIM_PIN_CODE = String(“0703”);

void setup()
{
mySerial.begin(19200); // the GPRS baud rate
Serial.begin(19200); // the GPRS baud rate
delay(500);
}

void loop()
{
//after start up the program, you can using terminal to connect the serial of gprs shield,
//if you input ‘t’ in the terminal, the program will execute SendTextMessage(), it will show how to send a sms message,
//if input ‘d’ in the terminal, it will execute DialVoiceCall(), etc.

if (Serial.available())
switch(Serial.read())
{
case ‘t’:
Serial.println(“press ‘t’”);
SendTextMessage();
Serial.println(“done.”);
break;

case 'a' :
  Serial.println("press 'a'");
  mySerial.println("ATZ");
  delay(100);
  ShowSerialData();
  mySerial.println("AT+CSMINS=?");
  delay(100);
  ShowSerialData();
  mySerial.println("AT+CSMINS=<");
  delay(100);
  ShowSerialData();     
  mySerial.println("AT");
  delay(100);
  ShowSerialData();
  mySerial.println("AT+IPR=19200"); 
  delay(100);
  ShowSerialData();
  mySerial.print("AT+CPIN="); 
  mySerial.println(SIM_PIN_CODE);
  delay(1000);
  ShowSerialData();
  Serial.println("done.");
  break;


} 

if (mySerial.available())
Serial.write(mySerial.read());
}

///SendTextMessage()
///this function is to send a sms message
void SendTextMessage()
{
Serial.println(“call SendTextMessage”);

mySerial.print(“AT+CMGF=1\r”); //Because we want to send the SMS in text mode
delay(100);
ShowSerialData();

mySerial.println(“AT + CMGS = “+336637*****””);//send sms message, be careful need to add a country code before the cellphone number
delay(100);
ShowSerialData();
mySerial.println(“Hello World !”);//the content of the message
delay(100);
ShowSerialData();
mySerial.println((char)26);//the ASCII code of the ctrl+z is 26
delay(100);
mySerial.println();
Serial.println(“SMS is ‘send’”);
}

void ShowSerialData()
{
while(mySerial.available()!=0)
Serial.write(mySerial.read());
}

[/code]

if i use serial port and our script “Serial Relay”, i obtain “nothing”… No response Write in MCU51, but i can set and send my AT commands et my sms is send. But i have a white screen in mcu51 for all command send…

i found this post :

viewtopic.php?p=15275#p15275.

what must i do ? cut the pin 7 on the gprs shield ? and connect pin 7 from shield to pin 10 of the mega?

ok all is fine !

on mega R3 we must adapt the code of SoftwareSerial and change pin 7 (rx) to pin 10 (or other rx pin of the mega R3 ).
So you must wire the gprs shield pin 7 to an rx pin of megaR3 (in my example : pin 10, so i wire it on the gprs shield).

i’ve not cut the shield pin 7, just “twist” it :

yes,your are right.If you want to use GPRS shield with Mega,you need to modify your program and schematic. 1)Program:SoftwareSerial GPRS(7,8)----SoftwareSerial GPRS(10,11); 2)You need connect pin-7 to pin-10(pin-8 to pin-11) by jumper wire.Because of not all pins on the Mega and Mega 2560 support change interrupts.

:wink:

In another forum (arduino.cc/forum/index.php?topic=140429.0) somebody posted a solution that is a bit more charming then bending the pin 7: replacing one of the jumpers with a wire.

He shared the schematic on docs.google.com/drawings/d/1klb … edit?pli=1
I prefer that solution.

Thanks for sharing.