From 3149c335fbefd61d706544ecb1415dd79d8b9c92 Mon Sep 17 00:00:00 2001 From: Volodymyr Shymanskyy Date: Mon, 25 Sep 2017 12:06:18 +0300 Subject: [PATCH] Fix isGprsConnected() for SIM8xx --- TinyGsmClientSIM800.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/TinyGsmClientSIM800.h b/TinyGsmClientSIM800.h index 7e1a52c..0daaba7 100644 --- a/TinyGsmClientSIM800.h +++ b/TinyGsmClientSIM800.h @@ -524,7 +524,14 @@ public: } int res = stream.readStringUntil('\n').toInt(); waitResponse(); - return res == 1; + if (res != 1) + return false; + + sendAT(GF("+CIFSR;E0")); // Another option is to use AT+CGPADDR=1 + if (waitResponse() != 1) + return false; + + return true; } String getLocalIP() {