필터 지우기
필터 지우기

MQTT version 5 support in Industrial Communication Toolbox

조회 수: 3 (최근 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).

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by