I had similar issues yesterday, seems restart SARA-R410 module (or power cycling the whole board) helped.
As for the SMS I am a little bit clueless at the moment. What does debugging say?
Enabling debug:
NB nbAccess(true);
Elaborating details about SARA-R410 restart
GPRSUdpNtpClient.ino does not start.
Data-SIM only, verified to function with cell phone, PIN code disabled.
Starting Arduino GPRS NTP client.
AT
OK
AT+CMEE=0
OK
AT+CFUN=0
OK
AT+CPIN?
ERROR
AT+CPIN?
ERROR
// ...
With a endless AT+CPIN? ERROR loop, where the NB / Modem is not able to come out of it.
Also tried SIM back to phone, setting PIN code, same result.
TestModem.ino works fine.
Had ChatGPT to make a modified version of SerialSARAPassthrough.ino with some AT commands to get information.
/*
SerialSARAInfoReader sketch
This program sends AT commands to the SARA-R410 and retrieves
useful information about the modem and SIM card at startup.
Requirements:
- MKR NB 1500
- Antenna
- SIM card
Make sure the Serial Monitor is set to "Both NL and CR".
Based on SerialSARAPassthrough by Sandeep Mistry.
*/
// Baud rate for Serial and SerialSARA
unsigned long baud = 115200;
void setup() {
pinMode(SARA_RESETN, OUTPUT);
digitalWrite(SARA_RESETN, LOW);
// Power-on pulse
pinMode(SARA_PWR_ON, OUTPUT);
digitalWrite(SARA_PWR_ON, HIGH);
delay(150);
digitalWrite(SARA_PWR_ON, LOW);
Serial.begin(baud);
while (!Serial); // Wait until Serial is ready
SerialSARA.begin(baud);
delay(1000);
Serial.println("Starting SARA-R410 Modem Information Retrieval...");
delay(2000);
queryModemInfo();
}
void loop() {
if (Serial.available()) {
SerialSARA.write(Serial.read());
}
if (SerialSARA.available()) {
Serial.write(SerialSARA.read());
}
}
void sendATCommand(const char* command, unsigned long timeout) {
SerialSARA.println(command);
Serial.print(">> ");
Serial.println(command);
unsigned long startTime = millis();
while (millis() - startTime < timeout) {
if (SerialSARA.available()) {
Serial.write(SerialSARA.read());
}
}
Serial.println();
}
void queryModemInfo() {
Serial.println("Fetching modem and SIM information...");
sendATCommand("AT+CFUN=15", 2000); // Full reset
delay(5000); // Wait for restart
sendATCommand("ATI", 2000); // Module identification
sendATCommand("AT+GMM", 2000); // Model name
sendATCommand("AT+CGMI", 2000); // Manufacturer
sendATCommand("AT+CGMR", 2000); // Firmware version
sendATCommand("AT+CSQ", 2000); // Signal strength
sendATCommand("AT+CREG?", 2000); // Network registration status
sendATCommand("AT+COPS?", 2000); // Current network operator
sendATCommand("AT+CCID", 2000); // SIM card ID (ICCID)
sendATCommand("AT+CIMI", 2000); // IMSI (International Mobile Subscriber Identity)
sendATCommand("AT+CPIN?", 2000); // SIM card status (ready or PIN required)
sendATCommand("AT+CPIN=xxxx", 2000); // SIM card status (ready or PIN required)
sendATCommand("AT+QSPN", 2000); // Service provider name
sendATCommand("AT+CGPADDR", 2000); // Check IP address
sendATCommand("AT+CGATT?", 2000); // Check network attachment status
sendATCommand("AT+UPSND=0,8", 2000); // Internet connection status
}
Serial Monitor:
Starting SARA-R410 Modem Information Retrieval...
Fetching modem and SIM information...
>> AT+CFUN=15
AT+CFUN=15
OK
>> ATI
ATI
Manufacturer: u-blox
Model: SARA-R410M-02B
Revision: L0.0.00.00.05.12 [Mar 09 2022 17:00:00]
SVN: 09
IMEI: <long number here>
OK
>> AT+GMM
AT+GMM
SARA-R410M-02B
OK
>> AT+CGMI
AT+CGMI
u-blox
OK
>> AT+CGMR
AT+CGMR
L0.0.00.00.05.12 [Mar 09 2022 17:00:00]
OK
>> AT+CSQ
AT+CSQ
+CSQ: 99,99
OK
>> AT+CREG?
AT+CREG?
+CME ERROR: SIM failure
>> AT+COPS?
AT+COPS?
+CME ERROR: SIM failure
>> AT+CCID
AT+CCID
+CCID: <long number here>
OK
>> AT+CIMI
AT+CIMI
+CME ERROR: SIM failure
>> AT+CPIN?
AT+CPIN?
+CPIN: SIM PIN
OK
>> AT+CPIN=xxxx
AT+CPIN=xxxx
OK
>> AT+QSPN
AT+QSPN
ERROR
>> AT+CGPADDR
AT+CGPADDR
+CGPADDR: 1,0.0.0.0
OK
>> AT+CGATT?
AT+CGATT?
+CGATT: 0
OK
>> AT+UPSND=0,8
AT+UPSND=0,8
ERROR
AT command set is defined in 3GPP Technical Standard 27.007