Using Thingspeak React with "dynamic" channels

5 ビュー (過去 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 Center および File ExchangeRead Data from Channel についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by