From 49c7552588dcdd0a33b2f1ea1b595674f0dc22f2 Mon Sep 17 00:00:00 2001 From: Volodymyr Shymanskyy Date: Mon, 23 Apr 2018 15:00:50 +0300 Subject: [PATCH 1/7] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 47a631a..f05e191 100644 --- a/README.md +++ b/README.md @@ -67,13 +67,15 @@ GPS/GNSS | ✔¹ | 🅧 | ◌¹ | 🅧 | - SIMCom SIM800 series (SIM800A, SIM800C, SIM800L, SIM800H, SIM808, SIM868) - SIMCom SIM900 series (SIM900A, SIM900D, SIM908, SIM968) - AI-Thinker A6, A6C, A7, A20 -- U-blox SARA U201 (*alpha*) - ESP8266 (AT commands interface, similar to GSM modems) - Digi XBee WiFi and Cellular (using XBee command mode) - Neoway M590 +- U-blox SARA U201 ***(alpha)*** +- Quectel BG96 ***(alpha)*** ### Supported boards/modules -- Arduino MKR GSM 1400 (*alpha*) +- Arduino MKR GSM 1400 ***(alpha)*** +- RAK WisLTE ***(alpha)*** - GPRSbee - Microduino GSM - Adafruit FONA (Mini Cellular GSM Breakout) From 2461a8d7e80cd5d73a956975d29604d07c401374 Mon Sep 17 00:00:00 2001 From: Volodymyr Shymanskyy Date: Mon, 23 Apr 2018 15:01:59 +0300 Subject: [PATCH 2/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f05e191..ce2b283 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ GPS/GNSS | ✔¹ | 🅧 | ◌¹ | 🅧 | - ... other modules, based on supported modems More modems may be supported later: -- [ ] Quectel M10, M95, UG95 +- [ ] Quectel M10, M35, M95, UG95 - [ ] SIMCom SIM5320, SIM5360, SIM5216, SIM7xxx - [ ] Telit GL865 - [ ] ZTE MG2639 From 6daebe48bf2b008111a11392bf819be546ba1cfd Mon Sep 17 00:00:00 2001 From: Volodymyr Shymanskyy Date: Mon, 23 Apr 2018 15:07:18 +0300 Subject: [PATCH 3/7] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ce2b283..0d59b41 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,7 @@ GPS/GNSS | ✔¹ | 🅧 | ◌¹ | 🅧 | More modems may be supported later: - [ ] Quectel M10, M35, M95, UG95 +- [ ] Sequans Monarch LTE Cat M1/NB1 - [ ] SIMCom SIM5320, SIM5360, SIM5216, SIM7xxx - [ ] Telit GL865 - [ ] ZTE MG2639 From 0041755e81467086e013a4c902807aff542aad9c Mon Sep 17 00:00:00 2001 From: Volodymyr Shymanskyy Date: Mon, 23 Apr 2018 15:26:28 +0300 Subject: [PATCH 4/7] Update README.md --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 0d59b41..4bc4025 100644 --- a/README.md +++ b/README.md @@ -116,6 +116,13 @@ If you have found TinyGSM to be useful in your work, research or company, please 3. Check if serial connection is working (Hardware Serial is recommended) Send an ```AT``` command using [this sketch](tools/AT_Debug/AT_Debug.ino) 4. Ensure that GSM antenna is firmly attached + +If you have any issues: + + 1. Read the whole README (you're looking at it!) + 2. Try running the Diagnostics sketch + 3. Check for [**highlighted topics here**](https://github.com/vshymanskyy/TinyGSM/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22for+reference%22+) + 4. If you have a question, post it in [Gitter chat](https://gitter.im/tinygsm) ## How does it work? From 2dbfa1621502038739b33bd379787063ee74f753 Mon Sep 17 00:00:00 2001 From: Lefteris Date: Wed, 25 Apr 2018 10:05:00 +0300 Subject: [PATCH 5/7] Added Network Time Fetching for SimXXX --- examples/AllFunctions/AllFunctions.ino | 6 ++++ keywords.txt | 3 ++ src/TinyGsmClientSIM800.h | 38 ++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) diff --git a/examples/AllFunctions/AllFunctions.ino b/examples/AllFunctions/AllFunctions.ino index 38cb365..d175ec2 100644 --- a/examples/AllFunctions/AllFunctions.ino +++ b/examples/AllFunctions/AllFunctions.ino @@ -126,6 +126,12 @@ void loop() { String gsmLoc = modem.getGsmLocation(); DBG("GSM location:", gsmLoc); + // This is only supported on SIMxxx series + String gsmTime = modem.getGSMDateTime(DATE_TIME); + DBG("GSM Time:", gsmTime); + String gsmDate = modem.getGSMDateTime(DATE_DATE); + DBG("GSM Date:", gsmDate); + String ussd_balance = modem.sendUSSD("*111#"); DBG("Balance (USSD):", ussd_balance); diff --git a/keywords.txt b/keywords.txt index 33f98c4..b6b4b10 100644 --- a/keywords.txt +++ b/keywords.txt @@ -24,3 +24,6 @@ factoryReset KEYWORD2 ####################################### # Literals (LITERAL1) ####################################### +DATE_FULL LITERAL1 +DATE_TIME LITERAL1 +DATE_DATE LITERAL1 diff --git a/src/TinyGsmClientSIM800.h b/src/TinyGsmClientSIM800.h index 13a62a9..a841a66 100644 --- a/src/TinyGsmClientSIM800.h +++ b/src/TinyGsmClientSIM800.h @@ -39,6 +39,11 @@ enum RegStatus { REG_UNKNOWN = 4, }; +enum DateTime { + DATE_FULL = 0, + DATE_TIME = 1, + DATE_DATE = 2 +}; class TinyGsmSim800 { @@ -307,6 +312,13 @@ public: if (!testAT()) { return false; } + //Enable Local Time Stamp for getting network time + sendAT(GF("+CLTS=1")); + if (waitResponse(10000L) != 1) { + return false; + } + sendAT(GF("&W")); + waitResponse(); sendAT(GF("+CFUN=0")); if (waitResponse(10000L) != 1) { return false; @@ -719,6 +731,32 @@ public: return res; } + /* + * Time functions + */ + String getGSMDateTime(DateTime format) { + sendAT(GF("+CCLK?")); + if (waitResponse(2000L, GF(GSM_NL "+CCLK: \"")) != 1) { + return ""; + } + + String res; + + switch(format) { + case DATE_FULL: + res = stream.readStringUntil('"'); + break; + case DATE_TIME: + streamSkipUntil(','); + res = stream.readStringUntil('"'); + break; + case DATE_DATE: + res = stream.readStringUntil(','); + break; + } + return res; + } + /* * Battery functions */ From b5057f78dc37910451e0d7b8757519e484731266 Mon Sep 17 00:00:00 2001 From: Volodymyr Shymanskyy Date: Thu, 26 Apr 2018 22:51:35 +0300 Subject: [PATCH 6/7] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4bc4025..9b8af76 100644 --- a/README.md +++ b/README.md @@ -143,8 +143,9 @@ Use this sketch to diagnose your SIM card and GPRS connection: ### Ensure stable data & power connection -This actually solves stability problems in **many** cases: -- Provide a good, [stable power supply](https://github.com/vshymanskyy/TinyGSM/wiki/Powering-GSM-module) (up to 2A and specific voltage according to your module documentation) +Most modules require up to 2A and specific voltage - according to the module documentation. +So this actually solves stability problems in **many** cases: +- Provide a good stable power supply. Read about [**powering your module**](https://github.com/vshymanskyy/TinyGSM/wiki/Powering-GSM-module). - Keep your wires as short as possible - Consider soldering them for a stable connection - Do not put your wires next to noisy signal sources (buck converters, antennas, oscillators etc.) From 77677ad705f27f5af249b8327f685f38a8ce99d5 Mon Sep 17 00:00:00 2001 From: Volodymyr Shymanskyy Date: Thu, 26 Apr 2018 22:53:10 +0300 Subject: [PATCH 7/7] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9b8af76..f8b68dd 100644 --- a/README.md +++ b/README.md @@ -154,6 +154,7 @@ So this actually solves stability problems in **many** cases: When using ```SoftwareSerial``` (on Uno, Nano, etc), the speed **115200** may not work. Try selecting **57600**, **38400**, or even lower - the one that works best for you. +In some cases **9600** is unstable, but using **38400** helps, etc. Be sure to set correct TX/RX pins in the sketch. Please note that not every Arduino pin can serve as TX or RX pin. **Read more about SoftSerial options and configuration [here](https://www.pjrc.com/teensy/td_libs_AltSoftSerial.html) and [here](https://www.arduino.cc/en/Reference/SoftwareSerial).**