Connect through Wifi to IBM MQTT cloud https://quickstart.internetofthings.ibmcloud.com

Dependencies:   MQTT NetworkSocketAPI X_NUCLEO_IDW01M1v2 X_NUCLEO_IKS01A1 mbed NDefLib X_NUCLEO_NFC01A1

Fork of IDW01M1_Cloud_IBM by ST Expansion SW Team

To start the demo the following expansion boards are required

X_NUCLEO_IDW01M1v2, X_NUCLEO_IKS01A1, X_NUCLEO_NFC01A1

After having mounted the board stack on the Nucleo board the below steps should be followed:

  • Program in the application source code you local WiFi SSID and password and flash the binary. Make sure the Wifi network has visible SSID.
  • Reset the Nucleo board and after few seconds the Nucleo green led will be on (it means the Nucleo is connected to the local Wifi and to the IBM cloud server)
  • Read the NFC tag with an Android device and the browser will be automatically opened and directed to the specific brocker IBM demo page where the environmental values are displayed in form of a x-y graph. The values are updated every few seconds. On the Hyperterminal is possible to see the values sent to the IBM cloud server and the board mac address to be entered on the IBM quickstart web page if a manual connection is needed (eg. to connect from a PC browser).
Revision:
21:78fac4c1b0fa
Parent:
20:517b559ce91d
Child:
22:d278e4bb5ded
--- a/main.cpp	Mon Oct 17 15:47:36 2016 +0000
+++ b/main.cpp	Wed Oct 19 09:36:51 2016 +0000
@@ -41,8 +41,7 @@
 #define ORG "quickstart"     // connect to quickstart.internetofthings.ibmcloud.com/ For a registered connection, replace with your org 
 #define ID ""
 #define AUTH_TOKEN ""
-#define DEFAULT_TYPE_NAME "iotsample-mbed-NucleoF401RE"
-
+#define DEFAULT_TYPE_NAME "iotsample-mbed-Nucleo"
 #else
 #define ORG "play"             // connect to play.internetofthings.ibmcloud.com/ For a registered connection, replace with your org
 #define ID "testnucleo2"       // For a registered connection, replace with your id
@@ -55,8 +54,8 @@
 #define MQTT_TLS_PORT 8883
 #define IBM_IOT_PORT MQTT_PORT
 // WiFi network credential
-#define SSID   ""  // Network must be visible otherwise it can't connect
-#define PASSW  ""
+#define SSID   "crespan"  // Network must be visible otherwise it can't connect
+#define PASSW  "Elfrontal1"
 #warning "Wifi SSID & password empty"
     
 char id[30] = ID;                 // mac without colons  
@@ -181,7 +180,7 @@
     pressure_sensor->GetPressure(&press);
     humidity_sensor->GetHumidity(&hum);
     sprintf(buf,
-     "{\"d\":{\"ST\":\"Nucleo-IoT-mbed\",\"Temp\":%0.4f,\"Pressure\":\"%0.4f,\",\"Humidity\":%0.4f}}",
+     "{\"d\":{\"ST\":\"Nucleo-IoT-mbed\",\"Temp\":%0.4f,\"Pressure\":%0.4f,\"Humidity\":%0.4f}}",
               temp, press, hum);
     message.qos = MQTT::QOS0;
     message.retained = false;