diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 029f5b9..a4b65d6 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/.gitignore b/.gitignore index 62a8eed..051117d 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,9 @@ platformio.ini lib/readme.txt include/readme.txt +.atomrc.cson + +# VSCode .vscode/* .vscode/.browse.c_cpp.db* .vscode/c_cpp_properties.json diff --git a/library.json b/library.json index e6ba9c8..b14e6bf 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "TinyGSM", - "version": "0.9.10", + "version": "0.9.11", "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 d0f9f29..ecdd25b 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=TinyGSM -version=0.9.10 +version=0.9.11 author=Volodymyr Shymanskyy maintainer=Volodymyr Shymanskyy sentence=A small Arduino library for GPRS modules, that just works. diff --git a/src/TinyGsmClientM95.h b/src/TinyGsmClientM95.h index b4c1aeb..73bccd1 100644 --- a/src/TinyGsmClientM95.h +++ b/src/TinyGsmClientM95.h @@ -348,18 +348,17 @@ TINY_GSM_MODEM_WAIT_FOR_NETWORK() //Activate GPRS/CSD Context sendAT(GF("+QIACT")); - if (waitResponse(10000) != 1) { + if (waitResponse(60000L) != 1) { return false; } - // Select TCP/IP transfer mode - sendAT(GF("+QIMODE=0")); - if (waitResponse() != 1) { + // Check that we have a local IP address + if (localIP() == IPAddress(0,0,0,0)) { return false; } - //Enable multiple TCP/IP connections - sendAT(GF("+QIMUX=1")); + //Set Method to Handle Received TCP/IP Data - Retrieve Data by Command + sendAT(GF("+QINDI=1")); if (waitResponse() != 1) { return false; } @@ -370,8 +369,14 @@ TINY_GSM_MODEM_WAIT_FOR_NETWORK() return false; } - //Set Method to Handle Received TCP/IP Data - Retrieve Data by Command - sendAT(GF("+QINDI=1")); + // Select TCP/IP transfer mode - NOT transparent mode + sendAT(GF("+QIMODE=0")); + if (waitResponse() != 1) { + return false; + } + + //Enable multiple TCP/IP connections + sendAT(GF("+QIMUX=1")); if (waitResponse() != 1) { return false; } diff --git a/src/TinyGsmClientMC60.h b/src/TinyGsmClientMC60.h index c0c13cf..b0261c7 100644 --- a/src/TinyGsmClientMC60.h +++ b/src/TinyGsmClientMC60.h @@ -364,8 +364,13 @@ TINY_GSM_MODEM_WAIT_FOR_NETWORK() return false; } - //Enable multiple TCP/IP connections - sendAT(GF("+QIMUX=1")); + // Check that we have a local IP address + if (localIP() == IPAddress(0,0,0,0)) { + return false; + } + + //Set Method to Handle Received TCP/IP Data - Retrieve Data by Command + sendAT(GF("+QINDI=1")); if (waitResponse() != 1) { return false; } @@ -376,18 +381,19 @@ TINY_GSM_MODEM_WAIT_FOR_NETWORK() return false; } - //Set Method to Handle Received TCP/IP Data - Retrieve Data by Command - sendAT(GF("+QINDI=1")); + // Select TCP/IP transfer mode - NOT transparent mode + sendAT(GF("+QIMODE=0")); if (waitResponse() != 1) { return false; } - // Check that we have a local IP address - if (localIP() != IPAddress(0,0,0,0)) { - return true; + //Enable multiple TCP/IP connections + sendAT(GF("+QIMUX=1")); + if (waitResponse() != 1) { + return false; } - return false; + return true; } bool gprsDisconnect() { diff --git a/src/TinyGsmCommon.h b/src/TinyGsmCommon.h index cc19e84..443abcb 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.10" +#define TINYGSM_VERSION "0.9.11" #if defined(SPARK) || defined(PARTICLE) #include "Particle.h"