Problem of AT commands in Arduino Mega 2560 and GPRS Shield - EFCom

Hey,
I connected together Arduino Mega 2560 and GPRS Shield - EFcom in ports 15,14 (rx,tx) and I wrote this code:

include <SoftwareSerial.h>

SoftwareSerial se(15,14);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
while(!Serial);
se.begin(9600);

}

void loop() {
// put your main code here, to run repeatedly:
int readByte;
se.println(“AT”);
delay(2000);
Serial.println(se.read());

}

Serial prints -1 - something else returned. All the lights in GSM are ON mode. Whats another reasons of problem? I don’t know how to solve it.

Why are you using SoftwareSerial on the Mega, when you have three unused hardware serial ports?

Why are you trying to read data without seeing if there is anything available() to read?

Where is the link to the hardware you are trying to write to/read from?

Where is the schematic, or even photo, showing how the device is connected?

Why are you using SoftwareSerial on the Mega, when you have three unused hardware serial ports?

Why are you trying to read data without seeing if there is anything available() to read?

I used SoftwareSerial class in order to print to command “AT” in order to check to connection between the GSM and Arduino. I also used the available() , but I wanted to check why the condition with using available method didn’t work (something like:

{
if(se.available()>0)
{
// do something
}

}

if I will use the HardwareSerial library, can I send AT commands to GSM?

pictures.pdf (471 KB)