Overview

Skill Level: Any Skill Level

This recipe is a simple demonstration of the wolfMQTT client connecting to IBM Watson IoT Quickserver broker.

Step-by-step

  1. Build the wolfSSL library

    Step through the readme for wolfSSL.

  2. Build the wolfMQTT library and the examples

    Step through the readme for wolfMQTT.

  3. Execute the “wiot” example in /examples/wiot/

    ./examples/wiot/wiot

    MQTT Client: QoS 0, Use TLS 0

    MQTT Net Init: Success (0)

    MQTT Init: Success (0)

    MQTT Socket Connect: Success (0)

    MQTT Connect: Success (0)

    MQTT Connect Ack: Return Code 0, Session Present 0

    To view the published sample data visit:

    https://quickstart.internetofthings.ibmcloud.com/#/device/wolftestid/sensor/

     

    MQTT Subscribe: Success (0)

     Topic iot-2/type/wolfMQTT/id/wolftestid/evt/sensor/fmt/json, Qos 0, Return Code 0

    MQTT Publish: Topic iot-2/type/wolfMQTT/id/wolftestid/evt/sensor/fmt/json, Success (0)

    MQTT Waiting for message…

    MQTT Message: Topic iot-2/type/wolfMQTT/id/wolftestid/evt/sensor/fmt/json, Qos 0, Len 12

    Payload (0 – 12): {“sensor”:1}

    MQTT Message: Done

  4. Browse to the Quickstart Broker

    https://quickstart.internetofthings.ibmcloud.com/#/device/wolftestid/sensor/

    quickstartweb

  5. Publish more data

    By typing:

    {“sensor”:2}

    and then pressing <ENTER>.

    You can change the number and add more values to the chart display.

Join The Discussion