From 640b8466620afce3ccc3a7bf81c610eaa6c9e8c2 Mon Sep 17 00:00:00 2001 From: JP Meijers Date: Thu, 13 Jun 2019 12:20:03 +0200 Subject: [PATCH] Use CREG to check registration status. Do not check if GPRS is connected as it will fail due to APN not being set. --- src/TinyGsmClientSaraR4.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/TinyGsmClientSaraR4.h b/src/TinyGsmClientSaraR4.h index 67291d5..e6cb5a6 100644 --- a/src/TinyGsmClientSaraR4.h +++ b/src/TinyGsmClientSaraR4.h @@ -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; }