MQTT client for IBM Bluemix

Dependencies:   HTS221 LIS3MDL LPS22HB LSM303AGR LSM6DSL MQTT VL53L0X

Getting started with IBM Bluemix

This is the MQTT Client example for mbed OS. It demonstrates how to connect a device with IBM Bluemix, how to get values from sensors, and how to see them on the IBM quickstart website. If you are unfamiliar with IBM Bluemix, we recommend that you read the introduction starting here.

Demo workflow:

  • Connection to the local network with 6LoWPAN ND connection.
  • Connection to the Quickstart Bluemix.
  • Read data sensors.
  • Sends data sensors to the Quickstart Bluemix

You can compile this project in three ways:

1. Using the Online compiler. Just clicking here:

/media/uploads/rspelta/import-mqtt.jpg

Information

Learn how to use the Online compiler reading https://docs.mbed.com/docs/mbed-os-handbook/en/latest/dev_tools/online_comp/ page.

2. Using the compiler on your PC:

Information

Learn how to use the mbed-cli reading https://docs.mbed.com/docs/mbed-os-handbook/en/latest/dev_tools/cli/ page.
The name of the machine is SILICA_SENSOR_NODE.

3. Exporting to 3rd party tools (IDE) like eclipse, IAR, uvision 5 and more others

Information

Learn how to use the mbed-cli reading https://docs.mbed.com/docs/mbed-os-handbook/en/latest/dev_tools/third_party/ page.

Warning

This example requires a Border Router board. For more details please read the Border Router paragraph from this page.

Please read carefully the next pages:

  • What to do before to compile the project: read here. This step is indipendent from the way you compile the project.
Committer:
rspelta
Date:
Thu Nov 02 11:01:13 2017 +0100
Revision:
0:e673387d5add
release

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rspelta 0:e673387d5add 1 {
rspelta 0:e673387d5add 2 "config": {
rspelta 0:e673387d5add 3 "network-interface":{
rspelta 0:e673387d5add 4 "help": "Options are ETHERNET, WIFI_ESP8266, WIFI_ODIN, MESH_LOWPAN_ND, MESH_THREAD",
rspelta 0:e673387d5add 5 "value": "MESH_LOWPAN_ND"
rspelta 0:e673387d5add 6 },
rspelta 0:e673387d5add 7 "mesh_radio_type": {
rspelta 0:e673387d5add 8 "help": "options are ATMEL, MCR20, SPIRIT1, EFR32, SENSOR_NODE_SPIRIT1",
rspelta 0:e673387d5add 9 "value": "SENSOR_NODE_SPIRIT1"
rspelta 0:e673387d5add 10 }
rspelta 0:e673387d5add 11 },
rspelta 0:e673387d5add 12 "macros": ["MBEDTLS_USER_CONFIG_FILE=\"mbedtls_mbed_client_config.h\"",
rspelta 0:e673387d5add 13 "SPIRIT1_SPI_MOSI=PG_11",
rspelta 0:e673387d5add 14 "SPIRIT1_SPI_MISO=PG_10",
rspelta 0:e673387d5add 15 "SPIRIT1_SPI_SCLK=PG_9",
rspelta 0:e673387d5add 16 "SPIRIT1_DEV_IRQ=PC_2",
rspelta 0:e673387d5add 17 "SPIRIT1_DEV_CS=PG_12",
rspelta 0:e673387d5add 18 "SPIRIT1_DEV_SDN=NC",
rspelta 0:e673387d5add 19 "MQTT_URL_BROKER=\"fdff::9f08:a9d4\"",
rspelta 0:e673387d5add 20 "MQTT_CLIENT_ID=\"g:pvko17:<your DEVICE_ID_TYPE>:<your DEVICE_ID>\"",
rspelta 0:e673387d5add 21 "MQTT_USERNAME=\"use-token-auth\"",
rspelta 0:e673387d5add 22 "MQTT_PASSWORD=\"<your DEVICE_ID>\"",
rspelta 0:e673387d5add 23 "MQTT_TOPIC=\"iot-2/type/<your DEVICE_ID_TYPE>/id/<your DEVICE_ID>/evt/status/fmt/json\"",
rspelta 0:e673387d5add 24 "MQTT_SENSOR_ID=\"<mmddyyyy>\""],
rspelta 0:e673387d5add 25 "target_overrides": {
rspelta 0:e673387d5add 26 "*": {
rspelta 0:e673387d5add 27 "target.features_add": ["NANOSTACK", "NANOSTACK_FULL", "COMMON_PAL"],
rspelta 0:e673387d5add 28 "platform.stdio-baud-rate": 9600,
rspelta 0:e673387d5add 29 "platform.stdio-convert-newlines": true,
rspelta 0:e673387d5add 30 "mbed-mesh-api.6lowpan-nd-channel-page": 2,
rspelta 0:e673387d5add 31 "mbed-mesh-api.6lowpan-nd-channel": 1,
rspelta 0:e673387d5add 32 "mbed-mesh-api.heap-size": 32300,
rspelta 0:e673387d5add 33 "mbed-trace.enable": 0,
rspelta 0:e673387d5add 34 "mbed-mesh-api.6lowpan-nd-security-mode": "PSK",
rspelta 0:e673387d5add 35 "spirit1.mac-address": "{0x01, 002, 0x03, 0x04, 0x05, <MONTH>, <DAY>, <YEAR>}"
rspelta 0:e673387d5add 36 },
rspelta 0:e673387d5add 37 "NUCLEO_F401RE": {
rspelta 0:e673387d5add 38 "wifi-tx": "PA_11",
rspelta 0:e673387d5add 39 "wifi-rx": "PA_12"
rspelta 0:e673387d5add 40 },
rspelta 0:e673387d5add 41 "NUCLEO_F411RE": {
rspelta 0:e673387d5add 42 "wifi-tx": "PA_11",
rspelta 0:e673387d5add 43 "wifi-rx": "PA_12"
rspelta 0:e673387d5add 44 },
rspelta 0:e673387d5add 45 "UBLOX_EVK_ODIN_W2": {
rspelta 0:e673387d5add 46 "target.device_has_remove": ["EMAC"]
rspelta 0:e673387d5add 47 }
rspelta 0:e673387d5add 48 }
rspelta 0:e673387d5add 49 }