Samples

The following samples illustrate the communication with an MQTT broker. Messages are sent and received.

There are two different implementation options, which can be chosen based on purely subjective criteria. The two options are compared in the first two samples.

Overview

Sample

Link

Description

1

IotMqttSampleUsingQueue

MQTT communication based on a messages queue

2

IotMqttSampleUsingCallback

MQTT communication based on a callback method

3

IotMqttSampleTlsPsk

MQTT communication via a secure TLS connection and PSK (PreSharedKey)

4

IotMqttSampleTlsCa

MQTT communication via a secure TLS connection and CA (certificate authority) certificate

5

IotMqttSampleAwsIoT

MQTT communication with AWS IoT

6

IotMqttSampleAzureIotHub

MQTT communication with the Microsoft Azure IoT Hub

7

IotMqttSampleIbmWatsonIoT

MQTT communication with IBM Watson IoT

8

IotMqttSampleMathworksThingspeak

MQTT communication with the ThingSpeak IoT platform from MathWorks

Downloads

Sample code and configurations for this product can be obtained from the corresponding repository on GitHub: https://www.github.com/Beckhoff/TF6701_Samples. There you have the option to clone the repository or download a ZIP file containing the sample.

Samples 1: