필터 지우기
필터 지우기

I am unable to connect MQTT client using Thingspeak in MATLAB.

조회 수: 3 (최근 30일)
Anam Amjad
Anam Amjad 2022년 7월 5일
댓글: Hafiz Hamza 2023년 12월 5일
Here is my piece of code, I am following the steps of the tutorial https://www.mathworks.com/help/icomm/ug/get-started-with-mqtt.html
clientID = "client id";
userName = "user name";
password = "password";
rootCert = "Path";
brokerAddress = "ssl://mqtt3.thingspeak.com";
port = 8883;
mqClient = mqttclient(brokerAddress, Port = port, ClientID = clientID,...
Username = userName, Password = password, CARootCertificate = rootCert);
upon reaching the mqClient, the following error occurs
ThingSpeakMQTT
Error: File: ThingSpeakMQTT.m
Incorrect use of '=' operator. To assign a value to a variable, use '='.
To compare values for equality, use '=='.
Please someone guide me on this.
  댓글 수: 2
Geoff Hayes
Geoff Hayes 2022년 7월 6일
@Anam Amjad - you are using R2022a which Create MQTT client connected to broker suggests when this functionality was introduced? (I'm not entirely sure of this though...) Note that https://www.mathworks.com/matlabcentral/answers/1753160-incorrect-use-of-operator-to-assign-a-value-to-a-variable-use-to-compare-values-for-equal had a similar error but the way you have written the above code seems to be correct (and identical to that from the link you posted).
Hafiz Hamza
Hafiz Hamza 2023년 12월 5일
Dera Anam,
I am facing the similar problem(Unable to connect to the ThingsBoard Server) that I think you have solved. I shall be very grateful to you if you please give a bit of your valuable time for assisting me in this matter.

댓글을 달려면 로그인하십시오.

채택된 답변

Vinod
Vinod 2022년 7월 6일
I believe you are using an older version of MATLAB. You need to use MATLAB R2022a or newer and have a license to the Industrial Communication Toolbox to use the syntax you have in the example.
  댓글 수: 3
Hafiz Hamza
Hafiz Hamza 2023년 12월 5일
Dera Anam,
I am facing the similar problem(Unable to connect to the ThingsBoard Server) that I think you have solved. I shall be very grateful to you if you please give a bit of your valuable time for assisting me in this matter.
Hafiz Hamza
Hafiz Hamza 2023년 12월 5일
Dear Vinod,
I request if you please refer my query to @Anam Amjad

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

커뮤니티

더 많은 답변 보기:  ThingSpeak 커뮤니티

카테고리

Help CenterFile Exchange에서 Web Services에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by