Allow to DUMP_AT_COMMANDS
This commit is contained in:
@@ -23,8 +23,7 @@
|
|||||||
// Increase RX buffer
|
// Increase RX buffer
|
||||||
#define TINY_GSM_RX_BUFFER 1030
|
#define TINY_GSM_RX_BUFFER 1030
|
||||||
|
|
||||||
#include <TinyGsmClient.h>
|
//#define DUMP_AT_COMMANDS
|
||||||
#include <CRC32.h>
|
|
||||||
|
|
||||||
// Your GPRS credentials
|
// Your GPRS credentials
|
||||||
// Leave empty, if missing user or pass
|
// Leave empty, if missing user or pass
|
||||||
@@ -39,12 +38,23 @@ const char pass[] = "";
|
|||||||
//#include <SoftwareSerial.h>
|
//#include <SoftwareSerial.h>
|
||||||
//SoftwareSerial SerialAT(2, 3); // RX, TX
|
//SoftwareSerial SerialAT(2, 3); // RX, TX
|
||||||
|
|
||||||
TinyGsm modem(SerialAT);
|
#include <TinyGsmClient.h>
|
||||||
|
#include <CRC32.h>
|
||||||
|
|
||||||
|
#ifdef DUMP_AT_COMMANDS
|
||||||
|
#include <StreamDebugger.h>
|
||||||
|
StreamDebugger debugger(SerialAT, Serial);
|
||||||
|
TinyGsm modem(debugger);
|
||||||
|
#else
|
||||||
|
TinyGsm modem(SerialAT);
|
||||||
|
#endif
|
||||||
TinyGsmClient client(modem);
|
TinyGsmClient client(modem);
|
||||||
|
|
||||||
const char server[] = "cdn.rawgit.com";
|
const char server[] = "cdn.rawgit.com";
|
||||||
const char resource[] = "/vshymanskyy/tinygsm/master/extras/test_1k.bin";
|
const int port = 80;
|
||||||
uint32_t knownCRC32 = 0x6f50d767;
|
|
||||||
|
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
|
uint32_t knownFileSize = 1024; // In case server does not send it
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
@@ -102,7 +112,7 @@ void loop() {
|
|||||||
Serial.print(server);
|
Serial.print(server);
|
||||||
|
|
||||||
// if you get a connection, report back via serial:
|
// if you get a connection, report back via serial:
|
||||||
if (!client.connect(server, 80)) {
|
if (!client.connect(server, port)) {
|
||||||
Serial.println(" fail");
|
Serial.println(" fail");
|
||||||
delay(10000);
|
delay(10000);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user