The ARM mbed MQTT client library is used to send/receive data to/from AT&T's M2X service (https://m2x.att.com/) using the AT&T Cellular IoT Starter Kit which is sold by Avnet (http://cloudconnectkits.org/product/att-cellular-iot-starter-kit).
Dependencies: M2XMQTTClient WNCInterface mbed-rtos mbed minimal-json minimal-mqtt-JMF
Diff: main.cpp
- Revision:
- 1:ceb54785e67c
- Parent:
- 0:b476b3f6cb65
- Child:
- 2:e355d362a2d8
--- a/main.cpp Wed Sep 21 18:21:52 2016 +0000 +++ b/main.cpp Tue Sep 27 19:54:39 2016 +0000 @@ -10,7 +10,6 @@ #define CRLF "\n\r" - //Device ID: 8bcfff8a8514678f0fc6b56cb0f55c87 //Master Key: 3d1f3c0f42a8c541205f706f62c65330 @@ -36,17 +35,21 @@ Client client; M2XMQTTClient m2xClient(&client, m2xKey); WNCInterface eth; +MODSERIAL pc(USBTX,USBRX,256,256); int main() { int response, cnt=1; double tval = 0.9; double hval = 101.0; - eth.init(); + pc.baud(115200); + printf(CRLF CRLF "M2X MQTT Test starting..." CRLF); + + eth.init(NULL,&pc); eth.connect(); - printf(CRLF CRLF "M2X MQTT Test..." CRLF); - printf("IP Address: %s" CRLF, eth.getIPAddress()); - + printf("IP Address: %s" CRLF, eth.getIPAddress()); + eth.doDebug(0); + while (true) { tval += 0.1; printf("\r\n\r\nSending readings #%d\r\n",cnt++); @@ -72,7 +75,6 @@ elevation++; delay(6000); -//eth.doDebug(3); } }