MQTT version 5 support in Industrial Communication Toolbox

2 ビュー (過去 30 日間)
Ernst van der Pols
Ernst van der Pols 2023 年 12 月 13 日
編集済み: Ernst van der Pols 2024 年 1 月 10 日
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.

採用された回答

Narvik
Narvik 2023 年 12 月 22 日
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!

その他の回答 (1 件)

Ernst van der Pols
Ernst van der Pols 2024 年 1 月 10 日
編集済み: Ernst van der Pols 2024 年 1 月 10 日
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).

カテゴリ

Help Center および File ExchangeDiscrete-Event System Objects についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by