This example program uses HiveMQ Broker (http://www.mqtt-dashboard.com/index.html) to both publish andsubscribe to topics.
Dependencies: WNCInterface mbed-rtos mbed
See the README for details on this example program. NOTE: When started, the program can take up to 40 seconds before it will respond. This delay is the time required for the WNC Data Module to connect with the network.
Revision 3:9413314f8017, committed 2016-10-07
- Comitter:
- JMF
- Date:
- Fri Oct 07 01:32:30 2016 +0000
- Parent:
- 2:cedbc9de0521
- Child:
- 4:4e31afefdf81
- Commit message:
- moved the initial printf so that it displays before the WNC initialization is started. That way you will know the program is running...
Changed in this revision
| WNCInterface.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/WNCInterface.lib Fri Oct 07 01:17:37 2016 +0000 +++ b/WNCInterface.lib Fri Oct 07 01:32:30 2016 +0000 @@ -1,1 +1,1 @@ -https://developer.mbed.org/teams/Avnet/code/WNCInterface/#fded23f50479 +https://developer.mbed.org/teams/Avnet/code/WNCInterface/#4b38bfb1704d
--- a/main.cpp Fri Oct 07 01:17:37 2016 +0000
+++ b/main.cpp Fri Oct 07 01:32:30 2016 +0000
@@ -113,6 +113,7 @@
controlLED(blue);
pc.baud(115200);
+ pc.printf("\r\n\r\nWelcome to the K64F MQTT Demo!\r\n");
// set SW2 and SW3 to generate interrupt on falling edge
switch2.fall(&sw2_ISR);
@@ -130,7 +131,6 @@
char* hostname = BROKER;
int port = PORT;
- pc.printf("\r\n\r\nWelcome to the K64F MQTT Demo!\r\n");
pc.printf("\r\nConnected to local network...\r\n");
pc.printf("IP address is %s\r\n", eth.getIPAddress());
pc.printf("MAC address is %s\r\n", eth.getMACAddress());