GSRS/GSM problem

Hello,

I am using the gprs shield v1.0 with crowduino v1.0 and I wish to send an SMS using it. This is the link to shield :
http://www.elecrow.com/arduino-compatiable-c-109/shield-c-109_110/gprsgsm-shield-for-arduino-p-325.html , and this is the link to the crowduino http://www.elecrow.com/arduino-compatiable-c-109/micro-controller-c-109_117/crowduino-with-atmega-328-p-338.html .It has Arduino Uno pin layout and dimensions but it inherits all the Duemilanuve features + it has a Bee Shield (i dont know what to do with it).

i am using Arduino IDE 1.05
I use the latest GSM library 3.05 Google Code Archive - Long-term storage for Google Code Project Hosting.
The status led blinks at the rate of 64ms On/3000ms Off, no PIN for my SIM card. I am from Romania , Cosmote network so the shield should cover the network frequency, right?

I have tested the crowduino with some examples and it works fine. I just cant seem to get this shield to do anything.
With the GsmScanNetwork example code I get: GSM networks scanner, thats it , i waited for a while and nothing happened.

// libraries
#include <GSM.h>

// PIN Number
#define PINNUMBER ""

// initialize the library instance
GSM gsmAccess(true);     // include a 'true' parameter to enable debugging
GSMScanner scannerNetworks;
GSMModem modemTest;

// Save data variables
String IMEI = "";

// serial monitor result messages
String errortext = "ERROR";

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
  }

  Serial.println("GSM networks scanner");
  scannerNetworks.begin();
  
  // connection state
  boolean notConnected = true;
  
  // Start GSM shield
  // If your SIM has PIN, pass it as a parameter of begin() in quotes
  while(notConnected)
  {
    if(gsmAccess.begin(PINNUMBER)==GSM_READY)
      notConnected = false;
    else
    {
      Serial.println("Not connected");
      delay(1000);
    }
  }
  
  // get modem parameters
  // IMEI, modem unique identifier
  Serial.print("Modem IMEI: ");
  IMEI = modemTest.getIMEI();
  IMEI.replace("\n","");
  if(IMEI != NULL)
    Serial.println(IMEI);
}

void loop()
{
  // scan for existing networks, displays a list of networks
  Serial.println("Scanning available networks. May take some seconds.");
  Serial.println(scannerNetworks.readNetworks());
  
    // currently connected carrier
  Serial.print("Current carrier: ");
  Serial.println(scannerNetworks.getCurrentCarrier());
    
  // returns strength and ber
  // signal strength in 0-31 scale. 31 means power > 51dBm
  // BER is the Bit Error Rate. 0-7 scale. 99=not detectable
  Serial.print("Signal Strength: ");
  Serial.print(scannerNetworks.getSignalStrength());
  Serial.println(" [0-31]");

}

With the SendSMS example i get this on my serial monitor: SMS Messages Sender. nothing else.
I need help that is certain

Use this code to have a try. and if there is any problems you can also contact with techsupport[at]elecrow.com.

#include <SoftwareSerial.h>
#include <String.h>
#include <avr/pgmspace.h>

SoftwareSerial mySerial(7, 8);
unsigned char SigQ[50];
unsigned char SigQ1[5]={'a','a','a','a','a'};
int SIGQ=0;

/*
*********************************************************
setup()
*********************************************************
*/
void setup()
{
  mySerial.begin(19200);
  Serial.begin(19200);
  delay(500);
  pinMode(9, OUTPUT); 
  digitalWrite(9,LOW);
  delay(1000);
  digitalWrite(9,HIGH);
  delay(1500);
  digitalWrite(9,LOW);
  delay(2000);

  
//*******************************************************
//GetSignalQuality(); 
//*******************************************************
  for(int x=0;x<20;x++)
    {
   GetSignalQuality();   
    delay(800);
    for(int i=0;i<26;i++)
    {
   if(SigQ[i]==58)
   {    
     int j=0;
     int k=0;
     i++;i++;
     while((SigQ[i+j])!=44)
     {
      if((SigQ[i+j]>='0'&&SigQ[i+j]<='9'))  //>=48 <=57
      {
      SigQ1[j]=SigQ[i+j];     
       }
       j++;  //j=1
     }     
     SIGQ=SigQ1[0]-'0';
     
     if(j==2)
     {
     SIGQ=SIGQ*10+SigQ1[1]-'0';
     }  
   Serial.println(""); 
   Serial.print("SIGQ:");
   Serial.println(SIGQ);
     }  
   }
   if (SIGQ>=10)
   {
     break;
   }
   if(x==20)
   {
    Serial.print("The Signal Quality is poor!");
   }
   } 
//*******************************************************
///SendTextMessage()
///this function is to send a sms message
//*******************************************************
SendTextMessage();
}
   void loop()
   {
 while(mySerial.available()!=0)
 Serial.write(mySerial.read());
 delay(10);
   }
   
//*******************************************************
//DialVoiceCall(); 
//call  a numuber
//*******************************************************
void DialVoiceCall()
{
  mySerial.println("ATDxxxx;");//dial the number, xxxx ix the phone number.
  delay(100);
  mySerial.println();
}


//*******************************************************
///SendTextMessage()
///this function is to send a sms message
//*******************************************************
void SendTextMessage()
{
  mySerial.print("AT+CMGF=1\r");    //Because we want to send the SMS in text mode
  delay(100);
  mySerial.println("AT + CMGS = \"+xxxx\"");//send sms message,xxxx is the telephone number,  be careful need to add a country code before the cellphone number
  delay(100);
  mySerial.println("GSM test message!");//the content of the message
  delay(100);
  mySerial.println((char)26);//the ASCII code of the ctrl+z is 26
  delay(100);
  mySerial.println();
}


//*******************************************************
  //GetSignalQuality();
//*******************************************************

void GetSignalQuality()
{
  mySerial.println("AT+CSQ");  //get the signal Quality
  delay(100);
  int k=0;
  while(mySerial.available()!=0)
  {     
    SigQ[k]=mySerial.read();  
    Serial.write(SigQ[k]);
    k+=1;
  }
}

First of all i want to thank you for answering me.
I entered your code this is what i get on my serial monitor:
ÿÿÿÿÿÿ
AT+CSQ

+CSQ: 0,0

OK

SIGQ:0
AT+CSQ

+CSQ: 0,0

OK

SIGQ:0
AT+CSQ

+CSQ: 0,0

OK

SIGQ:0
AT+CSQ

+CSQ: 10,0

OK

SIGQ:10
AT+CMGF=1

OK
AT + CMGS = "0040785876307"

GSM test messa
+CMGS: 84

OK

THANKS x 1 milion

+CSQ: 10,0
10 is the signal quality, the MAX is 32.

Did you receive the SMS by the phone?

For the code,you can visit here learn more about it.
http://www.elecrow.com/wiki/index.php?title=GPRS/GSM_Shield_v1.0

Sorry for the late response. Yes i received the message on the phone. Now i am trying to read a SMS from my phone, i think i got it.

Hi,
can i use the program given for GSM shield for testing GPRS in below link for SIM900

I think it's the same. But you need to test it yourself.

Hi,
help me for writing code for GPRS using HTTP protocol for accessing internet using SIM900 modem.
:roll_eyes:

http://www.elecrow.com/wiki/index.php?title=GPRS/GSM_Shield_v1.0#A_Simple_Source_Code_Example

The function SubmitHttpRequest() is to visit www.google.com, you can change the URL as you want to visit.

learn more you can watch the AT commands. There are a lot of AT commands, so it's a little hard.

Hi,
thank you for your reply....
one more thing i wanna know how can i Access internet if m directly connecting the board to PC, i.e i wanna take net in PC using GSM modem. :roll_eyes:

Sorry, I don't know how to take net in PC using GSM modem. If you find out the result, please tell me.
Thanks.

Hi
The code runs through the SMS part but I receive no SMS on my phone? How do I know that I have connection with the SIM908? I have GPRS on a "Sim908-C EVB v1.0 DESIGNED BY UNV" with no documentation. I don't know which connections to make. Like on yours I'm testing 7 and 8. TX to 7 and RX to 8. It docent work so I test the other way around... docent work!? I know the SIM908 have contact with the mobile net (blinks every 3 sec.) I only have GPRS TX and RX, GPS TX and RX and GND and VCC to connect to the Arduino.

Any ideas on what to do? I would be glad just to be able to send a AT command and get a response back.

Olle

Olle

This actually caught me out first when I tried for first time to connect it all.

The Pins 7 & 8 are RX and TX on the Arduino Board. The RX and TX on the GPRS/GSM Sheild I used are Pins 0 & 1.

So Pin 7 from Arduino goes to PIN 0 on GSM Sheild
Pin 8 from Arduino goes to PIN 1 on GSM Sheild

For Mine to work the Jumpers on GSM sheild are set to Softserial

And of course connect the GND to GND for common GND.


In the Code Make sure

#include <SoftwareSerial.h>

SoftwareSerial SIM900(7, 8 ) ; // tells Arduino what pins to use for RX and TX

Regards

Ian