arduino-libraries / MKRGSM

GNU Lesser General Public License v2.1
54 stars 51 forks source link

ARDUINO MKR 1400 is Slow / Unreliable when using the SMS.available() function #128

Open per1234 opened 3 years ago

per1234 commented 3 years ago

Moved from https://github.com/arduino/Arduino/issues/9782 by @Kevin-a69

I am currently experiencing a significant performance issue on the Arduino MKR 1400 regarding its handling of SMS incoming messages using the "available()" function.

For some reason there are major delays in receiving the SMS messages whenever multiple SMS are sent to the MKR 1400

I am using a slightly modified version of the ReceiveSMS (example sketch) to demonstrate the issue. The original example setup() is unchanged

Here is the modified main loop :

void loop() {
  if (sms.available())  {
    sms.peek();
    while (! sms.ready()) {
      delay(100);
    }

    sms.flush();

    while (! sms.ready()) {
      delay(100);
    }

    Serial.println("MESSAGE RECEIVED");
  }
}

So for example I would send 5 short SMS to the MKR 1400 (each one right after the other )

Then on my PC's serial monitor I would see the first message come in and then some seconds after the 2nd SMS would show up and then several seconds after the 3rd would show and then sometimes the other 2 messages take quite long or sometimes aren't even received.

AND if I take that same telephone SIM and place it in a cellphone and I repeat the same 5 SMS tests ...... ALL 5 SMS would be instantly received on the cellphone without ANY delay.
Therefore it is definitely not an issue with the GSM service provider.

I just can't figure out what could be causing such large delays on the MRK 1400 board when handling the incoming SMS but it is a real show stopper for the application I am developing. AND considering that I purchased this board specifically for working with incoming/outgoing SMS

I have not tested to see if there are also problems sending out SMS At this time my first hurdle is getting this MRK 1400 board to instantly and reliably function using the SMS.available() function OR SOME OTHER WAY.

I could not find any solution for this problem within the https://forum.arduino.cc (recommended by Arduino) I have posted several times there in the past weeks and have gotten no response on this matter.

Therefore I am posting the issue here HOPING that I can get some EXPERT assistance/guidance on this matter.

per1234 commented 3 years ago

There was additional discussion on the original issue which seems irrelevant so I have opted to not transfer it.