Updates to examples
This commit is contained in:
38
README.md
38
README.md
@@ -35,31 +35,31 @@ TinyGSM also pulls data gently from the modem (whenever possible), so it can ope
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
Feature \ Modem | SIM8xx | u-Blox | A6/A7/A20 | M590 | ESP8266 | XBee | Quectel M95 |
|
Feature \ Modem | SIM8xx | u-Blox | A6/A7/A20 | M590 | ESP8266 | XBee | BG96 | M95 | MC60 |
|
||||||
--- | --- | --- | --- | --- | --- | --- | ----------- |
|
--- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
||||||
**Data connections**
|
**Data connections**
|
||||||
TCP (HTTP, MQTT, Blynk, ...) | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
|
TCP (HTTP, MQTT, Blynk, ...) | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
|
||||||
UDP | ◌ | ◌ | | | | ◌ | ◌ |
|
UDP | ◌ | ◌ | | | | ◌ | ◌ | | |
|
||||||
SSL/TLS (HTTPS) | ✔¹ | ✔ | 🅧 | 🅧 | ✔¹ | ✔¹ | |
|
SSL/TLS (HTTPS) | ✔¹ | ✔ | x | x | ✔ | ✔ | ◌ | | |
|
||||||
**USSD**
|
**USSD**
|
||||||
Sending USSD requests | ✔ | | ✔ | ✔ | 🅧 | | |
|
Sending USSD requests | ✔ | | ✔ | ✔ | x | | | | |
|
||||||
Decoding 7,8,16-bit response | ✔ | | ✔ | ✔ | 🅧 | | |
|
Decoding 7,8,16-bit response | ✔ | | ✔ | ✔ | x | | | | |
|
||||||
**SMS**
|
**SMS**
|
||||||
Sending | ✔ | ✔ | ✔ | ✔ | 🅧 | ✔ | ✔ |
|
Sending | ✔ | ✔ | ✔ | ✔ | x | ✔ | ✔ | ✔ | ✔ |
|
||||||
Sending Unicode | ✔ | | ◌ | 🅧 | 🅧 | | ? |
|
Sending Unicode | ✔ | | ◌ | x | x | | ✔ | ✔ | ✔ |
|
||||||
Reading | | | | | 🅧 | | ? |
|
Reading | | | | | x | | | | |
|
||||||
Incoming message event | | | | ? | 🅧 | | |
|
Incoming message event | | | | ? | x | | | | |
|
||||||
**Calls**
|
**Calls**
|
||||||
Dial, hangup | ✔ | | ✔ | 🅧 | 🅧 | 🅧 | ? |
|
Dial, hangup | ✔ | | ✔ | x | x | x | | | |
|
||||||
Receiving calls | ✔ | | ✔ | 🅧 | 🅧 | 🅧 | ? |
|
Receiving calls | ✔ | | ✔ | x | x | x | | | |
|
||||||
Incoming event (RING) | ◌ | | ◌ | 🅧 | 🅧 | 🅧 | ? |
|
Incoming event (RING) | ◌ | | ◌ | x | x | x | | | |
|
||||||
DTMF sending | ✔ | | ✔ | 🅧 | 🅧 | 🅧 | ? |
|
DTMF sending | ✔ | | ✔ | x | x | x | | | |
|
||||||
DTMF decoding | ◌ | | 🅧 | 🅧 | 🅧 | 🅧 | ? |
|
DTMF decoding | ◌ | | x | x | x | x | | | |
|
||||||
**Location**
|
**Location**
|
||||||
GSM location service | ✔ | ✔ | 🅧 | 🅧 | 🅧 | ✔ | 🅧 |
|
GSM location service | ✔ | ✔ | x | x | x | x | | x | ✔ |
|
||||||
GPS/GNSS | ✔¹ | 🅧 | ◌¹ | 🅧 | 🅧 | 🅧 | 🅧 |
|
GPS/GNSS | ✔¹ | x | ◌¹ | x | x | x | | x | |
|
||||||
|
|
||||||
✔ - implemented ◌ - planned 🅧 - not available on this modem
|
✔ - implemented ◌ - planned x - not available on this modem
|
||||||
¹ - only some device models or firmware revisions have this feature (SIM8xx R14.18, A7, etc.)
|
¹ - only some device models or firmware revisions have this feature (SIM8xx R14.18, A7, etc.)
|
||||||
|
|
||||||
## Supported modems
|
## Supported modems
|
||||||
|
@@ -30,13 +30,17 @@
|
|||||||
|
|
||||||
// Select your modem:
|
// Select your modem:
|
||||||
#define TINY_GSM_MODEM_SIM800
|
#define TINY_GSM_MODEM_SIM800
|
||||||
// #define TINY_GSM_MODEM_SIM808
|
|
||||||
// #define TINY_GSM_MODEM_SIM900
|
// #define TINY_GSM_MODEM_SIM900
|
||||||
|
// #define TINY_GSM_MODEM_SIM808
|
||||||
|
// #define TINY_GSM_MODEM_SIM868
|
||||||
// #define TINY_GSM_MODEM_UBLOX
|
// #define TINY_GSM_MODEM_UBLOX
|
||||||
|
// #define TINY_GSM_MODEM_M95
|
||||||
// #define TINY_GSM_MODEM_BG96
|
// #define TINY_GSM_MODEM_BG96
|
||||||
// #define TINY_GSM_MODEM_A6
|
// #define TINY_GSM_MODEM_A6
|
||||||
// #define TINY_GSM_MODEM_A7
|
// #define TINY_GSM_MODEM_A7
|
||||||
// #define TINY_GSM_MODEM_M590
|
// #define TINY_GSM_MODEM_M590
|
||||||
|
// #define TINY_GSM_MODEM_MC60
|
||||||
|
// #define TINY_GSM_MODEM_MC60E
|
||||||
// #define TINY_GSM_MODEM_ESP8266
|
// #define TINY_GSM_MODEM_ESP8266
|
||||||
// #define TINY_GSM_MODEM_XBEE
|
// #define TINY_GSM_MODEM_XBEE
|
||||||
|
|
||||||
@@ -95,4 +99,3 @@ void loop()
|
|||||||
{
|
{
|
||||||
Blynk.run();
|
Blynk.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,13 +15,17 @@
|
|||||||
|
|
||||||
// Select your modem:
|
// Select your modem:
|
||||||
#define TINY_GSM_MODEM_SIM800
|
#define TINY_GSM_MODEM_SIM800
|
||||||
// #define TINY_GSM_MODEM_SIM808
|
|
||||||
// #define TINY_GSM_MODEM_SIM900
|
// #define TINY_GSM_MODEM_SIM900
|
||||||
|
// #define TINY_GSM_MODEM_SIM808
|
||||||
|
// #define TINY_GSM_MODEM_SIM868
|
||||||
// #define TINY_GSM_MODEM_UBLOX
|
// #define TINY_GSM_MODEM_UBLOX
|
||||||
|
// #define TINY_GSM_MODEM_M95
|
||||||
// #define TINY_GSM_MODEM_BG96
|
// #define TINY_GSM_MODEM_BG96
|
||||||
// #define TINY_GSM_MODEM_A6
|
// #define TINY_GSM_MODEM_A6
|
||||||
// #define TINY_GSM_MODEM_A7
|
// #define TINY_GSM_MODEM_A7
|
||||||
// #define TINY_GSM_MODEM_M590
|
// #define TINY_GSM_MODEM_M590
|
||||||
|
// #define TINY_GSM_MODEM_MC60
|
||||||
|
// #define TINY_GSM_MODEM_MC60E
|
||||||
// #define TINY_GSM_MODEM_ESP8266
|
// #define TINY_GSM_MODEM_ESP8266
|
||||||
// #define TINY_GSM_MODEM_XBEE
|
// #define TINY_GSM_MODEM_XBEE
|
||||||
|
|
||||||
@@ -204,4 +208,3 @@ void loop() {
|
|||||||
delay(1000);
|
delay(1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -16,14 +16,19 @@
|
|||||||
|
|
||||||
// Select your modem:
|
// Select your modem:
|
||||||
#define TINY_GSM_MODEM_SIM800
|
#define TINY_GSM_MODEM_SIM800
|
||||||
// #define TINY_GSM_MODEM_SIM808
|
|
||||||
// #define TINY_GSM_MODEM_SIM900
|
// #define TINY_GSM_MODEM_SIM900
|
||||||
|
// #define TINY_GSM_MODEM_SIM808
|
||||||
|
// #define TINY_GSM_MODEM_SIM868
|
||||||
// #define TINY_GSM_MODEM_UBLOX
|
// #define TINY_GSM_MODEM_UBLOX
|
||||||
|
// #define TINY_GSM_MODEM_M95
|
||||||
// #define TINY_GSM_MODEM_BG96
|
// #define TINY_GSM_MODEM_BG96
|
||||||
// #define TINY_GSM_MODEM_A6
|
// #define TINY_GSM_MODEM_A6
|
||||||
// #define TINY_GSM_MODEM_A7
|
// #define TINY_GSM_MODEM_A7
|
||||||
// #define TINY_GSM_MODEM_M590
|
// #define TINY_GSM_MODEM_M590
|
||||||
|
// #define TINY_GSM_MODEM_MC60
|
||||||
|
// #define TINY_GSM_MODEM_MC60E
|
||||||
// #define TINY_GSM_MODEM_ESP8266
|
// #define TINY_GSM_MODEM_ESP8266
|
||||||
|
// #define TINY_GSM_MODEM_XBEE
|
||||||
|
|
||||||
// Increase RX buffer if needed
|
// Increase RX buffer if needed
|
||||||
//#define TINY_GSM_RX_BUFFER 512
|
//#define TINY_GSM_RX_BUFFER 512
|
||||||
@@ -157,4 +162,3 @@ void loop() {
|
|||||||
delay(1000);
|
delay(1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -18,8 +18,19 @@
|
|||||||
|
|
||||||
// Select your modem:
|
// Select your modem:
|
||||||
#define TINY_GSM_MODEM_SIM800
|
#define TINY_GSM_MODEM_SIM800
|
||||||
|
// #define TINY_GSM_MODEM_SIM900
|
||||||
// #define TINY_GSM_MODEM_SIM808
|
// #define TINY_GSM_MODEM_SIM808
|
||||||
|
// #define TINY_GSM_MODEM_SIM868
|
||||||
// #define TINY_GSM_MODEM_UBLOX
|
// #define TINY_GSM_MODEM_UBLOX
|
||||||
|
// #define TINY_GSM_MODEM_M95
|
||||||
|
// #define TINY_GSM_MODEM_BG96
|
||||||
|
// #define TINY_GSM_MODEM_A6
|
||||||
|
// #define TINY_GSM_MODEM_A7
|
||||||
|
// #define TINY_GSM_MODEM_M590
|
||||||
|
// #define TINY_GSM_MODEM_MC60
|
||||||
|
// #define TINY_GSM_MODEM_MC60E
|
||||||
|
// #define TINY_GSM_MODEM_ESP8266
|
||||||
|
// #define TINY_GSM_MODEM_XBEE
|
||||||
|
|
||||||
// Increase RX buffer if needed
|
// Increase RX buffer if needed
|
||||||
//#define TINY_GSM_RX_BUFFER 512
|
//#define TINY_GSM_RX_BUFFER 512
|
||||||
@@ -159,4 +170,3 @@ void loop() {
|
|||||||
delay(1000);
|
delay(1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -29,13 +29,17 @@
|
|||||||
|
|
||||||
// Select your modem:
|
// Select your modem:
|
||||||
#define TINY_GSM_MODEM_SIM800
|
#define TINY_GSM_MODEM_SIM800
|
||||||
// #define TINY_GSM_MODEM_SIM808
|
|
||||||
// #define TINY_GSM_MODEM_SIM900
|
// #define TINY_GSM_MODEM_SIM900
|
||||||
|
// #define TINY_GSM_MODEM_SIM808
|
||||||
|
// #define TINY_GSM_MODEM_SIM868
|
||||||
// #define TINY_GSM_MODEM_UBLOX
|
// #define TINY_GSM_MODEM_UBLOX
|
||||||
|
// #define TINY_GSM_MODEM_M95
|
||||||
// #define TINY_GSM_MODEM_BG96
|
// #define TINY_GSM_MODEM_BG96
|
||||||
// #define TINY_GSM_MODEM_A6
|
// #define TINY_GSM_MODEM_A6
|
||||||
// #define TINY_GSM_MODEM_A7
|
// #define TINY_GSM_MODEM_A7
|
||||||
// #define TINY_GSM_MODEM_M590
|
// #define TINY_GSM_MODEM_M590
|
||||||
|
// #define TINY_GSM_MODEM_MC60
|
||||||
|
// #define TINY_GSM_MODEM_MC60E
|
||||||
// #define TINY_GSM_MODEM_ESP8266
|
// #define TINY_GSM_MODEM_ESP8266
|
||||||
// #define TINY_GSM_MODEM_XBEE
|
// #define TINY_GSM_MODEM_XBEE
|
||||||
|
|
||||||
@@ -171,4 +175,3 @@ void mqttCallback(char* topic, byte* payload, unsigned int len) {
|
|||||||
mqtt.publish(topicLedStatus, ledStatus ? "1" : "0");
|
mqtt.publish(topicLedStatus, ledStatus ? "1" : "0");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -10,14 +10,19 @@
|
|||||||
|
|
||||||
// Select your modem:
|
// Select your modem:
|
||||||
#define TINY_GSM_MODEM_SIM800
|
#define TINY_GSM_MODEM_SIM800
|
||||||
// #define TINY_GSM_MODEM_SIM808
|
|
||||||
// #define TINY_GSM_MODEM_SIM900
|
// #define TINY_GSM_MODEM_SIM900
|
||||||
|
// #define TINY_GSM_MODEM_SIM808
|
||||||
|
// #define TINY_GSM_MODEM_SIM868
|
||||||
// #define TINY_GSM_MODEM_UBLOX
|
// #define TINY_GSM_MODEM_UBLOX
|
||||||
|
// #define TINY_GSM_MODEM_M95
|
||||||
// #define TINY_GSM_MODEM_BG96
|
// #define TINY_GSM_MODEM_BG96
|
||||||
// #define TINY_GSM_MODEM_A6
|
// #define TINY_GSM_MODEM_A6
|
||||||
// #define TINY_GSM_MODEM_A7
|
// #define TINY_GSM_MODEM_A7
|
||||||
// #define TINY_GSM_MODEM_M590
|
// #define TINY_GSM_MODEM_M590
|
||||||
|
// #define TINY_GSM_MODEM_MC60
|
||||||
|
// #define TINY_GSM_MODEM_MC60E
|
||||||
// #define TINY_GSM_MODEM_ESP8266
|
// #define TINY_GSM_MODEM_ESP8266
|
||||||
|
// #define TINY_GSM_MODEM_XBEE
|
||||||
|
|
||||||
// Increase RX buffer if needed
|
// Increase RX buffer if needed
|
||||||
//#define TINY_GSM_RX_BUFFER 512
|
//#define TINY_GSM_RX_BUFFER 512
|
||||||
@@ -145,4 +150,3 @@ void loop() {
|
|||||||
delay(1000);
|
delay(1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
14
library.json
14
library.json
@@ -1,14 +1,16 @@
|
|||||||
{
|
{
|
||||||
"name": "TinyGSM",
|
"name": "TinyGSM",
|
||||||
"version": "0.3.6",
|
"version": "0.4.0",
|
||||||
"description": "A small Arduino library for GPRS modules, that just works. Includes examples for Blynk, MQTT, File Download, and Web Client. Supports many GSM and wifi modules with AT command interfaces.",
|
"description": "A small Arduino library for GPRS modules, that just works. Includes examples for Blynk, MQTT, File Download, and Web Client. Supports many GSM and wifi modules with AT command interfaces.",
|
||||||
"keywords": "GSM, AT commands, AT, SIM800, SIM900, A6, A7, M590, ESP8266, SIM800A, SIM800C, SIM800L, SIM800H, SIM808, SIM868, SIM900A, SIM900D, SIM908, SIM968, M95, MC60, MC60E, BG96, ublox",
|
"keywords": "GSM, AT commands, AT, SIM800, SIM900, A6, A7, M590, ESP8266, SIM800A, SIM800C, SIM800L, SIM800H, SIM808, SIM868, SIM900A, SIM900D, SIM908, SIM968, M95, MC60, MC60E, BG96, ublox",
|
||||||
"authors":
|
"authors":
|
||||||
{
|
[
|
||||||
"name": "Volodymyr Shymanskyy",
|
{
|
||||||
"url": "https://github.com/vshymanskyy",
|
"name": "Volodymyr Shymanskyy",
|
||||||
"maintainer": true
|
"url": "https://github.com/vshymanskyy"
|
||||||
},
|
"maintainer": true
|
||||||
|
}
|
||||||
|
],
|
||||||
"repository":
|
"repository":
|
||||||
{
|
{
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
name=TinyGSM
|
name=TinyGSM
|
||||||
version=0.3.6
|
version=0.4.0
|
||||||
author=Volodymyr Shymanskyy
|
author=Volodymyr Shymanskyy
|
||||||
maintainer=Volodymyr Shymanskyy
|
maintainer=Volodymyr Shymanskyy
|
||||||
sentence=A small Arduino library for GPRS modules, that just works.
|
sentence=A small Arduino library for GPRS modules, that just works.
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#ifndef TinyGsmClientA6_h
|
#ifndef TinyGsmClientA6_h
|
||||||
#define TinyGsmClientA6_h
|
#define TinyGsmClientA6_h
|
||||||
|
//#pragma message("TinyGSM: TinyGsmClientA6")
|
||||||
|
|
||||||
//#define TINY_GSM_DEBUG Serial
|
//#define TINY_GSM_DEBUG Serial
|
||||||
|
|
||||||
@@ -188,6 +189,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
bool init(const char* pin = NULL) {
|
bool init(const char* pin = NULL) {
|
||||||
|
DBG(GF("### Modem Defined:"), getModemName());
|
||||||
if (!testAT()) {
|
if (!testAT()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#ifndef TinyGsmClientBG96_h
|
#ifndef TinyGsmClientBG96_h
|
||||||
#define TinyGsmClientBG96_h
|
#define TinyGsmClientBG96_h
|
||||||
|
//#pragma message("TinyGSM: TinyGsmClientBG96")
|
||||||
|
|
||||||
//#define TINY_GSM_DEBUG Serial
|
//#define TINY_GSM_DEBUG Serial
|
||||||
//#define TINY_GSM_USE_HEX
|
//#define TINY_GSM_USE_HEX
|
||||||
@@ -212,6 +213,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
bool init(const char* pin = NULL) {
|
bool init(const char* pin = NULL) {
|
||||||
|
DBG(GF("### Modem Defined:"), getModemName());
|
||||||
if (!testAT()) {
|
if (!testAT()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#ifndef TinyGsmClientESP8266_h
|
#ifndef TinyGsmClientESP8266_h
|
||||||
#define TinyGsmClientESP8266_h
|
#define TinyGsmClientESP8266_h
|
||||||
|
//#pragma message("TinyGSM: TinyGsmClientESP8266")
|
||||||
|
|
||||||
//#define TINY_GSM_DEBUG Serial
|
//#define TINY_GSM_DEBUG Serial
|
||||||
|
|
||||||
@@ -205,6 +206,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
bool init(const char* pin = NULL) {
|
bool init(const char* pin = NULL) {
|
||||||
|
DBG(GF("### Modem Defined:"), getModemName());
|
||||||
if (!testAT()) {
|
if (!testAT()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#ifndef TinyGsmClientM590_h
|
#ifndef TinyGsmClientM590_h
|
||||||
#define TinyGsmClientM590_h
|
#define TinyGsmClientM590_h
|
||||||
|
//#pragma message("TinyGSM: TinyGsmClientM590")
|
||||||
|
|
||||||
//#define TINY_GSM_DEBUG Serial
|
//#define TINY_GSM_DEBUG Serial
|
||||||
|
|
||||||
@@ -185,6 +186,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
bool init(const char* pin = NULL) {
|
bool init(const char* pin = NULL) {
|
||||||
|
DBG(GF("### Modem Defined:"), getModemName());
|
||||||
if (!testAT()) {
|
if (!testAT()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#ifndef TinyGsmClientM95_h
|
#ifndef TinyGsmClientM95_h
|
||||||
#define TinyGsmClientM95_h
|
#define TinyGsmClientM95_h
|
||||||
|
//#pragma message("TinyGSM: TinyGsmClientM95")
|
||||||
|
|
||||||
//#define TINY_GSM_DEBUG Serial
|
//#define TINY_GSM_DEBUG Serial
|
||||||
//#define TINY_GSM_USE_HEX
|
//#define TINY_GSM_USE_HEX
|
||||||
@@ -212,6 +213,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
bool init(const char* pin = NULL) {
|
bool init(const char* pin = NULL) {
|
||||||
|
DBG(GF("### Modem Defined:"), getModemName());
|
||||||
if (!testAT()) {
|
if (!testAT()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
#ifndef TinyGsmClientMC60_h
|
#ifndef TinyGsmClientMC60_h
|
||||||
#define TinyGsmClientMC60_h
|
#define TinyGsmClientMC60_h
|
||||||
|
//#pragma message("TinyGSM: TinyGsmClientMC60")
|
||||||
|
|
||||||
//#define TINY_GSM_DEBUG Serial
|
//#define TINY_GSM_DEBUG Serial
|
||||||
//#define TINY_GSM_USE_HEX
|
//#define TINY_GSM_USE_HEX
|
||||||
@@ -216,6 +217,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
bool init(const char* pin = NULL) {
|
bool init(const char* pin = NULL) {
|
||||||
|
DBG(GF("### Modem Defined:"), getModemName());
|
||||||
if (!testAT()) {
|
if (!testAT()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#ifndef TinyGsmClientSIM800_h
|
#ifndef TinyGsmClientSIM800_h
|
||||||
#define TinyGsmClientSIM800_h
|
#define TinyGsmClientSIM800_h
|
||||||
|
//#pragma message("TinyGSM: TinyGsmClientSIM800")
|
||||||
|
|
||||||
//#define TINY_GSM_DEBUG Serial
|
//#define TINY_GSM_DEBUG Serial
|
||||||
//#define TINY_GSM_USE_HEX
|
//#define TINY_GSM_USE_HEX
|
||||||
@@ -226,6 +227,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
bool init(const char* pin = NULL) {
|
bool init(const char* pin = NULL) {
|
||||||
|
DBG(GF("### Modem Defined:"), getModemName());
|
||||||
if (!testAT()) {
|
if (!testAT()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#ifndef TinyGsmClientSIM808_h
|
#ifndef TinyGsmClientSIM808_h
|
||||||
#define TinyGsmClientSIM808_h
|
#define TinyGsmClientSIM808_h
|
||||||
|
//#pragma message("TinyGSM: TinyGsmClientSIM808")
|
||||||
|
|
||||||
#include <TinyGsmClientSIM800.h>
|
#include <TinyGsmClientSIM800.h>
|
||||||
|
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#ifndef TinyGsmClientUBLOX_h
|
#ifndef TinyGsmClientUBLOX_h
|
||||||
#define TinyGsmClientUBLOX_h
|
#define TinyGsmClientUBLOX_h
|
||||||
|
//#pragma message("TinyGSM: TinyGsmClientUBLOX")
|
||||||
|
|
||||||
//#define TINY_GSM_DEBUG Serial
|
//#define TINY_GSM_DEBUG Serial
|
||||||
|
|
||||||
@@ -211,6 +212,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
bool init(const char* pin = NULL) {
|
bool init(const char* pin = NULL) {
|
||||||
|
DBG(GF("### Modem Defined:"), getModemName());
|
||||||
if (!testAT()) {
|
if (!testAT()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#ifndef TinyGsmClientXBee_h
|
#ifndef TinyGsmClientXBee_h
|
||||||
#define TinyGsmClientXBee_h
|
#define TinyGsmClientXBee_h
|
||||||
|
//#pragma message("TinyGSM: TinyGsmClientXBee")
|
||||||
|
|
||||||
//#define TINY_GSM_DEBUG Serial
|
//#define TINY_GSM_DEBUG Serial
|
||||||
|
|
||||||
@@ -215,6 +216,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
bool init(const char* pin = NULL) {
|
bool init(const char* pin = NULL) {
|
||||||
|
DBG(GF("### Modem Defined:"), getModemName());
|
||||||
guardTime = 1100; // Start with a default guard time of 1 second
|
guardTime = 1100; // Start with a default guard time of 1 second
|
||||||
|
|
||||||
if (!commandMode(10)) return false; // Try up to 10 times for the init
|
if (!commandMode(10)) return false; // Try up to 10 times for the init
|
||||||
@@ -229,10 +231,7 @@ public:
|
|||||||
if (ret_val) guardTime = 125;
|
if (ret_val) guardTime = 125;
|
||||||
|
|
||||||
sendAT(GF("HS")); // Get the "Hardware Series";
|
sendAT(GF("HS")); // Get the "Hardware Series";
|
||||||
String res = readResponse();
|
int intRes = readResponseInt();
|
||||||
char buf[4] = {0,}; // Set up buffer for response
|
|
||||||
res.toCharArray(buf, 4);
|
|
||||||
int intRes = strtol(buf, 0, 16);
|
|
||||||
beeType = (XBeeType)intRes;
|
beeType = (XBeeType)intRes;
|
||||||
|
|
||||||
exitCommand();
|
exitCommand();
|
||||||
@@ -299,7 +298,7 @@ public:
|
|||||||
if (!commandMode()) return modemInf; // Try up to 10 times for the init
|
if (!commandMode()) return modemInf; // Try up to 10 times for the init
|
||||||
|
|
||||||
sendAT(GF("HS")); // Get the "Hardware Series"
|
sendAT(GF("HS")); // Get the "Hardware Series"
|
||||||
modemInf += readResponse();
|
modemInf += readResponseString();
|
||||||
|
|
||||||
exitCommand();
|
exitCommand();
|
||||||
return modemInf;
|
return modemInf;
|
||||||
@@ -402,7 +401,7 @@ public:
|
|||||||
String getSimCCID() {
|
String getSimCCID() {
|
||||||
if (!commandMode()) return ""; // Return immediately
|
if (!commandMode()) return ""; // Return immediately
|
||||||
sendAT(GF("S#"));
|
sendAT(GF("S#"));
|
||||||
String res = readResponse();
|
String res = readResponseString();
|
||||||
exitCommand();
|
exitCommand();
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -410,7 +409,7 @@ public:
|
|||||||
String getIMEI() {
|
String getIMEI() {
|
||||||
if (!commandMode()) return ""; // Return immediately
|
if (!commandMode()) return ""; // Return immediately
|
||||||
sendAT(GF("IM"));
|
sendAT(GF("IM"));
|
||||||
String res = readResponse();
|
String res = readResponseString();
|
||||||
exitCommand();
|
exitCommand();
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -423,10 +422,7 @@ public:
|
|||||||
if (!commandMode()) return REG_UNKNOWN; // Return immediately
|
if (!commandMode()) return REG_UNKNOWN; // Return immediately
|
||||||
|
|
||||||
sendAT(GF("AI"));
|
sendAT(GF("AI"));
|
||||||
String res = readResponse();
|
int intRes = readResponseInt();
|
||||||
char buf[3] = {0,}; // Set up buffer for response
|
|
||||||
res.toCharArray(buf, 3);
|
|
||||||
int intRes = strtol(buf, 0, 16);
|
|
||||||
RegStatus stat = REG_UNKNOWN;
|
RegStatus stat = REG_UNKNOWN;
|
||||||
|
|
||||||
switch (beeType){
|
switch (beeType){
|
||||||
@@ -475,13 +471,18 @@ public:
|
|||||||
writeChanges();
|
writeChanges();
|
||||||
stat = REG_UNKNOWN;
|
stat = REG_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
else if(intRes == 0x2B) { // 0x2B USB Direct active.
|
||||||
|
stat = REG_UNKNOWN;
|
||||||
|
}
|
||||||
|
else if(intRes == 0x2C) // 0x2C Cellular component is in PSM (power save mode).
|
||||||
|
stat = REG_UNKNOWN;
|
||||||
else if(intRes == 0x2F) { // 0x2F Bypass mode active.
|
else if(intRes == 0x2F) { // 0x2F Bypass mode active.
|
||||||
sendAT(GF("AP0")); // Set back to transparent mode
|
sendAT(GF("AP0")); // Set back to transparent mode
|
||||||
waitResponse();
|
waitResponse();
|
||||||
writeChanges();
|
writeChanges();
|
||||||
stat = REG_UNKNOWN;
|
stat = REG_UNKNOWN;
|
||||||
}
|
}
|
||||||
else if(intRes == 0xFF) // 0xFF Device is currently scanning for the configured SSID.
|
else if(intRes == 0xFF) // 0xFF Initializing.
|
||||||
stat = REG_SEARCHING;
|
stat = REG_SEARCHING;
|
||||||
else stat = REG_UNKNOWN;
|
else stat = REG_UNKNOWN;
|
||||||
break;
|
break;
|
||||||
@@ -495,7 +496,7 @@ public:
|
|||||||
String getOperator() {
|
String getOperator() {
|
||||||
if (!commandMode()) return ""; // Return immediately
|
if (!commandMode()) return ""; // Return immediately
|
||||||
sendAT(GF("MN"));
|
sendAT(GF("MN"));
|
||||||
String res = readResponse();
|
String res = readResponseString();
|
||||||
exitCommand();
|
exitCommand();
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -508,11 +509,8 @@ public:
|
|||||||
if (!commandMode()) return 0; // Return immediately
|
if (!commandMode()) return 0; // Return immediately
|
||||||
if (beeType == XBEE_S6B_WIFI) sendAT(GF("LM")); // ask for the "link margin" - the dB above sensitivity
|
if (beeType == XBEE_S6B_WIFI) sendAT(GF("LM")); // ask for the "link margin" - the dB above sensitivity
|
||||||
else sendAT(GF("DB")); // ask for the cell strength in dBm
|
else sendAT(GF("DB")); // ask for the cell strength in dBm
|
||||||
String res = readResponse(); // it works better if we read in as a string
|
int intRes = readResponseInt();
|
||||||
exitCommand();
|
exitCommand();
|
||||||
char buf[3] = {0,}; // Set up buffer for response
|
|
||||||
res.toCharArray(buf, 3);
|
|
||||||
int intRes = strtol(buf, 0, 16);
|
|
||||||
if (beeType == XBEE_S6B_WIFI) return -93 + intRes; // the maximum sensitivity is -93dBm
|
if (beeType == XBEE_S6B_WIFI) return -93 + intRes; // the maximum sensitivity is -93dBm
|
||||||
else return -1*intRes; // need to convert to negative number
|
else return -1*intRes; // need to convert to negative number
|
||||||
}
|
}
|
||||||
@@ -576,7 +574,7 @@ fail:
|
|||||||
sendAT(GF("MY"));
|
sendAT(GF("MY"));
|
||||||
String IPaddr; IPaddr.reserve(16);
|
String IPaddr; IPaddr.reserve(16);
|
||||||
// wait for the response - this response can be very slow
|
// wait for the response - this response can be very slow
|
||||||
IPaddr = readResponse(30000);
|
IPaddr = readResponseString(30000);
|
||||||
exitCommand();
|
exitCommand();
|
||||||
IPaddr.trim();
|
IPaddr.trim();
|
||||||
return IPaddr;
|
return IPaddr;
|
||||||
@@ -840,7 +838,7 @@ finish:
|
|||||||
waitResponse();
|
waitResponse();
|
||||||
}
|
}
|
||||||
|
|
||||||
String readResponse(uint32_t timeout = 1000) {
|
String readResponseString(uint32_t timeout = 1000) {
|
||||||
TINY_GSM_YIELD();
|
TINY_GSM_YIELD();
|
||||||
unsigned long startMillis = millis();
|
unsigned long startMillis = millis();
|
||||||
while (!stream.available() && millis() - startMillis < timeout) {};
|
while (!stream.available() && millis() - startMillis < timeout) {};
|
||||||
@@ -850,6 +848,14 @@ finish:
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int readResponseInt(uint32_t timeout = 1000) {
|
||||||
|
String res = readResponseString(timeout);
|
||||||
|
char buf[3] = {0,}; // Set up buffer for response
|
||||||
|
res.toCharArray(buf, 3);
|
||||||
|
int intRes = strtol(buf, 0, 16);
|
||||||
|
return intRes;
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Stream& stream;
|
Stream& stream;
|
||||||
|
|
||||||
|
@@ -10,13 +10,17 @@
|
|||||||
|
|
||||||
// Select your modem:
|
// Select your modem:
|
||||||
#define TINY_GSM_MODEM_SIM800
|
#define TINY_GSM_MODEM_SIM800
|
||||||
// #define TINY_GSM_MODEM_SIM808
|
|
||||||
// #define TINY_GSM_MODEM_SIM900
|
// #define TINY_GSM_MODEM_SIM900
|
||||||
|
// #define TINY_GSM_MODEM_SIM808
|
||||||
|
// #define TINY_GSM_MODEM_SIM868
|
||||||
// #define TINY_GSM_MODEM_UBLOX
|
// #define TINY_GSM_MODEM_UBLOX
|
||||||
|
// #define TINY_GSM_MODEM_M95
|
||||||
// #define TINY_GSM_MODEM_BG96
|
// #define TINY_GSM_MODEM_BG96
|
||||||
// #define TINY_GSM_MODEM_A6
|
// #define TINY_GSM_MODEM_A6
|
||||||
// #define TINY_GSM_MODEM_A7
|
// #define TINY_GSM_MODEM_A7
|
||||||
// #define TINY_GSM_MODEM_M590
|
// #define TINY_GSM_MODEM_M590
|
||||||
|
// #define TINY_GSM_MODEM_MC60
|
||||||
|
// #define TINY_GSM_MODEM_MC60E
|
||||||
// #define TINY_GSM_MODEM_ESP8266
|
// #define TINY_GSM_MODEM_ESP8266
|
||||||
// #define TINY_GSM_MODEM_XBEE
|
// #define TINY_GSM_MODEM_XBEE
|
||||||
|
|
||||||
@@ -79,4 +83,3 @@ void loop() {
|
|||||||
delay(0);
|
delay(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -11,13 +11,17 @@
|
|||||||
|
|
||||||
// Select your modem:
|
// Select your modem:
|
||||||
#define TINY_GSM_MODEM_SIM800
|
#define TINY_GSM_MODEM_SIM800
|
||||||
// #define TINY_GSM_MODEM_SIM808
|
|
||||||
// #define TINY_GSM_MODEM_SIM900
|
// #define TINY_GSM_MODEM_SIM900
|
||||||
|
// #define TINY_GSM_MODEM_SIM808
|
||||||
|
// #define TINY_GSM_MODEM_SIM868
|
||||||
// #define TINY_GSM_MODEM_UBLOX
|
// #define TINY_GSM_MODEM_UBLOX
|
||||||
|
// #define TINY_GSM_MODEM_M95
|
||||||
// #define TINY_GSM_MODEM_BG96
|
// #define TINY_GSM_MODEM_BG96
|
||||||
// #define TINY_GSM_MODEM_A6
|
// #define TINY_GSM_MODEM_A6
|
||||||
// #define TINY_GSM_MODEM_A7
|
// #define TINY_GSM_MODEM_A7
|
||||||
// #define TINY_GSM_MODEM_M590
|
// #define TINY_GSM_MODEM_M590
|
||||||
|
// #define TINY_GSM_MODEM_MC60
|
||||||
|
// #define TINY_GSM_MODEM_MC60E
|
||||||
// #define TINY_GSM_MODEM_ESP8266
|
// #define TINY_GSM_MODEM_ESP8266
|
||||||
// #define TINY_GSM_MODEM_XBEE
|
// #define TINY_GSM_MODEM_XBEE
|
||||||
|
|
||||||
@@ -183,4 +187,3 @@ void loop() {
|
|||||||
delay(1000);
|
delay(1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -11,13 +11,17 @@
|
|||||||
|
|
||||||
// Select your modem:
|
// Select your modem:
|
||||||
#define TINY_GSM_MODEM_SIM800
|
#define TINY_GSM_MODEM_SIM800
|
||||||
// #define TINY_GSM_MODEM_SIM808
|
|
||||||
// #define TINY_GSM_MODEM_SIM900
|
// #define TINY_GSM_MODEM_SIM900
|
||||||
|
// #define TINY_GSM_MODEM_SIM808
|
||||||
|
// #define TINY_GSM_MODEM_SIM868
|
||||||
// #define TINY_GSM_MODEM_UBLOX
|
// #define TINY_GSM_MODEM_UBLOX
|
||||||
|
// #define TINY_GSM_MODEM_M95
|
||||||
// #define TINY_GSM_MODEM_BG96
|
// #define TINY_GSM_MODEM_BG96
|
||||||
// #define TINY_GSM_MODEM_A6
|
// #define TINY_GSM_MODEM_A6
|
||||||
// #define TINY_GSM_MODEM_A7
|
// #define TINY_GSM_MODEM_A7
|
||||||
// #define TINY_GSM_MODEM_M590
|
// #define TINY_GSM_MODEM_M590
|
||||||
|
// #define TINY_GSM_MODEM_MC60
|
||||||
|
// #define TINY_GSM_MODEM_MC60E
|
||||||
// #define TINY_GSM_MODEM_ESP8266
|
// #define TINY_GSM_MODEM_ESP8266
|
||||||
// #define TINY_GSM_MODEM_XBEE
|
// #define TINY_GSM_MODEM_XBEE
|
||||||
|
|
||||||
@@ -67,4 +71,3 @@ void setup() {
|
|||||||
void loop() {
|
void loop() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user