Skip to content

Commit b4177fc

Browse files
committed
MCU8MASS-749 Wait for CEREG URC before issuing CPIN
1 parent ece38ad commit b4177fc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lte.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ bool LteClass::begin(const bool print_messages) {
115115
char response_buffer[48] = "";
116116
char value_buffer[32] = "";
117117

118+
// Wait for CEREG URC before checking SIM
119+
SequansController.waitForURC(CEREG_CALLBACK);
120+
118121
// We check that the SIM card is inserted and ready. Note that we can only
119122
// do this and get a meaningful response in CFUN=1 or CFUN=4.
120123
if (SequansController.writeCommand(AT_CHECK_SIM,
@@ -139,7 +142,7 @@ bool LteClass::begin(const bool print_messages) {
139142
}
140143

141144
if (strncmp(value_buffer, "READY", 5) != 0) {
142-
Log.error("SIM card is not ready");
145+
Log.errorf("SIM card is not ready, status: %s", value_buffer);
143146
Lte.end();
144147

145148
return false;

0 commit comments

Comments
 (0)