Merge branch 'master' into v_master
This commit is contained in:
2
.github/ISSUE_TEMPLATE.md
vendored
2
.github/ISSUE_TEMPLATE.md
vendored
@@ -22,7 +22,7 @@ with your board before submitting any issues.
|
||||
|
||||
Main processor board: <!-- Uno, Zero, ESP32, Particle, etc -->
|
||||
Modem: <!-- Brand, model, variant, firmware version -->
|
||||
TinyGSM version: <!-- always try to use the latest (0.10.1) -->
|
||||
TinyGSM version: <!-- always try to use the latest (0.10.2) -->
|
||||
Code: <!-- Example name or paste in your code -->
|
||||
|
||||
### Scenario, steps to reproduce
|
||||
|
@@ -115,7 +115,7 @@ Watch this repo for new updates! And of course, contributions are welcome ;)
|
||||
**Location**
|
||||
- GPS/GNSS
|
||||
- SIM808, SIM7000, SIM7500/7600/7800, BG96, u-blox
|
||||
- NOTE: u-blox chips do NOT have embedded GPS - this function only works if a secondary GPS is connected to primary cellular chip over I2C
|
||||
- NOTE: u-blox chips do _NOT_ have embedded GPS - this function only works if a secondary GPS is connected to primary cellular chip over I2C
|
||||
- GSM location service
|
||||
- SIM800, SIM7000, Quectel, u-blox
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "TinyGSM",
|
||||
"version": "0.10.1",
|
||||
"version": "0.10.2",
|
||||
"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":
|
||||
|
@@ -1,5 +1,5 @@
|
||||
name=TinyGSM
|
||||
version=0.10.1
|
||||
version=0.10.2
|
||||
author=Volodymyr Shymanskyy
|
||||
maintainer=Volodymyr Shymanskyy
|
||||
sentence=A small Arduino library for GPRS modules, that just works.
|
||||
|
@@ -55,7 +55,7 @@ class TinyGsmBattery {
|
||||
thisModem().streamSkipUntil(','); // Skip battery charge status
|
||||
thisModem().streamSkipUntil(','); // Skip battery charge level
|
||||
// return voltage in mV
|
||||
uint16_t res = thisModem().streamGetIntBefore(',');
|
||||
uint16_t res = thisModem().streamGetIntBefore('\n');
|
||||
// Wait for final OK
|
||||
thisModem().waitResponse();
|
||||
return res;
|
||||
|
@@ -560,8 +560,9 @@ class TinyGsmA6 : public TinyGsmModem<TinyGsmA6>,
|
||||
return waitResponse(1000, r1, r2, r3, r4, r5);
|
||||
}
|
||||
|
||||
protected:
|
||||
public:
|
||||
Stream& stream;
|
||||
protected:
|
||||
GsmClientA6* sockets[TINY_GSM_MUX_COUNT];
|
||||
const char* gsmNL = GSM_NL;
|
||||
};
|
||||
|
@@ -673,8 +673,9 @@ class TinyGsmBG96 : public TinyGsmModem<TinyGsmBG96>,
|
||||
return waitResponse(1000, r1, r2, r3, r4, r5);
|
||||
}
|
||||
|
||||
protected:
|
||||
public:
|
||||
Stream& stream;
|
||||
protected:
|
||||
GsmClientBG96* sockets[TINY_GSM_MUX_COUNT];
|
||||
const char* gsmNL = GSM_NL;
|
||||
};
|
||||
|
@@ -315,7 +315,10 @@ class TinyGsmESP8266 : public TinyGsmModem<TinyGsmESP8266>,
|
||||
// if the status is anything but 3, there are no connections open
|
||||
waitResponse(); // Returns an OK after the status
|
||||
for (int muxNo = 0; muxNo < TINY_GSM_MUX_COUNT; muxNo++) {
|
||||
sockets[muxNo]->sock_connected = false;
|
||||
GsmClientESP8266* sock = sockets[muxNo];
|
||||
if (sock) {
|
||||
sock->sock_connected = false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -336,7 +339,10 @@ class TinyGsmESP8266 : public TinyGsmModem<TinyGsmESP8266>,
|
||||
if (has_status == 2) break; // once we get to the ok, stop
|
||||
}
|
||||
for (int muxNo = 0; muxNo < TINY_GSM_MUX_COUNT; muxNo++) {
|
||||
sockets[muxNo]->sock_connected = verified_connections[muxNo];
|
||||
GsmClientESP8266* sock = sockets[muxNo];
|
||||
if (sock) {
|
||||
sock->sock_connected = verified_connections[muxNo];
|
||||
}
|
||||
}
|
||||
return verified_connections[mux];
|
||||
}
|
||||
@@ -435,8 +441,9 @@ class TinyGsmESP8266 : public TinyGsmModem<TinyGsmESP8266>,
|
||||
return waitResponse(1000, r1, r2, r3, r4, r5);
|
||||
}
|
||||
|
||||
protected:
|
||||
public:
|
||||
Stream& stream;
|
||||
protected:
|
||||
GsmClientESP8266* sockets[TINY_GSM_MUX_COUNT];
|
||||
const char* gsmNL = GSM_NL;
|
||||
};
|
||||
|
@@ -452,8 +452,9 @@ class TinyGsmM590 : public TinyGsmModem<TinyGsmM590>,
|
||||
return waitResponse(1000, r1, r2, r3, r4, r5);
|
||||
}
|
||||
|
||||
protected:
|
||||
public:
|
||||
Stream& stream;
|
||||
protected:
|
||||
GsmClientM590* sockets[TINY_GSM_MUX_COUNT];
|
||||
const char* gsmNL = GSM_NL;
|
||||
};
|
||||
|
@@ -387,7 +387,7 @@ class TinyGsmM95 : public TinyGsmModem<TinyGsmM95>,
|
||||
*/
|
||||
protected:
|
||||
float getTemperatureImpl() {
|
||||
sendAT(GF("+QTEMP"));
|
||||
sendAT(GF("+QTEMP?"));
|
||||
if (waitResponse(GF(GSM_NL "+QTEMP:")) != 1) {
|
||||
return static_cast<float>(-9999);
|
||||
}
|
||||
@@ -616,8 +616,9 @@ class TinyGsmM95 : public TinyGsmModem<TinyGsmM95>,
|
||||
return waitResponse(1000, r1, r2, r3, r4, r5);
|
||||
}
|
||||
|
||||
protected:
|
||||
public:
|
||||
Stream& stream;
|
||||
protected:
|
||||
GsmClientM95* sockets[TINY_GSM_MUX_COUNT];
|
||||
const char* gsmNL = GSM_NL;
|
||||
};
|
||||
|
@@ -588,8 +588,9 @@ class TinyGsmMC60 : public TinyGsmModem<TinyGsmMC60>,
|
||||
return waitResponse(1000, r1, r2, r3, r4, r5, r6);
|
||||
}
|
||||
|
||||
protected:
|
||||
public:
|
||||
Stream& stream;
|
||||
protected:
|
||||
GsmClientMC60* sockets[TINY_GSM_MUX_COUNT];
|
||||
const char* gsmNL = GSM_NL;
|
||||
};
|
||||
|
@@ -217,8 +217,13 @@ class TinyGsmSim5360 : public TinyGsmModem<TinyGsmSim5360>,
|
||||
bool restartImpl() {
|
||||
if (!testAT()) { return false; }
|
||||
sendAT(GF("+REBOOT"));
|
||||
// Should return an 'OK' after reboot command is sent
|
||||
if (waitResponse(10000L) != 1) { return false; }
|
||||
delay(3000L); // TODO(?): Test this delay!
|
||||
// After booting, modem sends out messages as each of its
|
||||
// internal modules loads. The final message is "PB DONE".
|
||||
if (waitResponse(40000L, GF(GSM_NL "PB DONE")) != 1) {
|
||||
return false;
|
||||
}
|
||||
return init();
|
||||
}
|
||||
|
||||
@@ -574,7 +579,13 @@ class TinyGsmSim5360 : public TinyGsmModem<TinyGsmSim5360>,
|
||||
if (waitResponse(GF("+CIPCLOSE:")) != 1) { return false; }
|
||||
for (int muxNo = 0; muxNo < TINY_GSM_MUX_COUNT; muxNo++) {
|
||||
// +CIPCLOSE:<link0_state>,<link1_state>,...,<link9_state>
|
||||
sockets[muxNo]->sock_connected = stream.parseInt();
|
||||
bool thisMuxState = stream.parseInt();
|
||||
// Need to make sure a socket instace for the socket number exists
|
||||
// before setting its state
|
||||
GsmClientSim5360* sock = sockets[muxNo];
|
||||
if (sock) {
|
||||
sock->sock_connected = thisMuxState;
|
||||
}
|
||||
}
|
||||
waitResponse(); // Should be an OK at the end
|
||||
return sockets[mux]->sock_connected;
|
||||
@@ -702,8 +713,9 @@ class TinyGsmSim5360 : public TinyGsmModem<TinyGsmSim5360>,
|
||||
return waitResponse(1000, r1, r2, r3, r4, r5);
|
||||
}
|
||||
|
||||
protected:
|
||||
public:
|
||||
Stream& stream;
|
||||
protected:
|
||||
GsmClientSim5360* sockets[TINY_GSM_MUX_COUNT];
|
||||
const char* gsmNL = GSM_NL;
|
||||
};
|
||||
|
@@ -239,7 +239,15 @@ class TinyGsmSim7000 : public TinyGsmModem<TinyGsmSim7000>,
|
||||
*/
|
||||
public:
|
||||
RegStatus getRegistrationStatus() {
|
||||
return (RegStatus)getRegistrationStatusXREG("CEREG");
|
||||
RegStatus epsStatus = (RegStatus)getRegistrationStatusXREG("CEREG");
|
||||
// If we're connected on EPS, great!
|
||||
if (epsStatus == REG_OK_HOME || epsStatus == REG_OK_ROAMING) {
|
||||
return epsStatus;
|
||||
} else {
|
||||
// Otherwise, check GPRS network status
|
||||
// We could be using GPRS fall-back or the board could be being moody
|
||||
return (RegStatus)getRegistrationStatusXREG("CGREG");
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
@@ -746,8 +754,9 @@ class TinyGsmSim7000 : public TinyGsmModem<TinyGsmSim7000>,
|
||||
return waitResponse(1000, r1, r2, r3, r4, r5);
|
||||
}
|
||||
|
||||
protected:
|
||||
public:
|
||||
Stream& stream;
|
||||
protected:
|
||||
GsmClientSim7000* sockets[TINY_GSM_MUX_COUNT];
|
||||
const char* gsmNL = GSM_NL;
|
||||
};
|
||||
|
@@ -672,7 +672,13 @@ class TinyGsmSim7600 : public TinyGsmModem<TinyGsmSim7600>,
|
||||
}
|
||||
for (int muxNo = 0; muxNo < TINY_GSM_MUX_COUNT; muxNo++) {
|
||||
// +CIPCLOSE:<link0_state>,<link1_state>,...,<link9_state>
|
||||
sockets[muxNo]->sock_connected = stream.parseInt();
|
||||
bool thisMuxState = stream.parseInt();
|
||||
// Need to make sure a socket instace for the socket number exists
|
||||
// before setting its state
|
||||
GsmClientSim7600* sock = sockets[muxNo];
|
||||
if (sock) {
|
||||
sock->sock_connected = thisMuxState;
|
||||
}
|
||||
}
|
||||
waitResponse(); // Should be an OK at the end
|
||||
return sockets[mux]->sock_connected;
|
||||
@@ -800,8 +806,9 @@ class TinyGsmSim7600 : public TinyGsmModem<TinyGsmSim7600>,
|
||||
return waitResponse(1000, r1, r2, r3, r4, r5);
|
||||
}
|
||||
|
||||
protected:
|
||||
public:
|
||||
Stream& stream;
|
||||
protected:
|
||||
GsmClientSim7600* sockets[TINY_GSM_MUX_COUNT];
|
||||
const char* gsmNL = GSM_NL;
|
||||
};
|
||||
|
@@ -720,8 +720,9 @@ class TinyGsmSim800 : public TinyGsmModem<TinyGsmSim800>,
|
||||
return waitResponse(1000, r1, r2, r3, r4, r5);
|
||||
}
|
||||
|
||||
protected:
|
||||
public:
|
||||
Stream& stream;
|
||||
protected:
|
||||
GsmClientSim800* sockets[TINY_GSM_MUX_COUNT];
|
||||
const char* gsmNL = GSM_NL;
|
||||
};
|
||||
|
@@ -317,24 +317,14 @@ class TinyGsmSaraR4 : public TinyGsmModem<TinyGsmSaraR4>,
|
||||
public:
|
||||
RegStatus getRegistrationStatus() {
|
||||
// Check first for EPS registration
|
||||
sendAT(GF("+CEREG?"));
|
||||
if (waitResponse(GF(GSM_NL "+CEREG:")) != 1) { return REG_UNKNOWN; }
|
||||
streamSkipUntil(','); /* Skip format (0) */
|
||||
int status = streamGetIntBefore('\n');
|
||||
waitResponse();
|
||||
RegStatus epsStatus = (RegStatus)getRegistrationStatusXREG("CEREG");
|
||||
|
||||
// If we're connected on EPS, great!
|
||||
if ((RegStatus)status == REG_OK_HOME ||
|
||||
(RegStatus)status == REG_OK_ROAMING) {
|
||||
return (RegStatus)status;
|
||||
if (epsStatus == REG_OK_HOME || epsStatus == REG_OK_ROAMING) {
|
||||
return epsStatus;
|
||||
} else {
|
||||
// Otherwise, check generic network status
|
||||
sendAT(GF("+CREG?"));
|
||||
if (waitResponse(GF(GSM_NL "+CREG:")) != 1) { return REG_UNKNOWN; }
|
||||
streamSkipUntil(','); /* Skip format (0) */
|
||||
status = streamGetIntBefore('\n');
|
||||
waitResponse();
|
||||
return (RegStatus)status;
|
||||
return (RegStatus)getRegistrationStatusXREG("CREG");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -887,8 +877,9 @@ class TinyGsmSaraR4 : public TinyGsmModem<TinyGsmSaraR4>,
|
||||
return waitResponse(1000, r1, r2, r3, r4, r5);
|
||||
}
|
||||
|
||||
protected:
|
||||
public:
|
||||
Stream& stream;
|
||||
protected:
|
||||
GsmClientSaraR4* sockets[TINY_GSM_MUX_COUNT];
|
||||
const char* gsmNL = GSM_NL;
|
||||
bool has2GFallback;
|
||||
|
@@ -571,7 +571,9 @@ class TinyGsmSequansMonarch
|
||||
// six possible sockets.
|
||||
sendAT(GF("+SQNSS"));
|
||||
for (int muxNo = 1; muxNo <= TINY_GSM_MUX_COUNT; muxNo++) {
|
||||
if (waitResponse(GFP(GSM_OK), GF(GSM_NL "+SQNSS: ")) != 2) { break; }
|
||||
if (waitResponse(GFP(GSM_OK), GF(GSM_NL "+SQNSS: ")) != 2) {
|
||||
break;
|
||||
}
|
||||
uint8_t status = 0;
|
||||
// if (streamGetIntBefore(',') != muxNo) { // check the mux no
|
||||
// DBG("### Warning: misaligned mux numbers!");
|
||||
@@ -588,10 +590,13 @@ class TinyGsmSequansMonarch
|
||||
// SOCK_LISTENING = 4,
|
||||
// SOCK_INCOMING = 5,
|
||||
// SOCK_OPENING = 6,
|
||||
sockets[muxNo % TINY_GSM_MUX_COUNT]->sock_connected =
|
||||
GsmClientSequansMonarch* sock = sockets[mux % TINY_GSM_MUX_COUNT];
|
||||
if (sock) {
|
||||
sock->sock_connected =
|
||||
((status != SOCK_CLOSED) && (status != SOCK_INCOMING) &&
|
||||
(status != SOCK_OPENING));
|
||||
}
|
||||
}
|
||||
waitResponse(); // Should be an OK at the end
|
||||
return sockets[mux % TINY_GSM_MUX_COUNT]->sock_connected;
|
||||
}
|
||||
@@ -701,8 +706,9 @@ class TinyGsmSequansMonarch
|
||||
return waitResponse(1000, r1, r2, r3, r4, r5);
|
||||
}
|
||||
|
||||
protected:
|
||||
public:
|
||||
Stream& stream;
|
||||
protected:
|
||||
GsmClientSequansMonarch* sockets[TINY_GSM_MUX_COUNT];
|
||||
const char* gsmNL = GSM_NL;
|
||||
};
|
||||
|
@@ -810,8 +810,9 @@ class TinyGsmUBLOX : public TinyGsmModem<TinyGsmUBLOX>,
|
||||
return waitResponse(1000, r1, r2, r3, r4, r5);
|
||||
}
|
||||
|
||||
protected:
|
||||
public:
|
||||
Stream& stream;
|
||||
protected:
|
||||
GsmClientUBLOX* sockets[TINY_GSM_MUX_COUNT];
|
||||
const char* gsmNL = GSM_NL;
|
||||
};
|
||||
|
@@ -1440,8 +1440,9 @@ class TinyGsmXBee : public TinyGsmModem<TinyGsmXBee>,
|
||||
return false;
|
||||
}
|
||||
|
||||
protected:
|
||||
public:
|
||||
Stream& stream;
|
||||
protected:
|
||||
GsmClientXBee* sockets[TINY_GSM_MUX_COUNT];
|
||||
const char* gsmNL = GSM_NL;
|
||||
int16_t guardTime;
|
||||
|
@@ -10,7 +10,7 @@
|
||||
#define SRC_TINYGSMCOMMON_H_
|
||||
|
||||
// The current library version number
|
||||
#define TINYGSM_VERSION "0.10.1"
|
||||
#define TINYGSM_VERSION "0.10.2"
|
||||
|
||||
#if defined(SPARK) || defined(PARTICLE)
|
||||
#include "Particle.h"
|
||||
|
Reference in New Issue
Block a user