Publisher for IBM Quickstart and Watson IoT cloud.

Dependencies:   MQTT NDefLib X_NUCLEO_IKS01A2 X_NUCLEO_NFC01A1

Fork of Cloud_IBM_MbedOS by ST Expansion SW Team

To start the demo the following expansion boards are required

X_NUCLEO_IDW01M1v2, X_NUCLEO_IKS01A2, X_NUCLEO_NFC01A1

and as MCU board the NUCLEO-L476RG as it include a True Random Number Generator needed for TLS.

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

  • In case the X-NUCLEO-NFC-01A1 is on the board stack the WiFi SSID and password can be passed through the NFC tag by means of: 1) enabling the NFC support defining the X_NUCLEO_NFC01A1_PRESENT and recompiling, 2) when prompted on hyperterminal, programming the SSID and password to NFC using the Android app "NFCtools"
  • In case the NFC is not present, you local WiFi SSID and password can be programmed to mbed_app.json file and compiling and flashing 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 IBM quickstart 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).

In case of registered connection ( internetofthings.ibmcloud.com ) is needed ( no TLS ) comment the #define ORG_QUICKSTART than check in the mbed_app.json the following fields and change them according to your IBM MQTT broker account, MQTT_ORG_ID, MQTT_DEVICE_PASSWORD, MQTT_DEVICE_ID, MQTT_DEVICE_TYPE.

In case of registered connection ( internetofthings.ibmcloud.com ) with TLS encryption is needed, uncomment the #define TLS_EN and make sure the certificate (SSL_CA_PEM) is still valid.

In the default case the application connect to quickstart.internetofthings.ibmcloud.com without any encryption not authentication.

Committer:
mapellil
Date:
Wed Feb 21 10:11:06 2018 +0100
Revision:
7:d18775ea6734
Parent:
6:0fafb8229e58
masked wifi passw

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mapellil 0:e477c0f8b2e4 1 {
mapellil 0:e477c0f8b2e4 2 "config": {
mapellil 0:e477c0f8b2e4 3 "network-interface":{
mapellil 0:e477c0f8b2e4 4 "help": "options are ETHERNET, WIFI_ESP8266, WIFI_IDW0XX1, WIFI_ODIN, WIFI_RTW, MESH_LOWPAN_ND, MESH_THREAD, CELLULAR_ONBOARD",
mapellil 0:e477c0f8b2e4 5 "value": "WIFI_IDW0XX1"
mapellil 0:e477c0f8b2e4 6 },
mapellil 0:e477c0f8b2e4 7 "wifi-ssid": {
mapellil 5:efa13fc5d99a 8 "value": "\"crespan\""
mapellil 0:e477c0f8b2e4 9 },
mapellil 0:e477c0f8b2e4 10 "wifi-password": {
mapellil 5:efa13fc5d99a 11 "value": "\"password\""
mapellil 0:e477c0f8b2e4 12 },
mapellil 0:e477c0f8b2e4 13 "wifi-tx": {
mapellil 0:e477c0f8b2e4 14 "help": "TX pin for serial connection to external device",
mapellil 0:e477c0f8b2e4 15 "value": "PA_11"
mapellil 0:e477c0f8b2e4 16 },
mapellil 0:e477c0f8b2e4 17 "wifi-rx": {
mapellil 0:e477c0f8b2e4 18 "help": "RX pin for serial connection to external device",
mapellil 0:e477c0f8b2e4 19 "value": "PA_12"
mapellil 0:e477c0f8b2e4 20 }
mapellil 0:e477c0f8b2e4 21 },
mapellil 0:e477c0f8b2e4 22 "macros": [ "MQTT_BROKER_URL=\".messaging.internetofthings.ibmcloud.com\"",
mapellil 0:e477c0f8b2e4 23 "MQTT_CLIENT_ID=\"g:pvko17:<your DEVICE_ID_TYPE>:<your DEVICE_ID>\"",
mapellil 2:e3846f091b6b 24 "MQTT_ORG_ID=\"93ygbc\"",
mapellil 0:e477c0f8b2e4 25 "MQTT_USERNAME=\"use-token-auth\"",
mapellil 5:efa13fc5d99a 26 "MQTT_DEVICE_PASSWORD=\"Sonmi123\"",
mapellil 0:e477c0f8b2e4 27 "MQTT_TOPIC=\"iot-2/evt/status/fmt/json\"",
mapellil 2:e3846f091b6b 28 "MQTT_DEVICE_ID=\"licio\"",
mapellil 2:e3846f091b6b 29 "MQTT_DEVICE_TYPE=\"envsens\"",
mapellil 0:e477c0f8b2e4 30 "MQTT_KEEPALIVE 10",
mapellil 0:e477c0f8b2e4 31 "MQTT_PORT 1883",
mapellil 5:efa13fc5d99a 32 "MQTT_TLS_PORT 8883",
mapellil 6:0fafb8229e58 33 "MBED_CONF_APP_MAIN_STACK_SIZE=6120",
mapellil 5:efa13fc5d99a 34 "MBEDTLS_USER_CONFIG_FILE=\"mbedtls_entropy_config.h\""
mapellil 5:efa13fc5d99a 35 ],
mapellil 0:e477c0f8b2e4 36 "target_overrides": {
mapellil 0:e477c0f8b2e4 37 "*": {
mapellil 0:e477c0f8b2e4 38 "target.features_add": ["NANOSTACK", "LOWPAN_ROUTER", "COMMON_PAL"],
mapellil 0:e477c0f8b2e4 39 "mbed-mesh-api.6lowpan-nd-channel-page": 0,
mapellil 0:e477c0f8b2e4 40 "mbed-mesh-api.6lowpan-nd-channel": 12
mapellil 0:e477c0f8b2e4 41 },
mapellil 0:e477c0f8b2e4 42 "K64F": {
mapellil 0:e477c0f8b2e4 43 },
mapellil 0:e477c0f8b2e4 44 "NUCLEO_F401RE": {
mapellil 0:e477c0f8b2e4 45 "wifi-tx": "D8",
mapellil 0:e477c0f8b2e4 46 "wifi-rx": "D2",
mapellil 0:e477c0f8b2e4 47 "target.macros_add": ["IKS01A2"]
mapellil 0:e477c0f8b2e4 48 },
mapellil 0:e477c0f8b2e4 49 "DISCO_L475VG_IOT01A": {
mapellil 0:e477c0f8b2e4 50 },
mapellil 0:e477c0f8b2e4 51 "NUCLEO_L476RG": {
mapellil 0:e477c0f8b2e4 52 }
mapellil 0:e477c0f8b2e4 53 }
mapellil 0:e477c0f8b2e4 54 }