GSM testing error

i am in one trouble and need quick solution.
when i am connecting my GSM sim900 with arduino then in serial monitor it shows the error and it shows

'Starting modem test...ERROR, no modem answer.
Checking IMEI...Error: Could not get IMEI'

i have connected Tx pin of GSM with Tx1 pin(pin no.18) of arduino and Rx pin of GSM with Rx1 pin (pin no. 19). please give suggestions as fast as possible. Also guide me for the connections if i have done the wrong connection.

Code?

Link to hardware?

This example tests to see if the modem of the
GSM shield is working correctly. You do not need
a SIM card for this example.

Circuit:

  • GSM shield attached

Created 12 Jun 2012
by David del Peral
modified 21 Nov 2012
by Tom Igoe

This sample code is part of the public domain

*/

// libraries
#include <GSM.h>

// modem verification object
GSMModem modem;

// IMEI variable
String IMEI = "";

void setup()
{
// initialize serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}

// start modem test (reset and check response)
Serial.print("Starting modem test...");
if(modem.begin())
Serial.println("modem.begin() succeeded");
else
Serial.println("ERROR, no modem answer.");
}

void loop()
{
// get modem IMEI
Serial.print("Checking IMEI...");
IMEI = modem.getIMEI();

// check IMEI response
if(IMEI != NULL)
{
// show IMEI in serial monitor
Serial.println("Modem's IMEI: " + IMEI);
// reset modem to check booting:
Serial.print("Resetting modem...");
modem.begin();
// get and check IMEI one more time
if(modem.getIMEI() != NULL)
{
Serial.println("Modem is functoning properly");
}
else
{
Serial.println("Error: getIMEI() failed after modem.begin()");
}
}
else
{
Serial.println("Error: Could not get IMEI");
}
// do nothing:
while(true);
}

linked with arduino mega 2560
And icomsat 1.1 GSM 900

wpid-DSC09936.jpg

What changes have you made to enable that sketch to use Serial1? I suspect that that is the example provided with the IDE which is intended for use with the official Arduino GSM shield.

You don't seem to want to tell me which shield you are using so I'll give you a generic suggestion: remove all the Rx/Tx -> pin selection jumpers from the shield. Then jumper from the Tx and Rx pins to 18 and 19 on your Mega (I assume that's what you are using - again you're keeping that secret). Then use the SerialRelay for the Mega which I have listed below:

void setup()
{
  Serial1.begin(19200);
  Serial.begin(19200);
}

void loop()
{
  if (Serial1.available())
  {
    while(Serial1.available())
    {
      buffer[count++]=Serial1.read();
      if(count == 64)break;
    }
    Serial.write(buffer,count);
    clearBufferArray();
    count = 0;
  }
  if (Serial.available())
    Serial1.write(Serial.read());
}

void clearBufferArray()
{
  for (int i=0; i<count;i++)
  {
    buffer[i]=NULL;
  }
}

Type AT in capital letters and you should get a response. If not try crossing the jumper wires over.

If you want to see the IMEI number then type AT+GSN

i have applied your code but still error is showing which is " buffer was not declared in this scope"

Whoops. Add the following at the top of the sketch:

unsigned char buffer[64];  // buffer array for data receive over serial port
int count=0;               // counter for buffer array

what show in serial monitored?

Also send the code for sms send.

Type AT and press 'Send'. You should get some response.

PLESE , SEND THE CODE FOR SENDING THE SMS.

If you wish to commission someone to write your code for you then you need to be 'advertising' in the Gigs and Collaborations section.

i m not take commission for the code. i m working on smart energy meter projects. so i required