Browse Source

Update examples

v_master
Volodymyr Shymanskyy 6 years ago
parent
commit
799ab7c078
7 changed files with 22 additions and 5 deletions
  1. +4
    -1
      examples/AllFunctions/AllFunctions.ino
  2. +2
    -0
      examples/BlynkClient/BlynkClient.ino
  3. +2
    -0
      examples/FileDownload/FileDownload.ino
  4. +2
    -0
      examples/HttpClient/HttpClient.ino
  5. +3
    -1
      examples/HttpsClient/HttpsClient.ino
  6. +7
    -3
      examples/MqttClient/MqttClient.ino
  7. +2
    -0
      examples/WebClient/WebClient.ino

+ 4
- 1
examples/AllFunctions/AllFunctions.ino View File

@ -13,6 +13,8 @@
#define TINY_GSM_MODEM_SIM800 #define TINY_GSM_MODEM_SIM800
// #define TINY_GSM_MODEM_SIM808 // #define TINY_GSM_MODEM_SIM808
// #define TINY_GSM_MODEM_SIM900 // #define TINY_GSM_MODEM_SIM900
// #define TINY_GSM_MODEM_UBLOX
// #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
@ -97,7 +99,8 @@ void loop() {
return; return;
} }
bool res;
bool res = modem.isGprsConnected();
DBG("GPRS status:", res ? "connected" : "not connected");
String ccid = modem.getSimCCID(); String ccid = modem.getSimCCID();
DBG("CCID:", ccid); DBG("CCID:", ccid);


+ 2
- 0
examples/BlynkClient/BlynkClient.ino View File

@ -32,6 +32,8 @@
#define TINY_GSM_MODEM_SIM800 #define TINY_GSM_MODEM_SIM800
// #define TINY_GSM_MODEM_SIM808 // #define TINY_GSM_MODEM_SIM808
// #define TINY_GSM_MODEM_SIM900 // #define TINY_GSM_MODEM_SIM900
// #define TINY_GSM_MODEM_UBLOX
// #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


+ 2
- 0
examples/FileDownload/FileDownload.ino View File

@ -17,6 +17,8 @@
#define TINY_GSM_MODEM_SIM800 #define TINY_GSM_MODEM_SIM800
// #define TINY_GSM_MODEM_SIM808 // #define TINY_GSM_MODEM_SIM808
// #define TINY_GSM_MODEM_SIM900 // #define TINY_GSM_MODEM_SIM900
// #define TINY_GSM_MODEM_UBLOX
// #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


+ 2
- 0
examples/HttpClient/HttpClient.ino View File

@ -18,6 +18,8 @@
#define TINY_GSM_MODEM_SIM800 #define TINY_GSM_MODEM_SIM800
// #define TINY_GSM_MODEM_SIM808 // #define TINY_GSM_MODEM_SIM808
// #define TINY_GSM_MODEM_SIM900 // #define TINY_GSM_MODEM_SIM900
// #define TINY_GSM_MODEM_UBLOX
// #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


+ 3
- 1
examples/HttpsClient/HttpsClient.ino View File

@ -10,7 +10,8 @@
* TinyGSM Getting Started guide: * TinyGSM Getting Started guide:
* http://tiny.cc/tiny-gsm-readme * http://tiny.cc/tiny-gsm-readme
* *
* SSL/TLS is currently supported only with SIM8xx series
* SSL/TLS is currently supported only with: SIM8xx, uBlox
*
* For more HTTP API examples, see ArduinoHttpClient library * For more HTTP API examples, see ArduinoHttpClient library
* *
**************************************************************/ **************************************************************/
@ -18,6 +19,7 @@
// 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_SIM808
// #define TINY_GSM_MODEM_UBLOX
// Increase RX buffer if needed // Increase RX buffer if needed
//#define TINY_GSM_RX_BUFFER 512 //#define TINY_GSM_RX_BUFFER 512


+ 7
- 3
examples/MqttClient/MqttClient.ino View File

@ -31,6 +31,8 @@
#define TINY_GSM_MODEM_SIM800 #define TINY_GSM_MODEM_SIM800
// #define TINY_GSM_MODEM_SIM808 // #define TINY_GSM_MODEM_SIM808
// #define TINY_GSM_MODEM_SIM900 // #define TINY_GSM_MODEM_SIM900
// #define TINY_GSM_MODEM_UBLOX
// #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
@ -131,9 +133,8 @@ boolean mqttConnect() {
void loop() { void loop() {
if (mqtt.connected()) {
mqtt.loop();
} else {
if (!mqtt.connected()) {
SerialMon.println("=== MQTT NOT CONNECTED ===");
// Reconnect every 10 seconds // Reconnect every 10 seconds
unsigned long t = millis(); unsigned long t = millis();
if (t - lastReconnectAttempt > 10000L) { if (t - lastReconnectAttempt > 10000L) {
@ -142,8 +143,11 @@ void loop() {
lastReconnectAttempt = 0; lastReconnectAttempt = 0;
} }
} }
delay(100);
return;
} }
mqtt.loop();
} }
void mqttCallback(char* topic, byte* payload, unsigned int len) { void mqttCallback(char* topic, byte* payload, unsigned int len) {


+ 2
- 0
examples/WebClient/WebClient.ino View File

@ -12,6 +12,8 @@
#define TINY_GSM_MODEM_SIM800 #define TINY_GSM_MODEM_SIM800
// #define TINY_GSM_MODEM_SIM808 // #define TINY_GSM_MODEM_SIM808
// #define TINY_GSM_MODEM_SIM900 // #define TINY_GSM_MODEM_SIM900
// #define TINY_GSM_MODEM_UBLOX
// #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


Loading…
Cancel
Save