MQTT version 5 support in Industrial Communication Toolbox

2 visualizaciones (últimos 30 días)
There is no reference in the (online) documentation of the Industrial Communication Toolbox on the protocol version(s) supported by the mqttclient().
I assume, reading the API, that MQTT version 5 is not supported. Can anyone confirm that?
Thanks in advance.

Respuesta aceptada

Narvik
Narvik el 22 de Dic. de 2023
Hi,
As you mentioned, there is no reference on the protocol version(s) supported by the mqttclient(). I was able to find the following documentation where MQTT v3.1.1 specifications were referenced:
As per my understanding, MQTT version 5 is not supported yet.
Hope this helps!

Más respuestas (1)

Ernst van der Pols
Ernst van der Pols el 10 de En. de 2024
Editada: Ernst van der Pols el 10 de En. de 2024
To follow up on my own question: it appeared that a colleague of mine has the Industrial Communication Toolbox installed, so I was able to assess the included mqttclient().
For those looking for an alternative solution with MQTT version 5 support, these are the steps I took to get there:
  • Download the MATLAB interface to MQTT from Gennaro Notomista. This example is similar to MQTT-in-MATLAB, but with readable 'm'-files. It includes org.eclipse.paho.client.mqttv3-1.2.2.
  • Download the org.eclipse.paho.mqttv5.client-1.2.5 (or newer) Java component.
  • Adapt and extend the Java and MATLAB wrappers to use the Paho MQTT v5 client. Its API deviates a little from the v3 release, reflecting the changes in the protocol, e.g. CleanSession is replaced by CleanStart.
  • I also adjusted Gennao's MATLAB code to mimic the icomm.mqtt.Client() API with operations like read() and write().
  • Tweaking the Java-MATLAB language bridge took most of the time, so some experience there will help.
  • Bonus: you have control over the way recieved messages are stored, so any issues there you can resolve yourself (some of you will consider this a malus).

Categorías

Más información sobre Discrete-Event System Objects en Help Center y File Exchange.

Productos


Versión

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by