CRTP!!!! Totally untested

Signed-off-by: Sara Damiano <sdamiano@stroudcenter.org>
This commit is contained in:
Sara Damiano
2020-02-06 15:20:44 -05:00
parent 7d6aba266c
commit d3d1083d8f
31 changed files with 5359 additions and 6794 deletions

View File

@@ -42,7 +42,7 @@
//SoftwareSerial SerialAT(2, 3); // RX, TX
// See all AT commands, if wanted
//#define DUMP_AT_COMMANDS
// #define DUMP_AT_COMMANDS
// Define the serial console for debug prints, if needed
#define TINY_GSM_DEBUG SerialMon
@@ -68,8 +68,8 @@
#define GSM_PIN ""
// Set phone numbers, if you want to test SMS and Calls
//#define SMS_TARGET "+380xxxxxxxxx"
//#define CALL_TARGET "+380xxxxxxxxx"
// #define SMS_TARGET "+380xxxxxxxxx"
// #define CALL_TARGET "+380xxxxxxxxx"
// Your GPRS credentials, if any
const char apn[] = "YourAPN";

View File

@@ -26,7 +26,7 @@
// Default heartbeat interval for GSM is 60
// If you want override this value, uncomment and set this option:
//#define BLYNK_HEARTBEAT 30
// #define BLYNK_HEARTBEAT 30
// Select your modem:
#define TINY_GSM_MODEM_SIM800

View File

@@ -52,14 +52,14 @@
#define TINY_GSM_RX_BUFFER 1024
// See all AT commands, if wanted
//#define DUMP_AT_COMMANDS
// #define DUMP_AT_COMMANDS
// Define the serial console for debug prints, if needed
#define TINY_GSM_DEBUG SerialMon
//#define LOGGING // <- Logging is for the HTTP library
// #define LOGGING // <- Logging is for the HTTP library
// Add a reception delay - may be needed for a fast processor at a slow baud rate
//#define TINY_GSM_YIELD() { delay(2); }
// #define TINY_GSM_YIELD() { delay(2); }
// Define how you're planning to connect to the internet
#define TINY_GSM_USE_GPRS true
@@ -217,7 +217,7 @@ void loop() {
client.print("Connection: close\r\n\r\n");
// Let's see what the entire elapsed time is, from after we send the request.
unsigned long timeElapsed = millis();
uint32_t timeElapsed = millis();
SerialMon.println(F("Waiting for response header"));
@@ -246,7 +246,7 @@ void loop() {
// SerialMon.print(c, HEX);
// SerialMon.print(' ');
// if (isprint(c))
// SerialMon.print((char) c);
// SerialMon.print(reinterpret_cast<char> c);
// else
// SerialMon.print('*');
// SerialMon.print(' ');
@@ -301,7 +301,7 @@ void loop() {
while (readLength < contentLength && client.connected() && millis() - clientReadStartTime < clientReadTimeout) {
while (client.available()) {
uint8_t c = client.read();
//SerialMon.print((char)c); // Uncomment this to show data
//SerialMon.print(reinterpret_cast<char>c); // Uncomment this to show data
crc.update(c);
readLength++;
if (readLength % (contentLength / 13) == 0) {

View File

@@ -57,18 +57,18 @@
#define TINY_GSM_RX_BUFFER 650
// See all AT commands, if wanted
//#define DUMP_AT_COMMANDS
// #define DUMP_AT_COMMANDS
// Define the serial console for debug prints, if needed
#define TINY_GSM_DEBUG SerialMon
//#define LOGGING // <- Logging is for the HTTP library
// #define LOGGING // <- Logging is for the HTTP library
// Range to attempt to autobaud
#define GSM_AUTOBAUD_MIN 9600
#define GSM_AUTOBAUD_MAX 115200
// Add a reception delay - may be needed for a fast processor at a slow baud rate
//#define TINY_GSM_YIELD() { delay(2); }
// #define TINY_GSM_YIELD() { delay(2); }
// Define how you're planning to connect to the internet
#define TINY_GSM_USE_GPRS true

View File

@@ -49,18 +49,18 @@
#define TINY_GSM_RX_BUFFER 650
// See all AT commands, if wanted
//#define DUMP_AT_COMMANDS
// #define DUMP_AT_COMMANDS
// Define the serial console for debug prints, if needed
#define TINY_GSM_DEBUG SerialMon
//#define LOGGING // <- Logging is for the HTTP library
// #define LOGGING // <- Logging is for the HTTP library
// Range to attempt to autobaud
#define GSM_AUTOBAUD_MIN 9600
#define GSM_AUTOBAUD_MAX 115200
// Add a reception delay - may be needed for a fast processor at a slow baud rate
//#define TINY_GSM_YIELD() { delay(2); }
// #define TINY_GSM_YIELD() { delay(2); }
// Define how you're planning to connect to the internet
#define TINY_GSM_USE_GPRS true

View File

@@ -60,7 +60,7 @@
//SoftwareSerial SerialAT(2, 3); // RX, TX
// See all AT commands, if wanted
//#define DUMP_AT_COMMANDS
// #define DUMP_AT_COMMANDS
// Define the serial console for debug prints, if needed
#define TINY_GSM_DEBUG SerialMon
@@ -70,7 +70,7 @@
#define GSM_AUTOBAUD_MAX 115200
// Add a reception delay - may be needed for a fast processor at a slow baud rate
//#define TINY_GSM_YIELD() { delay(2); }
// #define TINY_GSM_YIELD() { delay(2); }
// Define how you're planning to connect to the internet
#define TINY_GSM_USE_GPRS true
@@ -125,7 +125,7 @@ PubSubClient mqtt(client);
#define LED_PIN 13
int ledStatus = LOW;
long lastReconnectAttempt = 0;
uint32_t lastReconnectAttempt = 0;
void mqttCallback(char* topic, byte* payload, unsigned int len) {
SerialMon.print("Message arrived [");
@@ -252,7 +252,7 @@ void loop() {
if (!mqtt.connected()) {
SerialMon.println("=== MQTT NOT CONNECTED ===");
// Reconnect every 10 seconds
unsigned long t = millis();
uint32_t t = millis();
if (t - lastReconnectAttempt > 10000L) {
lastReconnectAttempt = t;
if (mqttConnect()) {

View File

@@ -47,7 +47,7 @@
#define TINY_GSM_RX_BUFFER 650
// See all AT commands, if wanted
//#define DUMP_AT_COMMANDS
// #define DUMP_AT_COMMANDS
// Define the serial console for debug prints, if needed
#define TINY_GSM_DEBUG SerialMon
@@ -57,10 +57,10 @@
#define GSM_AUTOBAUD_MAX 115200
// Add a reception delay - may be needed for a fast processor at a slow baud rate
//#define TINY_GSM_YIELD() { delay(2); }
// #define TINY_GSM_YIELD() { delay(2); }
// Uncomment this if you want to use SSL
//#define USE_SSL
// #define USE_SSL
// Define how you're planning to connect to the internet
#define TINY_GSM_USE_GPRS true
@@ -210,7 +210,7 @@ void loop() {
client.print("Connection: close\r\n\r\n");
client.println();
unsigned long timeout = millis();
uint32_t timeout = millis();
while (client.connected() && millis() - timeout < 10000L) {
// Print available data
while (client.available()) {

View File

@@ -12,15 +12,15 @@
#define TINY_GSM_MODEM_UBLOX
// Increase RX buffer if needed
//#define TINY_GSM_RX_BUFFER 512
// #define TINY_GSM_RX_BUFFER 512
#include <TinyGsmClient.h>
// Uncomment this if you want to see all AT commands
//#define DUMP_AT_COMMANDS
// #define DUMP_AT_COMMANDS
// Uncomment this if you want to use SSL
//#define USE_SSL
// #define USE_SSL
// Set serial for debug console (to the Serial Monitor, speed 115200)
#define SerialMon Serial
@@ -108,7 +108,7 @@ void loop() {
client.print(String("Host: ") + server + "\r\n");
client.print("Connection: close\r\n\r\n");
unsigned long timeout = millis();
uint32_t timeout = millis();
while (client.connected() && millis() - timeout < 10000L) {
// Print available data
while (client.available()) {

View File

@@ -18,16 +18,16 @@
#define TINY_GSM_MODEM_SIM800
// Increase RX buffer if needed
//#define TINY_GSM_RX_BUFFER 512
// #define TINY_GSM_RX_BUFFER 512
#include <TinyGsmClient.h>
#include <ArduinoHttpClient.h>
// Uncomment this if you want to see all AT commands
//#define DUMP_AT_COMMANDS
// #define DUMP_AT_COMMANDS
// Uncomment this if you want to use SSL
//#define USE_SSL
// #define USE_SSL
// Set serial for debug console (to the Serial Monitor, speed 115200)
#define SerialMon SerialUSB

View File

@@ -28,7 +28,7 @@
#define SerialAT Serial1
// Uncomment this if you want to see all AT commands
//#define DUMP_AT_COMMANDS
// #define DUMP_AT_COMMANDS
#ifdef DUMP_AT_COMMANDS