Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

SIM900 Network Registration takes a long time

Status
Not open for further replies.

quique123

Newbie level 1
Joined
Oct 12, 2016
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
20
I have this SIM900 module from sainsmart:

https://www.sainsmart.com/sim900-gp...-module-kit-for-arduino-high-quality-new.html

When I use it with a MEGA and the library from MarcoMartines here at github:

https://github.com/MarcoMartines/GSM-GPRS-GPS-Shield

That sketch has this method in it:

Code:
  if (gsm.begin(9600)) {
    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(number, "answer me"))
      Serial.println("\nSMS sent OK");
   }

the sendsms function() works fine and sends the sms in about 1-2 minutes after powering up when loaded onto the MEGA.

I have tried sending the sms from a nano with the same library & using AT commands but it fails, meaning the sms is never received. The AT commands I used are:

Code:
  sim900.begin(9600);
  delay(10000);
  sim900.print("\r");
  delay(1000); //Wait for a second while the modem sends an "OK"
  sim900.print("AT+CMGF=1\r"); //text mode
  delay(1000);
  sim900.print("AT+CMGS=\"+504mynumber\"\r");
  delay(1000);
  sim900.print("SIM900 and Arduino say Hi!\r"); //The text for the message
  delay(1000);
  sim900.write(0x1A); //Equivalent to sending Ctrl+Z


After some messing around with the at commands I noticed that the SIM takes a while to register on the network and Im wondering how to fix it. Obviously the Mega/Library sketch makes the module register fast enough to have it send the sms. I posted my results here:

https://forum.arduino.cc/index.php?topic=427874.msg2957886#msg2957886

Basically if I let the module sit about 10 minutes after powering up, it registers on the network, gives me a Call Ready log and then Im able to enter those same AT commands and the sms is sent successfully. So I need to discover what it is that the github library does to make the sim register so I can send the at commands from the nano and have them work!

I came to this forum because of this thread:
https://www.edaboard.com/threads/299832/
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top