Icomsat 1.1 and Arduino Mega

Hi,

I'm trying to use a Arduino Mega and a icomsat 1.1 GSM Module (http://www.dx.com/p/gsm-gprs-sim900-module-icomsat-expansion-board-w-antenna-cable-for-arduino-blue-black-220631#.VI7vJCvF-oM)

Unfortunately it's not working out like I hoped. Even google didn't help me out.

Can anybody please explain to my how to use these components (wiring and code)?

Thanks in advance.

Bart

Take a look at the example in my signature. It can be adapted to suit the IComsat.

Hi Dannable,

Thanks for your reply!

Is it true that the shield will try to connect to the network as soon as power is available, even without code?

Bart

Yes it will. Providing it has a sim card in it of course!

Does it matters which provider you install?

One with network coverage in your area? I tried a few to see which gave me the best signal strength and use them on a pre-pay basis.

unfortunately only the red led (power) is on all others are dead...

Could the shield be dead??

Bart

When I say that it should start hunting for a network straight away, I assume you have turned it on, either by software control or by switch?

You should have a power led, an 'on' led, and a connection status led.

Ok, misunderstanding 8)

I will try that first :slight_smile:

Bart

Hi,

In the meanwhile I was testing further and the shield is connecting to the network but the below code isn't working.

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

void setup()
{
  // set up the digital pins to control
  Serial.begin(9600);
  Serial.println("Hello Computer");
  
  String outMessage = "Hello world!";
  String destinationNumber = "+xxxxxxxxx"; // in te vullen....

  // wake up the GSM shield
  Serial1.begin(9600);
  delay(30000); // give time to log on to network.
  if (Serial1) 
  {
    Serial.println("Serial 1 is open");
  }
  else
  {
    Serial.println("Serial 1 isn't open");
  }
  if (Serial1.available())
  {
    Serial.println("Serial 1 available");
  }
  else
  {
    Serial.println("Serial 1 NOT available");
  }
  
  // while(Serial1.available())
  while (Serial1)
    {
      buffer[count++]=Serial1.read();
      if(count == 64)break;
    }
     Serial.write(buffer,count);
  
  
  Serial1.print("AT+CMGF=1\r"); // set SMS mode to text
  delay(100);
  Serial1.print("AT+CNMI=2,2,0,0,0\r");
  // blurt out contents of new SMS upon receipt to the GSM shield's serial out
  delay(100);
  
  Serial1.print("AT+CMGF=1\r");
  delay(100);
  Serial1.println("AT + CMGS = \"" + destinationNumber +"\"");
  delay(100);
  Serial1.println(outMessage);
  delay(100);
  Serial1.println((char)26);//ctrl+z
  delay(100);
  Serial.println("The End!");
}

void loop()
{
 
}

Any suggestions?

Bart

String destinationNumber = "+xxxxxxxxx"; // in te vullen....

I presume you have changed that to a 'proper' number? Personally I like to see country + operator code even if the subscriber number is redacted.

Exactly how have you got it connected?

Off course I changed the x's with my subsciption number 8)

this is how I wired this.

Ok, it's a bit difficult to work out from the photo so I'm assuming pin 19 (Rx1) to modem TXD, pin 18 (Tx1) to RXD?

The following works for me:

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

void setup()
{
  // set up the digital pins to control
  Serial.begin(19200);
  Serial.println("Hello Computer");

  String outMessage = "Hello world!";
  String destinationNumber = "+447751123456"; // in te vullen....

  // wake up the GSM shield
  Serial1.begin(19200);
  delay(30000); // give time to log on to network.
  if (Serial1) 
  {
    Serial.println("Serial 1 is open");
  }
  else
  {
    Serial.println("Serial 1 isn't open");
  }
  if (Serial1.available())
  {
    Serial.println("Serial 1 available");
  }
  else
  {
    Serial.println("Serial 1 NOT available");
  }

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

  Serial1.print("AT+CMGF=1\r");
  delay(100);
  Serial1.println("AT + CMGS = \"" + destinationNumber +"\"");
  delay(100);
  Serial1.println(outMessage);
  delay(100);
  Serial1.println((char)26);//ctrl+z
  delay(100);
  Serial.println("The End!");
}

void loop()
{
}

Hi,

Did you test with the same shield?

Bart

Yes. IcomSat and Mega2560.

Hi Dannable,

First of all a Happy New Year!

After some weeks I started back with the project and this time with success :slight_smile:

Thanks for your support.

Bart

dannable:
Ok, it's a bit difficult to work out from the photo so I'm assuming pin 19 (Rx1) to modem TXD, pin 18 (Tx1) to RXD?

The following works for me:

unsigned char buffer[64];  // buffer array for data receive over serial port

int count=0;              // counter for buffer array

void setup()
{
  // set up the digital pins to control
  Serial.begin(19200);
  Serial.println("Hello Computer");

String outMessage = "Hello world!";
  String destinationNumber = "+447751123456"; // in te vullen....

// wake up the GSM shield
  Serial1.begin(19200);
  delay(30000); // give time to log on to network.
  if (Serial1)
  {
    Serial.println("Serial 1 is open");
  }
  else
  {
    Serial.println("Serial 1 isn't open");
  }
  if (Serial1.available())
  {
    Serial.println("Serial 1 available");
  }
  else
  {
    Serial.println("Serial 1 NOT available");
  }

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

Serial1.print("AT+CMGF=1\r");
  delay(100);
  Serial1.println("AT + CMGS = "" + destinationNumber +""");
  delay(100);
  Serial1.println(outMessage);
  delay(100);
  Serial1.println((char)26);//ctrl+z
  delay(100);
  Serial.println("The End!");
}

void loop()
{
}

dannable:
Ok, it's a bit difficult to work out from the photo so I'm assuming pin 19 (Rx1) to modem TXD, pin 18 (Tx1) to RXD?

The following works for me:

unsigned char buffer[64];  // buffer array for data receive over serial port

int count=0;              // counter for buffer array

void setup()
{
  // set up the digital pins to control
  Serial.begin(19200);
  Serial.println("Hello Computer");

String outMessage = "Hello world!";
  String destinationNumber = "+447751123456"; // in te vullen....

// wake up the GSM shield
  Serial1.begin(19200);
  delay(30000); // give time to log on to network.
  if (Serial1)
  {
    Serial.println("Serial 1 is open");
  }
  else
  {
    Serial.println("Serial 1 isn't open");
  }
  if (Serial1.available())
  {
    Serial.println("Serial 1 available");
  }
  else
  {
    Serial.println("Serial 1 NOT available");
  }

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

Serial1.print("AT+CMGF=1\r");
  delay(100);
  Serial1.println("AT + CMGS = "" + destinationNumber +""");
  delay(100);
  Serial1.println(outMessage);
  delay(100);
  Serial1.println((char)26);//ctrl+z
  delay(100);
  Serial.println("The End!");
}

void loop()
{
}

Hi dannable,

How to solve if the serial1 is not available.