VirtualHub 2.0 : MQTT and TLS

VirtualHub 2.0 : MQTT and TLS

This week, we take a quick look at the latest developments of the VirtualHub 2.0 Beta. We have added support for MQTT callbacks on a TLS connection and binaries for the Raspberry Pi.







MQTT is an old protocol from the early 2000's which became popular again in recent years. The main reason is that this protocol is designed to work on machines with limited resources. Therefore, it is well adapted for connected objects. By the way, we wrote a post on this protocol: connecting a Yoctopuce à sensor to an MQTT broker.

As with HTTP, the MQTT protocol doesn't encrypt the data that it transmits. It's the job of the underlying OSI layer to take care of it. In the present case, this underlying layer is TCP and therefore a TLS encryption. Lucky us, the VirtualHub 2.0 supports TLS encryption and we added the possibility to configure an MQTT callback on a TLS connection.

A quick example


To illustrate this new possibility, we are going to look again at our example on MQTT callback on the FRED service from sensetecnic in our post Using Yoctopuce sensors in FRED.

There is no need to change anything on the side of the FRED service. We must simply start the VirtualHub 2.0, enable TLS encryption, and change the broker port.

In the configuration page of the VirtualHub, the configuration panel of the MQTT callback has a new option, MQTT over TLS, which enables communication encryption. If you enable this option, make sure to use the correct port for the MQTT broker, otherwise the connection is rejected. Usually, the port for encrypted communications is 8883.
Here are the parameters of our MQTT callback with the parameters that were modified in red:

You must simply enable the  'MQTT over TLS' option and change the port number
You must simply enable the 'MQTT over TLS' option and change the port number



Here you are, communications between the VirtualHub 2.0 and the sensetecnic servers are now encrypted and totally confidential.

This new feature is interesting because it allows you to use MQTT brokers which accept only encrypted connections, such as Microsoft Asure or AWS IoT Core, for example.

Other improvements

We carry on the development and the debugging of the VirtualHub 2.0. This week, we also added the support for Linux ARM Hard Float (Raspberry Pi) and corrected several minor bugs.

You can download the binaries of version 2.0 on the VirtualHub page.

Add a comment No comment yet Back to blog












Yoctopuce, get your stuff connected.