Browse Source

Update examples

v_master
Volodymyr Shymanskyy 8 years ago
parent
commit
d76a2a645c
4 changed files with 33 additions and 3 deletions
  1. +6
    -0
      examples/BlynkClient/BlynkClient.ino
  2. +15
    -3
      examples/FileDownload/FileDownload.ino
  3. +6
    -0
      examples/MqttClient/MqttClient.ino
  4. +6
    -0
      examples/WebClient/WebClient.ino

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

@ -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 <TinyGsmClient.h>
#include <BlynkSimpleSIM800.h>
@ -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


+ 15
- 3
examples/FileDownload/FileDownload.ino View File

@ -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 <TinyGsmClient.h>
#include <CRC32.h>
@ -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


+ 6
- 0
examples/MqttClient/MqttClient.ino View File

@ -25,6 +25,11 @@
*
**************************************************************/
// Select your modem:
#define TINY_GSM_MODEM_SIM800
//#define TINY_GSM_MODEM_SIM900
//#define TINY_GSM_MODEM_M590
#include <TinyGsmClient.h>
#include <PubSubClient.h>
@ -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


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

@ -8,6 +8,11 @@
*
**************************************************************/
// Select your modem:
#define TINY_GSM_MODEM_SIM800
//#define TINY_GSM_MODEM_SIM900
//#define TINY_GSM_MODEM_M590
#include <TinyGsmClient.h>
// 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


Loading…
Cancel
Save