MQTT

Dependencies:   ESP8266Interface3 MQTT mbed-rtos mbed

Fork of ESP8266_MQTT_HelloWorld by ESP8266

Files at this revision

API Documentation at this revision

Comitter:
blownelco
Date:
Mon Feb 06 08:34:14 2017 +0000
Parent:
18:76d0899bc3ce
Commit message:
mqtt

Changed in this revision

ESP8266Interface.lib Show annotated file Show diff for this revision Revisions of this file
MQTT.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
mbed-rtos.lib Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
test.h Show annotated file Show diff for this revision Revisions of this file
diff -r 76d0899bc3ce -r cff20f14096e ESP8266Interface.lib
--- a/ESP8266Interface.lib	Tue Jun 09 17:57:43 2015 +0000
+++ b/ESP8266Interface.lib	Mon Feb 06 08:34:14 2017 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/teams/ESP8266/code/ESP8266Interface/#1f4dd0e91837
+https://developer.mbed.org/users/blownelco/code/ESP8266Interface3/#3e59ddd16330
diff -r 76d0899bc3ce -r cff20f14096e MQTT.lib
--- a/MQTT.lib	Tue Jun 09 17:57:43 2015 +0000
+++ b/MQTT.lib	Mon Feb 06 08:34:14 2017 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/teams/mqtt/code/MQTT/#c299463ae853
+http://mbed.org/teams/mqtt/code/MQTT/#e335fcc1a663
diff -r 76d0899bc3ce -r cff20f14096e main.cpp
--- a/main.cpp	Tue Jun 09 17:57:43 2015 +0000
+++ b/main.cpp	Mon Feb 06 08:34:14 2017 +0000
@@ -24,12 +24,20 @@
 
 */
 
+#include <test.h>
+#include "mbed.h"
+
+//DigitalOut PWD(PTB2);  waar wordt deze pin dan gezet
+DigitalOut G15(PTB11);
 
 #include "MQTTESP8266.h"
 #include "MQTTClient.h"
 
 int arrivedcount = 0;
 
+char data[100];
+int cnt = 0; 
+
 // callback for subscribe topic
 void subscribeCallback(MQTT::MessageData& md)
 {
@@ -42,16 +50,19 @@
 // main function that sets up the subscription and makes a couple publishes
 int main(int argc, char* argv[])
 {
-    printf("Starting\n");
-    MQTTESP8266 ipstack(D1, D0, D10, "demossid","passphrase"); // change to match your wifi access point
-    float version = 0.47;
-    char* topic = "mbed-sample";
+    //PWD = 1;  dit is de reset pin
+    G15 = 0;
+ 
+    printf("Starting  MQTT\n");
+    MQTTESP8266 ipstack(PTD3,PTD2,PTB2, "QBMT","zoranetwerk"); // change to match your wifi access point PTD9 is fake pin
+    float version = 0.51;
+    char* topic = "mbe d-sample";
 
     printf("Version is %f\n", version);
-
+    
     MQTT::Client<MQTTESP8266, Countdown> client = MQTT::Client<MQTTESP8266, Countdown>(ipstack);
 
-    char* hostname = "85.119.83.194"; // test.mosquitto.org
+    char* hostname = "192.168.1.103"; // test.mosquitto.org
     int port = 1883;
     int rc = ipstack.connect(hostname, port);
     if (rc != 0)
@@ -59,9 +70,9 @@
 
     MQTTPacket_connectData data = MQTTPacket_connectData_initializer;
     data.MQTTVersion = 3;
-    data.clientID.cstring = "mbed-clientID";
-    data.username.cstring = "testuser";
-    data.password.cstring = "testpassword";
+    data.clientID.cstring = "blownelco";
+    data.username.cstring = "";
+    data.password.cstring = "";
     if ((rc = client.connect(data)) != 0)
         printf("rc from MQTT connect is %d\n", rc);
 
diff -r 76d0899bc3ce -r cff20f14096e mbed-rtos.lib
--- a/mbed-rtos.lib	Tue Jun 09 17:57:43 2015 +0000
+++ b/mbed-rtos.lib	Mon Feb 06 08:34:14 2017 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed-rtos/#e45e4ac7c3c8
+http://mbed.org/users/mbed_official/code/mbed-rtos/#58563e6cba1e
diff -r 76d0899bc3ce -r cff20f14096e mbed.bld
--- a/mbed.bld	Tue Jun 09 17:57:43 2015 +0000
+++ b/mbed.bld	Mon Feb 06 08:34:14 2017 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/cbbeb26dbd92
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/d75b3fe1f5cb
\ No newline at end of file
diff -r 76d0899bc3ce -r cff20f14096e test.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test.h	Mon Feb 06 08:34:14 2017 +0000
@@ -0,0 +1,2 @@
+extern char data[100];
+extern int cnt; 
\ No newline at end of file