Arduino Forum upgrade scheduled for Monday, October 20th, 11am-4pm (CEST). Sorry for the inconvenience!
Pages: [1]   Go Down
Author Topic: GSRS/GSM problem  (Read 12192 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 https://code.google.com/p/gsm-shield-arduino/downloads/list
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.


Code:
// 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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 36
it's time to...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Use this code to have a try. and if there is any problems you can also contact with techsupport[at]elecrow.com.
Code:
#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;
  }
}

« Last Edit: June 18, 2013, 08:42:46 pm by Jackman » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: June 11, 2013, 06:15:07 am by AlexChirica » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 36
it's time to...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Did you receive the SMS by the phone?
« Last Edit: June 12, 2013, 09:17:37 am by Jackman » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 36
it's time to...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: June 15, 2013, 03:24:02 pm by AlexChirica » Logged

Kerala
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

http://arduino.cc/en/Tutorial/GSMToolsTestGPRS
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 36
it's time to...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Kerala
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
 help me for writing code for GPRS using HTTP protocol for accessing internet using SIM900 modem.
  smiley-roll
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 36
it's time to...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
http://www.elecrow.com/wiki/images/a/a8/SIM900_AT_Command_Manual_V1.03.pdf
Logged

Kerala
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. smiley-roll
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 36
it's time to...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Arduino Forum upgrade scheduled for Monday, October 20th, 11am-4pm (CEST). Sorry for the inconvenience!
Jump to: