HelloMQTT over TLS.
Fork of HelloMQTT by
HelloMQTT over TLS
This program is a fork of HelloMQTT. Added TLS capability by using TLSSocket library. Tested on K64F.
This sample program connects to iot.eclipse.org:8883
by default. Verifies server identification. Subscribes a certain topic. Then publishes three messages with different QoSs, i.e. QoS0
, QoS1
, and QoS2
.
Warning
Some brokers do not accept QoS2 and/or QoS1 message. For example, AWS IoT Message Broker doesn't accept QoS2. In such broker, this program doesn't work as is. Change QoS level.
Output from console
HelloMQTT: version is 0.70 Opening network interface... Network interface opened successfully. Connecting to host iot.eclipse.org:8883 ... Connection established. MQTT client is trying to connect the server ... Client connected. Client is trying to subscribe a topic "mbed-test". Client has subscribed a topic "mbed-test". Client publishes messages ... Publishing message QoS 0. QoS 0 message published. ! Message arrived: qos 0, retained 0, dup 0, packetid 6257 ! Payload Hello World! QoS 0 message from app version 0.700000 Publishing message QoS 1. QoS 1 message published. ! Message arrived: qos 1, retained 0, dup 0, packetid 1 ! Payload Hello World! QoS 1 message from app version 0.700000 Publishing message QoS 2. QoS 2 message published. ! Message arrived: qos 2, retained 0, dup 0, packetid 2 ! Payload Hello World! QoS 2 message from app version 0.700000 Version 0.70: finish 3 msgs
Known Issues
On K64F, when serial baud rate is changed from 9600 to 115200, program fails.
History
Updated TLSSocket library.
2018-06-15, by Osamu Koizumi [Fri, 15 Jun 2018 00:34:21 +0900] rev 43
Updated TLSSocket library.
Updated TLSSocket and change HelloMQTT to adopt it.
2018-06-13, by Osamu Koizumi [Wed, 13 Jun 2018 14:42:00 +0900] rev 42
Updated TLSSocket and change HelloMQTT to adopt it.
Changed to use TLS by default.
2018-06-11, by Osamu Koizumi [Mon, 11 Jun 2018 17:54:18 +0900] rev 41
Changed to use TLS by default.
branch merge
2018-06-11, by Osamu Koizumi [Mon, 11 Jun 2018 17:13:52 +0900] rev 40
branch merge
Modified for TLSSocket interface chnage.
2018-06-11, by Osamu Koizumi [Mon, 11 Jun 2018 17:11:14 +0900] rev 39
Modified for TLSSocket interface chnage.
Remove unnecessary LCD options. Change serial baud rate to 9600. Higher baud rate caused error with Mosquitto broker at local environment.
2018-06-11, by Osamu Koizumi [Mon, 11 Jun 2018 17:08:45 +0900] rev 38
Remove unnecessary LCD options. Change serial baud rate to 9600. Higher baud rate caused error with Mosquitto broker at local environment.
Updates to the latest.
2018-06-11, by Osamu Koizumi [Mon, 11 Jun 2018 17:06:51 +0900] rev 37
Updates to the latest.
Updated mbed-os
2018-06-08, by Osamu Koizumi [Fri, 08 Jun 2018 15:39:28 +0900] rev 36
Updated mbed-os
Roll back easy-connect.
2018-06-08, by Osamu Koizumi [Fri, 08 Jun 2018 15:36:05 +0900] rev 35
Roll back easy-connect.
Added mutual auth capability.
2018-06-07, by Osamu Koizumi [Thu, 07 Jun 2018 15:50:02 +0900] rev 34
Added mutual auth capability.