tuongnq / gsm-shield-arduino

Automatically exported from code.google.com/p/gsm-shield-arduino
0 stars 0 forks source link

GSM Shield cannot send but can receive SMS #28

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?
This appears in the Serial Monitor:

GSM Shield testing.
DB:ELSE
DB:ELSE
DB:ELSE
DB:CORRECT BR

status=READY
DEBUG:SMS TEST
DEBUG:>

SMS sent OK

Which is as it should be...the problem is I cannot receive the sample SMS given 
in GSM_GPRSLibrary_SMS example sketch.

What version of the product are you using? On what operating system?
I am using the open-electronics Arduino GSM/GPRS Shield for SIM900. I am using 
Arduino 1.0 on Windows 7 64-bit Home Premium.

Please provide any additional information below.
I have already changed the necessary pins for the software serial. I can 
already receive SMS but still cannot send.

Original issue reported on code.google.com by JRVillan...@gmail.com on 16 May 2012 at 7:52

GoogleCodeExporter commented 8 years ago
Seems everything is ok.
Strange, the library doesn't check the status network or credit. Are you sure 
that you have signal and credit? For signal try to call yourself when you have 
the SIM inside the module. For credit you should know :D 
Another tip: If the led blinks at 1Hz the SIM is not registered on the network. 
If it blinks at approx 0.2Hz (5 secs interval) the SIM is registered

Original comment by martines...@gmail.com on 16 May 2012 at 5:31

GoogleCodeExporter commented 8 years ago
The SIM does have credit. I also tried calling the module using my own phone, 
and it was ringing, I guess that means the SIM is registered on the network. 
Also, I added a routine check of the the registration status:

#include "SIM900.h"
#include <SoftwareSerial.h>
//If not used, is better to exclude the HTTP library,
//for RAM saving.
//If your sketch reboots itself proprably you have finished,
//your memory available.
#include "inetGSM.h"

//If you want to use the Arduino functions to manage SMS, uncomment the lines 
below.
#include "sms.h"
SMSGSM sms;

//To change pins for Software Serial, use the two lines in GSM.cpp.

//GSM Shield for Arduino
//www.open-electronics.org
//this code is based on the example of Arduino Labs.

//Simple sketch to send and receive SMS.

int numdata;
boolean started=false;
char smsbuffer[160];
char inSerial[40];
char n[20];
boolean turnedON;

void setup() 
{
  //Serial connection.
  Serial.begin(9600);
  Serial.println("GSM Shield testing.");
  //Start configuration of shield with baudrate.
  //For http uses is raccomanded to use 4800 or slower.
  if (gsm.begin(2400)){
    Serial.println("\nstatus=READY");
    started=true;  
  }
  else Serial.println("\nstatus=IDLE");

  if(started){
    //Enable this two lines if you want to send an SMS.
    if (sms.SendSMS("639225025103", "Arduino SMS"))
      Serial.println("\nSMS sent OK");

  }

};

void loop() 
{
  if(started){
    //Read if there are messages on SIM card and print them.
    if (gsm.CheckRegistration())
    {
      Serial.println("-");
    }
    else
    {
      Serial.println("No Signal");
    }

    if(gsm.readSMS(smsbuffer, 160, n, 20))
    {
      Serial.println(n);
      Serial.println(smsbuffer); 
    }
    delay(1000);
  }
};

And yes, the led blinks in approximately 5 seconds interval as you have 
suggested.

Original comment by JRVillan...@gmail.com on 17 May 2012 at 7:54

GoogleCodeExporter commented 8 years ago
Are you using the country prefix in the number? If yes try without.
If you can check, did your company account to you the SMS's cost? 

Original comment by martines...@gmail.com on 17 May 2012 at 5:58

GoogleCodeExporter commented 8 years ago
Apparently I was using the country prefix number. I already changed it and I 
was able to send SMS already. Thank you very much for your help.

Original comment by JRVillan...@gmail.com on 18 May 2012 at 2:22

GoogleCodeExporter commented 8 years ago
Good :) you're welcome

Original comment by martines...@gmail.com on 18 May 2012 at 10:17

GoogleCodeExporter commented 8 years ago
The change for this is done now.

Original comment by martines...@gmail.com on 18 May 2012 at 10:17

GoogleCodeExporter commented 8 years ago
This issue section is not longer supported.
Please check the support page www.gsmlib.org 

Original comment by martines...@gmail.com on 6 Jul 2013 at 11:27