From d76a2a645c985ae3ab9ed93734e7bab5bd79f52e Mon Sep 17 00:00:00 2001 From: Volodymyr Shymanskyy Date: Thu, 29 Dec 2016 14:13:50 +0200 Subject: [PATCH] Update examples --- examples/BlynkClient/BlynkClient.ino | 6 ++++++ examples/FileDownload/FileDownload.ino | 18 +++++++++++++++--- examples/MqttClient/MqttClient.ino | 6 ++++++ examples/WebClient/WebClient.ino | 6 ++++++ 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/examples/BlynkClient/BlynkClient.ino b/examples/BlynkClient/BlynkClient.ino index 794d426..9efa713 100644 --- a/examples/BlynkClient/BlynkClient.ino +++ b/examples/BlynkClient/BlynkClient.ino @@ -28,6 +28,11 @@ // If you want override this value, uncomment and set this option: //#define BLYNK_HEARTBEAT 30 +// Select your modem: +#define TINY_GSM_MODEM_SIM800 +//#define TINY_GSM_MODEM_SIM900 +//#define TINY_GSM_MODEM_M590 + #include #include @@ -62,6 +67,7 @@ void setup() // Restart takes quite some time // To skip it, call init() instead of restart() + Serial.println("Initializing modem..."); modem.restart(); // Unlock your SIM card with a PIN diff --git a/examples/FileDownload/FileDownload.ino b/examples/FileDownload/FileDownload.ino index 428bfec..4b88be2 100644 --- a/examples/FileDownload/FileDownload.ino +++ b/examples/FileDownload/FileDownload.ino @@ -7,8 +7,19 @@ * TinyGSM Getting Started guide: * http://tiny.cc/tiny-gsm-readme * + * ATTENTION! Downloading big files requires quite a lot + * of knowledge - so this is for more experienced developers. + * **************************************************************/ +// Select your modem: +#define TINY_GSM_MODEM_SIM800 +//#define TINY_GSM_MODEM_SIM900 +//#define TINY_GSM_MODEM_M590 + +// Increase RX buffer +#define TINY_GSM_RX_BUFFER 1030 + #include #include @@ -29,9 +40,9 @@ TinyGsm modem(SerialAT); TinyGsmClient client(modem); const char server[] = "cdn.rawgit.com"; -const char resource[] = "/vshymanskyy/tinygsm/master/extras/test_10k.hex"; -uint32_t knownCRC32 = 0x54b3dcbf; -uint32_t knownFileSize = 10240; // In case server does not send it +const char resource[] = "/vshymanskyy/tinygsm/master/extras/test_1k.bin"; +uint32_t knownCRC32 = 0x6f50d767; +uint32_t knownFileSize = 1024; // In case server does not send it void setup() { // Set console baud rate @@ -44,6 +55,7 @@ void setup() { // Restart takes quite some time // To skip it, call init() instead of restart() + Serial.println("Initializing modem..."); modem.restart(); // Unlock your SIM card with a PIN diff --git a/examples/MqttClient/MqttClient.ino b/examples/MqttClient/MqttClient.ino index 1c5f972..51a8f16 100644 --- a/examples/MqttClient/MqttClient.ino +++ b/examples/MqttClient/MqttClient.ino @@ -25,6 +25,11 @@ * **************************************************************/ +// Select your modem: +#define TINY_GSM_MODEM_SIM800 +//#define TINY_GSM_MODEM_SIM900 +//#define TINY_GSM_MODEM_M590 + #include #include @@ -69,6 +74,7 @@ void setup() { // Restart takes quite some time // To skip it, call init() instead of restart() + Serial.println("Initializing modem..."); modem.restart(); // Unlock your SIM card with a PIN diff --git a/examples/WebClient/WebClient.ino b/examples/WebClient/WebClient.ino index b8db67a..09c2cec 100644 --- a/examples/WebClient/WebClient.ino +++ b/examples/WebClient/WebClient.ino @@ -8,6 +8,11 @@ * **************************************************************/ +// Select your modem: +#define TINY_GSM_MODEM_SIM800 +//#define TINY_GSM_MODEM_SIM900 +//#define TINY_GSM_MODEM_M590 + #include // Your GPRS credentials @@ -40,6 +45,7 @@ void setup() { // Restart takes quite some time // To skip it, call init() instead of restart() + Serial.println("Initializing modem..."); modem.restart(); // Unlock your SIM card with a PIN