Use CREG to check registration status.

Do not check if GPRS is connected as it will fail due to APN not being set.
This commit is contained in:
JP Meijers
2019-06-13 12:20:03 +02:00
parent eb61fe52c2
commit 640b846662

View File

@@ -329,7 +329,7 @@ TINY_GSM_MODEM_GET_SIMCCID_CCID()
}
TINY_GSM_MODEM_GET_REGISTRATION_XREG(CEREG)
TINY_GSM_MODEM_GET_REGISTRATION_XREG(CREG)
TINY_GSM_MODEM_GET_OPERATOR_COPS()
@@ -343,8 +343,8 @@ TINY_GSM_MODEM_GET_CSQ()
RegStatus s = getRegistrationStatus();
if (s == REG_OK_HOME || s == REG_OK_ROAMING)
return true;
else if (s == REG_UNKNOWN) // for some reason, it can hang at unknown..
return isGprsConnected();
// else if (s == REG_UNKNOWN) // for some reason, it can hang at unknown..
// return isGprsConnected();
else return false;
}