I have been able to reproduce this problem using tried and proven example sketch LTE_Demo.Using LTE_Demo,
void loop() {
Serial.print(F("Modem> "));
while (! Serial.available() ) {
if (modem.available()) {
Serial.write(modem.read());
}
}
I sent SMS "10:52" at 10:52am and successfully got an immediate serial response:
10:52:44.192 -> +CMTI: "SM",0
I noticed this response is different from the typical response I get from my sketch:
if ((modem.available()) || (smsnum > 0)) { //any data available from the modem?
if (smsnum > 0) {
Serial.println(F("\n\n\n\n\nChecking for More ==========================================================================="));
}
else {
Serial.println(F("\n\n\n\n\nFound Something New ========================================================================="));
Serial.write(modem.read());
}
10:46:14.960 -> Found Something New =========================================================================
10:46:15.061 ->
---> AT+CMGF=1
10:46:15.094 -> <--- OK
10:46:15.128 -> ---> AT+CPMS?
10:46:15.163 -> <--- +CPMS: "SM",1,30,"SM",1,30,"SM",1,30
10:46:15.229 -> 1 SMS's on SIM card
10:46:15.229 -> ---> AT+CMGF=1
10:46:15.262 -> <--- OK
10:46:15.294 -> ---> AT+CSDH=1
10:46:15.294 -> <--- OK
10:46:15.328 -> ---> AT+CMGR=0
10:46:15.446 -> +CMGR: "REC UNREAD","+19252345805",,"24/02/19,10:46:12-32",145,4,0,0,"+14054720103",145,5
10:46:15.511 -> Found SMS: #0
Why the difference?To investigate this I sent LTE_Demo "10:59" at 10:59am and did not get a response.
And I sent another at "11:02" and did not get a response.
And I sent another at "11:13" and did not get a response.
So that's 1 successful, and 3 unsuccessful without any deletes.
I was very pleased to see that I reproduced the problem using the example sketch rather than my weather station sketch
I tried serial commands R and N to confirm, then at 11:46 the 3 came rolling in, and I was able to read all 3 with serial command R.
10:52:26.249 -> Modem>
10:52:44.192 -> +CMTI: "SM",0
10:54:08.593 -> N
10:54:08.626 -> ---> AT+CMGF=1
10:54:08.626 -> <--- OK
10:54:08.660 -> ---> AT+CPMS?
10:54:08.737 -> <--- +CPMS: "SM",1,30,"SM",1,30,"SM",1,30
10:54:08.770 -> 1 SMS's on SIM card!
10:54:08.810 -> Modem> N
10:59:31.884 -> ---> AT+CMGF=1
10:59:31.884 -> <--- OK
10:59:31.960 -> ---> AT+CPMS?
10:59:31.991 -> <--- +CPMS: "SM",1,30,"SM",1,30,"SM",1,30
10:59:32.067 -> 1 SMS's on SIM card!
10:59:32.067 -> Modem> N
11:00:39.268 -> ---> AT+CMGF=1
11:00:39.268 -> <--- OK
11:00:39.342 -> ---> AT+CPMS?
11:00:39.375 -> <--- +CPMS: "SM",1,30,"SM",1,30,"SM",1,30
11:00:39.449 -> 1 SMS's on SIM card!
11:00:39.449 -> Modem> R
11:00:55.778 -> ---> AT+CMGF=1
11:00:55.822 -> <--- OK
11:00:55.868 -> ---> AT+CPMS?
11:00:55.899 -> <--- +CPMS: "SM",1,30,"SM",1,30,"SM",1,30
11:00:55.934 ->
11:00:55.934 ->
Reading SMS #0
11:00:55.967 -> ---> AT+CMGF=1
11:00:55.967 -> <--- OK
11:00:56.001 -> ---> AT+CSDH=1
11:00:56.032 -> <--- OK
11:00:56.032 -> ---> AT+CMGR=0
11:00:56.151 -> +CMGR: "REC UNREAD","+19252345805",,"24/02/19,10:52:42-32",145,4,0,0,"+12063130055",145,5
11:00:56.249 -> 10:52
11:00:56.249 -> ***** SMS #0 (5) bytes *****
11:00:56.282 -> 10:52
11:00:56.319 -> *****
11:00:56.319 -> Modem> R
11:02:07.550 -> ---> AT+CMGF=1
11:02:07.550 -> <--- OK
11:02:07.626 -> ---> AT+CPMS?
11:02:07.661 -> <--- +CPMS: "SM",1,30,"SM",1,30,"SM",1,30
11:02:07.693 ->
11:02:07.693 ->
Reading SMS #0
11:02:07.726 -> ---> AT+CMGF=1
11:02:07.726 -> <--- OK
11:02:07.759 -> ---> AT+CSDH=1
11:02:07.791 -> <--- OK
11:02:07.791 -> ---> AT+CMGR=0
11:02:07.905 -> +CMGR: "REC READ","+19252345805",,"24/02/19,10:52:42-32",145,4,0,0,"+12063130055",145,5
11:02:08.004 -> 10:52
11:02:08.004 -> ***** SMS #0 (5) bytes *****
11:02:08.037 -> 10:52
11:02:08.074 -> *****
11:02:08.074 -> Modem> 1
11:04:01.515 -> ---> AT+CPSI?
11:04:01.628 -> <--- +CPSI: LTE CAT-M1,Online,310-260,0x411F,21294086,47,EUTRAN-BAND12,5035,2,2,-10,-85,-62,16
11:04:01.726 -> ---> AT+COPS?
11:04:01.726 -> <--- +COPS: 0,0,"T-Mobile",7
11:04:01.760 -> Modem> n
11:04:15.050 -> ---> AT+CGREG?
11:04:15.084 -> <--- +CGREG: 0,1
11:04:15.084 -> Network status 1: Registered (home)
11:04:15.117 -> Modem> N
11:13:49.472 -> ---> AT+CMGF=1
11:13:49.472 -> <--- OK
11:13:49.547 -> ---> AT+CPMS?
11:13:49.583 -> <--- +CPMS: "SM",1,30,"SM",1,30,"SM",1,30
11:13:49.615 -> 1 SMS's on SIM card!
11:13:49.655 -> Modem> N
11:25:10.182 -> ---> AT+CMGF=1
11:25:10.182 -> <--- OK
11:25:10.259 -> ---> AT+CPMS?
11:25:10.292 -> <--- +CPMS: "SM",1,30,"SM",1,30,"SM",1,30
11:25:10.325 -> 1 SMS's on SIM card!
11:25:10.367 -> Modem>
11:46:55.752 -> +CMTI: "SM",1
11:46:59.905 ->
11:46:59.905 -> +CMTI: "SM",2
11:48:07.391 ->
11:48:07.391 -> +CMTI: "SM",3
12:11:51.576 -> N
12:11:51.609 -> ---> AT+CMGF=1
12:11:51.609 -> <--- OK
12:11:51.684 -> ---> AT+CPMS?
12:11:51.720 -> <--- +CPMS: "SM",4,30,"SM",4,30,"SM",4,30
12:11:51.752 -> 4 SMS's on SIM card!
12:11:51.790 -> Modem> R
12:11:54.549 -> ---> AT+CMGF=1
12:11:54.588 -> <--- OK
12:11:54.633 -> ---> AT+CPMS?
12:11:54.670 -> <--- +CPMS: "SM",4,30,"SM",4,30,"SM",4,30
12:11:54.701 ->
12:11:54.701 ->
Reading SMS #0
12:11:54.734 -> ---> AT+CMGF=1
12:11:54.734 -> <--- OK
12:11:54.769 -> ---> AT+CSDH=1
12:11:54.801 -> <--- OK
12:11:54.801 -> ---> AT+CMGR=0
12:11:54.914 -> +CMGR: "REC READ","+19252345805",,"24/02/19,10:52:42-32",145,4,0,0,"+12063130055",145,5
12:11:55.012 -> 10:52
12:11:55.012 -> ***** SMS #0 (5) bytes *****
12:11:55.045 -> 10:52
12:11:55.045 -> *****
12:11:55.078 ->
12:11:55.078 ->
Reading SMS #1
12:11:55.078 -> ---> AT+CMGF=1
12:11:55.111 -> <--- OK
12:11:55.111 -> ---> AT+CSDH=1
12:11:55.144 -> <--- OK
12:11:55.144 -> ---> AT+CMGR=1
12:11:55.267 -> +CMGR: "REC UNREAD","+19252345805",,"24/02/19,10:59:55-32",145,4,0,0,"+14054720055",145,5
12:11:55.365 -> 10:59
12:11:55.365 -> ***** SMS #1 (5) bytes *****
12:11:55.398 -> 10:59
12:11:55.398 -> *****
12:11:55.430 ->
12:11:55.430 ->
Reading SMS #2
12:11:55.430 -> ---> AT+CMGF=1
12:11:55.463 -> <--- OK
12:11:55.463 -> ---> AT+CSDH=1
12:11:55.496 -> <--- OK
12:11:55.496 -> ---> AT+CMGR=2
12:11:55.622 -> +CMGR: "REC UNREAD","+19252345805",,"24/02/19,11:02:46-32",145,4,0,0,"+12063130079",145,5
12:11:55.720 -> 11:02
12:11:55.720 -> ***** SMS #2 (5) bytes *****
12:11:55.754 -> 11:02
12:11:55.754 -> *****
12:11:55.786 ->
12:11:55.786 ->
Reading SMS #3
12:11:55.786 -> ---> AT+CMGF=1
12:11:55.819 -> <--- OK
12:11:55.819 -> ---> AT+CSDH=1
12:11:55.854 -> <--- OK
12:11:55.854 -> ---> AT+CMGR=3
12:11:55.971 -> +CMGR: "REC UNREAD","+19252345805",,"24/02/19,11:13:24-32",145,4,0,0,"+14054720103",145,5
12:11:56.069 -> 11:13
12:11:56.069 -> ***** SMS #3 (5) bytes *****
12:11:56.101 -> 11:13
12:11:56.101 -> *****
12:11:56.139 -> Modem>
Desperate for answers I went to my T-Mobile Carrier and verified the time stamp in the SMS content matched the carrier's historical record and it does. That is not to say that the SMS was delivered at that time. I will phone the carrier to learn if the historical record time stamp is when it was transmitted to the carrier, or when the carrier delivered it to the addressee.