MKR GSM 1400 while using MKRGSM.h could be easily crashed by anyone by simply sending SMS messages like.
"OK"
"ERROR"
"NO CARRIER"
The problem lies in Modem.cpp
int responseResultIndex = _buffer.lastIndexOf("OK\r\n");
if (responseResultIndex != -1) {
_ready = 1;
}
.. same problem with indexing words ERROR and NO CARRIER
AT command notify a new message- and code will consider OK in the message as AT command response before receiving full message from the buffer.
+CMGL: 18,"REC UNREAD","+XXXXXXXX",,"19/11/25,19:59:43+08"
OK
// CRASH...
Correct would be wait for the AT response OK like below
+CMGL: 18,"REC UNREAD","+XXXXXXXX",,"19/11/25,19:59:43+08"
OK
OK