diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 7f492f2..0ae7aa7 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -23,7 +23,7 @@ with your board before submitting any issues. Main processor board: Modem: -TinyGSM version: +TinyGSM version: Code: ### Scenario, steps to reproduce diff --git a/library.json b/library.json index c2a01d7..17f573d 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "TinyGSM", - "version": "0.9.4", + "version": "0.9.5", "description": "A small Arduino library for GPRS modules, that just works. Includes examples for Blynk, MQTT, File Download, and Web Client. Supports many GSM, LTE, and WiFi modules with AT command interfaces.", "keywords": "GSM, AT commands, AT, SIM800, SIM900, A6, A7, M590, ESP8266, SIM7000, SIM800A, SIM800C, SIM800L, SIM800H, SIM808, SIM868, SIM900A, SIM900D, SIM908, SIM968, M95, MC60, MC60E, BG96, ublox, Quectel, SIMCOM, AI Thinker, LTE, LTE-M", "authors": diff --git a/library.properties b/library.properties index db086b1..fe147e9 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=TinyGSM -version=0.9.4 +version=0.9.5 author=Volodymyr Shymanskyy maintainer=Volodymyr Shymanskyy sentence=A small Arduino library for GPRS modules, that just works. diff --git a/src/TinyGsmClientSIM5360.h b/src/TinyGsmClientSIM5360.h index 0083fbe..ee30a21 100644 --- a/src/TinyGsmClientSIM5360.h +++ b/src/TinyGsmClientSIM5360.h @@ -400,6 +400,13 @@ TINY_GSM_MODEM_WAIT_FOR_NETWORK() } bool gprsDisconnect() { + // Close any open sockets + for (int mux = 0; mux < TINY_GSM_MUX_COUNT; mux++) { + GsmClient *sock = sockets[mux]; + if (sock) { + sock->stop(); + } + } // Stop the socket service // Note: all sockets should be closed first @@ -422,13 +429,11 @@ TINY_GSM_MODEM_WAIT_FOR_NETWORK() bool isGprsConnected() { sendAT(GF("+NETOPEN?")); - if (waitResponse(GF(GSM_NL "+NETOPEN:")) != 1) { + // May return +NETOPEN: 1, 0. We just confirm that the first number is 1 + if (waitResponse(GF(GSM_NL "+NETOPEN: 1")) != 1) { return false; } - int res = stream.readStringUntil('\n').toInt(); waitResponse(); - if (res != 1) - return false; sendAT(GF("+IPADDR")); // Inquire Socket PDP address // sendAT(GF("+CGPADDR=1")); // Show PDP address diff --git a/src/TinyGsmCommon.h b/src/TinyGsmCommon.h index 6e96812..879b473 100644 --- a/src/TinyGsmCommon.h +++ b/src/TinyGsmCommon.h @@ -10,7 +10,7 @@ #define TinyGsmCommon_h // The current library version number -#define TINYGSM_VERSION "0.9.4" +#define TINYGSM_VERSION "0.9.5" #if defined(SPARK) || defined(PARTICLE) #include "Particle.h"