0

I use SIM800L GSM module to detect incoming calls and generally it works fine. The only problem is that sometimes it takes up to 8 RINGS before the GSM module tells arduino that someone is calling (before RING appears on the serial connection). It looks like a GSM Network congestion but I do not have such issues with normal calls (I mean calls between people). It happens to often - so it cannot be network/Provider overload. Does anybody else had such a problem? ISP/Provider: Plus GSM in Poland

I don't put any code, because the problem is in different layer I think

  • Recommend posting here too: https://arduino.stackexchange.com – Blundering Philosopher Jun 20 '19 at 07:09
  • It may be in sleep mode 2. The module takes time (+/- 5seconds) to wake up when in sleep mode. Disable sleep mode or try mode 1. What sleep mode are you using? Without code I can not help you. – Gerhard Jun 20 '19 at 09:46

2 Answers2

0

sorry that I didn't answer earlier. I've tested it and it turned out that in bare minimum code it worked OK! I mean, I can see 'RING' on the serial monitor immediately after dialing the number. So it's not a hardware issue!

//bare minimum code:
void loop() {
  if(serialSIM800.available()){
    Serial.write(serialSIM800.read());
  }
  if(Serial.available()){    
    serialSIM800.write(Serial.read());
  }
}

In my real code I need to compare calling number with the trusted list. To do that I saved all trusted numbers in the contact list on the sim card (with the common prefix name 'mytrusted'). So, in the main loop there's if statement:

   while(mySerial.available()){
     incomingByte = mySerial.read();
     inputString += incomingByte;

   }

   if (inputString.indexOf("mytrusted") > 0){
    isTrusted = 1;
    Serial.println("A TRUSTED NUMBER IS CALLING");
   }

After adding this "if condition" Arduino sometimes recognize trusted number after 1'st call, and sometimes after 4'th or 5'th. I'm not suspecting the if statement itself , but the preceding while loop, where incoming bytes are combined into one string.

Any ideas, what can be improved in this simply code?

0

It seems, I found workaround for my problem. I just send a simple 'AT' command every 20 seconds to SIM800L (it replies with 'OK' ). I use timer to count this 20 seconds interval (instead of simply delay function)

TimerObject *timer2 = new TimerObject(20000); //AT command interval 
....
timer2->setOnTimer(&SendATCMD);  
....

void SendATCMD () {
  mySerial.println("AT");
  timer2->Stop();
  timer2->Start();
 }

With this simple modification Arduino always sees incoming call immediately (after 1 ring)