I am unable to connect MQTT client using Thingspeak in MATLAB.
5 次查看（过去 30 天）
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
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.
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.