Using Thingspeak React with "dynamic" channels

조회 수: 4 (최근 30일)
Ben Alimansky
Ben Alimansky 2020년 9월 17일
답변: Vinod 2020년 9월 17일
Hi Vinod - you helped me a few minutes ago with a question about how to work with multiple devices which were all updating Thingspeak concurrently. Your suggestion of dynamically creating a dynamic, for each respective device, makes sense.
However, I have a related issue. I have a React app (in Thingspeak) that triggers a Matlab Analysis script on data insertion to the single channel that I'm using today. As I go to implement a multi-channel approach, do you have any thoughts on how I can use React across channels that I am creating "dynamically"? The React parameters (via the Thingspeak website) seem to specify the channel that you're monitoring - and I'm not sure how to do this in a more dynamic way.
Thank you!
Ben

답변 (1개)

Vinod
Vinod 2020년 9월 17일
My recommendation would be to set up a TimeControl that triggers MATLAB code that reads data across all your channels. Your MATLAB code can use the same REST APIs as your devices to find all the channels and their API keys and then read the last 10 minutes of data across all of the channels and do the operations you need. With MATLAB code you can get much more control over the conditions under which you want something to happen, and a much wider range of actions that you can have the MATLAB code perform for you.
The one downside with this approach is that it is not instantaneous, unlike a react which monitors the data as it is inserted into the channel. Then again, this approach is a lot more flexible. I guess that is the sort of tradeoff that engineers have to consider all the time :)

커뮤니티

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

카테고리

Help CenterFile Exchange에서 Read Data from Channel에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by