From bab298ec76bf1113e66f5b3fde8e7e2145052c49 Mon Sep 17 00:00:00 2001 From: Leo B Date: Sat, 16 Mar 2019 16:51:22 +0100 Subject: [PATCH 1/2] fix CFUN restart on R4xxx and add +URAT options --- src/TinyGsmClientUBLOX.h | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/TinyGsmClientUBLOX.h b/src/TinyGsmClientUBLOX.h index a577094..8d0bea4 100644 --- a/src/TinyGsmClientUBLOX.h +++ b/src/TinyGsmClientUBLOX.h @@ -369,7 +369,14 @@ public: if (!testAT()) { return false; } - sendAT(GF("+CFUN=16")); + if (!isCatM) + { + sendAT(GF("+CFUN=16")); + } + else + { + sendAT(GF("+CFUN=15")); + } if (waitResponse(10000L) != 1) { return false; } @@ -496,6 +503,24 @@ public: else return false; } + bool setURAT( uint8_t urat ) { + // AT+URAT=[,[,<2ndPreferredAct>]] + + sendAT(GF("+COPS=2")); // Deregister from network + if (waitResponse() != 1) { + return false; + } + sendAT(GF("+CGATT="), urat); // Radio Access Technology (RAT) selection + if (waitResponse() != 1) { + return false; + } + sendAT(GF("+COPS=0")); // Auto-register to the network + if (waitResponse() != 1) { + return false; + } + return restart(); + } + /* * GPRS functions */ From d569d581783a0ab8c957aa9502ae8ec013ad3c01 Mon Sep 17 00:00:00 2001 From: ldab <34199302+ldab@users.noreply.github.com> Date: Sun, 17 Mar 2019 09:57:40 +0100 Subject: [PATCH 2/2] Update TinyGsmClientUBLOX.h Add +URAT --- src/TinyGsmClientUBLOX.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TinyGsmClientUBLOX.h b/src/TinyGsmClientUBLOX.h index 8d0bea4..aa72acc 100644 --- a/src/TinyGsmClientUBLOX.h +++ b/src/TinyGsmClientUBLOX.h @@ -510,7 +510,7 @@ public: if (waitResponse() != 1) { return false; } - sendAT(GF("+CGATT="), urat); // Radio Access Technology (RAT) selection + sendAT(GF("+URAT="), urat); // Radio Access Technology (RAT) selection if (waitResponse() != 1) { return false; }