MKR1400 GSM: receive SMS latency

Hello
I am using the MKR1400 as an SMS gateway. The goal is to receive a SMS and to do something as quickly as possible.

I have a setup with my MKR1400, a 2500mAh battery, the provided antenna, and a SIM card from a UK contractor.

I'm using the ReceiveSMS example without the delay(1000) to get it running as fast as possible but there's always a latency of 5 to 7 seconds between the moment where the SMS is sent from my phone to when it's received by the Arduino.

When I put the SIM card into a phone, it receives the SMS after around 3 seconds.

I looked inside the library but I couldn't find a delay or something blocking or slowing down the SMS fetching... Does anyone have a similar problem?

Thanks a lot!

Okay so I've figured it out, when communicating with the onboard SARA-U201 GSM module I've notice that the CNMI parameter was set to 1,0,0,0
AT+CNMI?
AT+CNMI=1,0,0,0

I did some research on general SMS settings and I found out that the CNMI needs to be configured to 1,2,0,0
AT+CNMI=1,2,0,0

I've setup up the Arduino to program this at the end of the setup function.
Then, when a SMS is received by the module, it is automatically transferred to the Arduino, usually within 4 seconds. I then wrote a piece of code that reads the GSMserial and parses the message to extract the content of the SMS and getting rid of the rest.

I assume that the sms.avaialble() was polling the GSM module at a regular interval, which is why it was way slower than this new configuration...

Hi there everyone,
I hope I can get some direction on the following related problem

I am using the MKR 1400 and it is working fine for me EXCEPT that for some reason there are major delays in receiving the SMS messages whenever they come in rapid sequence.

I am using a slightly modified version of the ReceiveSMS (example sketch) for this test.
The setup is unchanged
Here is the modified loop :

void loop() {
int c;

// If there are any SMSs available()
if (sms.available()) {
Serial.println("Message received from:");

// Get remote number
sms.remoteNumber(senderNumber, 20);
Serial.println(senderNumber);

sms.peek();
delay(100);
sms.flush();
delay(100);
Serial.println("MESSAGE DELETED");
}

sms.flush();
delay(1000);

}

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

Then on the 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 before they are 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 be received on the cellphone without practically ANY delay. Therefore it is definitely not an issue with the GSM service provider

I just cant figure out what could be causing such large delays on the MRK 1400 board BUT it is really a show stopper for the application I need to run on it.

Any assistance on this matter will be greatly appreciated.