MathWorks Support Team in MATLAB Answers
Última actividad el 17 de Dic. de 2024

When using the Industrial Communication Toolbox's mqtt function, one of the input arguments is a file path to a root certificate. Where can I download this root certificate? Which one should I download? kA03q000000sw3QCAQ 000320069
John Anand in MATLAB Answers
Última actividad el 9 de En. de 2023

I am connecting to ThinkSpeak using a Esp8266 chip on a FireBeetle board. And I am using this code: #include <SoftwareSerial.h> #define RX 2 #define TX 3 String AP = "**********"; // AP NAME String PASS = "*********"; // AP PASSWORD String API = "*************"; // Write API KEY String HOST = "api.thingspeak.com"; String PORT = "80"; String field = "field1"; int countTrueCommand; int countTimeCommand; boolean found = false; int valSensor = 1; SoftwareSerial esp8266(RX, TX); void setup() { Serial.begin(9600); esp8266.begin(115200); sendCommand("AT", 5, "OK"); sendCommand("AT+CWMODE=1", 5, "OK"); sendCommand("AT+CWJAP=\"" + AP + "\",\"" + PASS + "\"", 20, "OK"); } void loop() { valSensor = getSensorData(); String getData = "GET /update?api_key=" + API + "&" + field + "=" + String(valSensor); sendCommand("AT+CIPMUX=1", 5, "OK"); sendCommand("AT+CIPSTART=0,\"TCP\",\"" + HOST + "\"," + PORT, 15, "OK"); sendCommand("AT+CIPSEND=0," + String(getData.length() + 4), 4, ">"); esp8266.println(getData); delay(1500); countTrueCommand++; sendCommand("AT+CIPCLOSE=0", 5, "OK"); } int getSensorData() { return random(1000); // Test } void sendCommand(String command, int maxTime, char readReplay[]) { Serial.print(countTrueCommand); Serial.print(". at command => "); Serial.print(command); Serial.print(" "); while (countTimeCommand < (maxTime * 1)) { esp8266.println(command);//at+cipsend if (esp8266.find(readReplay)) //ok { found = true; break; } countTimeCommand++; } if (found == true) { Serial.println("OYI"); countTrueCommand++; countTimeCommand = 0; } if (found == false) { Serial.println("Fail"); countTrueCommand = 0; countTimeCommand = 0; } found = false; } __________________________________________________________________________________________________________________ I get this (error?) In the serial monitor when I run it. Output: Fail 0. at command => AT+CWMODE=1 Fail 0. at command => AT+CWJAP="******","********" Fail 0. at command => AT+CIPMUX=1 Fail 0. at command => AT+CIPSTART=0,"TCP","api.thingspeak.com",80 Fail 0. at command => AT+CIPSEND=0,51 Fail 1. at command => AT+CIPCLOSE=0 Fail 0. at command => AT+CIPMUX=1 Fail 0. at command => AT+CIPSTART=0,"TCP","api.thingspeak.com",80 Fail 0. at command => AT+CIPSEND=0,51 Fail 1. at command => AT+CIPCLOSE=0 Fail 0. at command => AT+CIPMUX=1 Fail 0. at command => AT+CIPSTART=0,"TCP","api.thingspeak.com",80 Fail 0. at command => AT+CIPSEND=0,51 Fail 1. at command => AT+CIPCLOSE=0 Fail 0. at command => AT+CIPMUX=1 Fail _________________________________________________________________________________________________________________ What am I doing wrong? The Wifi password and name are correct. I really couldn't find anything online to help. And I'm honestly out of ideas, I've been trying to fix it all day.
Sreerag Haridas EM in Discussions
Última actividad el 17 de Mzo. de 2021

Hi, i have made a data logger with arduino and esp8266.the data being the temperature and humidity. what i wanted to know is there some way i can set a threshold value and thingspeak reacts on it if data is not uploaded for 5 mins and the thinkspeak should through a message to arudio ide can i use talkback for this? how to communcate from thinkspeak to arudino ide I think what you want to do can be achieved, except for the part about communicating to the IDE. Talkback can provide a message to your device, the device will have to poll the talkback endpoint for the message sent back. You will then need to create code in MATLAB analysis on ThingSpeak that checks your channel and writes a talkback when there has been no data in the channel for more than 5 minutes. I recommend reading the channel data as a timetable, then you can check the value of the last timestamp and compare to datetime('now') Is there any way to get the MATLAB code There is a lot of code provided in the examples. Here is a page that describes a similar process. <https://www.mathworks.com/help/thingspeak/monitor-channel-inactivity-using-multiple-thingSpeak-apps.html Monitor channel activity> . Have a look at the <https://www.mathworks.com/help/thingspeak/talkback-app.html TalkBack page> , and the <https://www.mathworks.com/help/thingspeak/thingspeak-apps.html Act on data page> , in the section on the TalkBack API. communication

Acerca de ThingSpeak

The community for students, researchers, and engineers looking to use MATLAB, Simulink, and ThingSpeak for Internet of Things applications. You can find the latest ThingSpeak news, tutorials to jump-start your next IoT project, and a forum to engage in a discussion on your latest cloud-based project. You can see answers to problems other users have solved and share how you solved a problem.