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 Jan 24 10:42:08 2018 +0100
Revision:
5:efa13fc5d99a
Added TLS secured connection

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mapellil 5:efa13fc5d99a 1 /*
mapellil 5:efa13fc5d99a 2 * Copyright (C) 2006-2016, Arm Limited, All Rights Reserved
mapellil 5:efa13fc5d99a 3 * SPDX-License-Identifier: Apache-2.0
mapellil 5:efa13fc5d99a 4 *
mapellil 5:efa13fc5d99a 5 * Licensed under the Apache License, Version 2.0 (the "License"); you may
mapellil 5:efa13fc5d99a 6 * not use this file except in compliance with the License.
mapellil 5:efa13fc5d99a 7 * You may obtain a copy of the License at
mapellil 5:efa13fc5d99a 8 *
mapellil 5:efa13fc5d99a 9 * http://www.apache.org/licenses/LICENSE-2.0
mapellil 5:efa13fc5d99a 10 *
mapellil 5:efa13fc5d99a 11 * Unless required by applicable law or agreed to in writing, software
mapellil 5:efa13fc5d99a 12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
mapellil 5:efa13fc5d99a 13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
mapellil 5:efa13fc5d99a 14 * See the License for the specific language governing permissions and
mapellil 5:efa13fc5d99a 15 * limitations under the License.
mapellil 5:efa13fc5d99a 16 *
mapellil 5:efa13fc5d99a 17 * This file is part of Mbed TLS (https://tls.mbed.org)
mapellil 5:efa13fc5d99a 18 */
mapellil 5:efa13fc5d99a 19
mapellil 5:efa13fc5d99a 20 #if !defined(MBEDTLS_ENTROPY_HARDWARE_ALT) && \
mapellil 5:efa13fc5d99a 21 !defined(MBEDTLS_ENTROPY_NV_SEED) && !defined(MBEDTLS_TEST_NULL_ENTROPY)
mapellil 5:efa13fc5d99a 22 #error "This hardware does not have an entropy source."
mapellil 5:efa13fc5d99a 23 #endif /* !MBEDTLS_ENTROPY_HARDWARE_ALT && !MBEDTLS_ENTROPY_NV_SEED &&
mapellil 5:efa13fc5d99a 24 * !MBEDTLS_TEST_NULL_ENTROPY */
mapellil 5:efa13fc5d99a 25
mapellil 5:efa13fc5d99a 26 #if !defined(MBEDTLS_SHA1_C)
mapellil 5:efa13fc5d99a 27 #define MBEDTLS_SHA1_C
mapellil 5:efa13fc5d99a 28 #endif /* !MBEDTLS_SHA1_C */
mapellil 5:efa13fc5d99a 29
mapellil 5:efa13fc5d99a 30 /*
mapellil 5:efa13fc5d99a 31 * This value is sufficient for handling 2048 bit RSA keys.
mapellil 5:efa13fc5d99a 32 *
mapellil 5:efa13fc5d99a 33 * Set this value higher to enable handling larger keys, but be aware that this
mapellil 5:efa13fc5d99a 34 * will increase the stack usage.
mapellil 5:efa13fc5d99a 35 */
mapellil 5:efa13fc5d99a 36 #define MBEDTLS_MPI_MAX_SIZE 256
mapellil 5:efa13fc5d99a 37
mapellil 5:efa13fc5d99a 38 #define MBEDTLS_MPI_WINDOW_SIZE 1
mapellil 5:efa13fc5d99a 39
mapellil 5:efa13fc5d99a 40 #if defined(TARGET_STM32F439xI) && defined(MBEDTLS_CONFIG_HW_SUPPORT)
mapellil 5:efa13fc5d99a 41 #undef MBEDTLS_AES_ALT
mapellil 5:efa13fc5d99a 42 #endif /* TARGET_STM32F439xI && MBEDTLS_CONFIG_HW_SUPPORT */