Go Down

Topic: GSRS/GSM problem (Read 18093 times) previous topic - next topic

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: [Select]

// 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

Jackman

#1
Jun 11, 2013, 05:29 am Last Edit: Jun 19, 2013, 03:42 am by Jackman Reason: 1
Use this code to have a try. and if there is any problems you can also contact with techsupport[at]elecrow.com.
Code: [Select]

#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;
 }
}


#2
Jun 11, 2013, 01:06 pm Last Edit: Jun 11, 2013, 01:15 pm by AlexChirica Reason: 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

Jackman

#3
Jun 12, 2013, 04:04 am Last Edit: Jun 12, 2013, 04:17 pm by Jackman Reason: 1
+CSQ: 10,0
10 is the signal quality, the MAX is 32.

Did you receive the SMS by the phone?

Jackman

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

#5
Jun 15, 2013, 06:13 pm Last Edit: Jun 15, 2013, 10:24 pm by AlexChirica Reason: 1
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.

jithu

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

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

Jackman

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

jithu

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

Jackman

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

jithu

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:

Jackman

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

ollemagnusson

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

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy