trash over HTTP
Dependencies: C027_Support HTTPClient TrashSensors mbed Crypto
Fork of SLOTrashHTTP by
Collects sensor readings and sends them to https://trash.coreyford.name/
Server code: https://github.com/coyotebush/trash-map
Diff: main.cpp
- Revision:
- 7:49f2a1277737
- Parent:
- 6:43ac8ef67a03
- Child:
- 8:2398817ac9c2
--- a/main.cpp Sun May 31 22:25:25 2015 +0000 +++ b/main.cpp Thu Jun 04 04:59:57 2015 +0000 @@ -5,6 +5,8 @@ #include "GroveTemp.h" #include "GPS.h" +#include "Watchdog.h" + #include "SHA1.h" #include "HMAC.h" @@ -31,6 +33,8 @@ mbed_mac_address(macAddress); printf("MAC address is %02X%02X%02X%02X%02X%02X\r\n", macAddress[0], macAddress[1], macAddress[2], macAddress[3], macAddress[4], macAddress[5]); + Watchdog wdt; + GPSSerial gps; #ifdef CELLULAR_NETWORK @@ -59,6 +63,8 @@ GroveTempSensor tempS; double tempV; + wdt.kick(30.0); + while (true) { // Distance sensor distS.start(); @@ -88,6 +94,7 @@ break; } } + wdt.kick(); // Combine readings in JSON char json[255]; @@ -126,6 +133,8 @@ } first = false; + wdt.kick(); wait_ms(10000); + wdt.kick(); } }