Avnet FAE Training class using Dragonfly, Aeris SIM, Exostie Cloud, Rohm Sensor board

Dependencies:   MbedJSONValue mbed mtsas

Fork of UUU_MultiTech_Dragonfly_Sprint_SF by Paul Jaeger

Files at this revision

API Documentation at this revision

Comitter:
BlueShadow
Date:
Wed Jul 27 23:31:42 2016 +0000
Parent:
9:6475e1b83491
Commit message:
MultiTech Dragonfly utilizing Rohm Sensor board, Aeris SIM, Exosite Cloud for Avent FAE training event.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 6475e1b83491 -r 75acd8caa0d3 main.cpp
--- a/main.cpp	Fri Apr 15 22:29:23 2016 +0000
+++ b/main.cpp	Wed Jul 27 23:31:42 2016 +0000
@@ -55,10 +55,11 @@
 #include <string>
 #include <sstream>
 
-#define EXOSITE_CIK "1e05228e50762cc29cf414bc518259a3ab5dc247"
+#define EXOSITE_CIK "< YOUR NUMBER HERE >"
 
-char EXOSITE_HEADER[] = "X-Exosite-CIK: " EXOSITE_CIK "\r\nAccept: application/x-www-form-urlencoded; charset=utf-8\r\n";
-const char EXOSITE_URL[] = "https://m2.exosite.com:443/onep:v1/stack/alias";
+char EXOSITE_HEADER[] = "X-Exosite-CIK: " EXOSITE_CIK "\r\nContent-Type: application/x-www-form-urlencoded; charset=utf-8\r\n";
+const char EXOSITE_URL[] = "https://m2.exosite.com:443/onep:v1/stack/alias?state";
+
 
 DigitalOut Led1Out(LED1);
 
@@ -73,8 +74,7 @@
 
 // APN associated with SIM card
 // this APN should work for the AT&T SIM that came with your Dragonfly
-//static const std::string apn = "";
-static const std::string apn = "b2b.tmobile.com";
+static const std::string apn = "< YOUR CELL PROVIDER HERE >";
 
 // set to true if you want to post to the cloud
 //bool do_cloud_post = false;
@@ -91,7 +91,8 @@
 
 // misc variables
 static char wall_of_dash[] = "--------------------------------------------------";
-static int post_interval_ms = 30000;
+
+static int post_interval_ms = 30000; //************* I don't want to wait 30 seconds ************************/
 int debug_baud = 115200;
 
 
@@ -402,13 +403,17 @@
 
             if (radio->connect()) {
                 int sensor_data = RPR0521_ALS[0];
-                logDebug("posting sensor data");
-                logDebug("%d",sensor_data);
+                logDebug("posting sensor data %d",sensor_data);
 
-                http_tx.put("ALS", patch::to_string(sensor_data).c_str());
+                std::string sensor_data_str = patch::to_string(sensor_data);
+                logDebug("Sensor data string: %s",sensor_data_str.c_str());
+
+                http_tx.clear();
+                http_tx.put("< YOUR EXOSITE DISPLAY VARIABLE HERE >", sensor_data_str.c_str());
 
                 // Make HTTP POST request
                 result = http.post(EXOSITE_URL, http_tx, &http_rx);
+//                logDebug("%s %s",EXOSITE_URL, EXOSITE_HEADER);
                 if (result != HTTP_OK) {
                     logError("HTTP POST failed [%d][%s]", result, httpResToStr(result));
                 } else {