MATLAB Answers

ThingSpeak : Read & Write Multiple Field

46 views (last 30 days)
Ravi Ghimire
Ravi Ghimire on 27 Jan 2021
Hello, Could you please recommend me best method for multiple fields read & right in ThingSpeak?
  1. I want to write in MATLAB Simulink via ThingSpeak Cloud from MIT APP Inventer Application , 4 fields with ( digital write 0,1)?
  2. I want to read 3 field value and read it from MIT App inventor via ThingSpeak Cloud?
i have problem in reading and writing multiple channels , can somebody recommend be the best way.

  0 Comments

Sign in to comment.

Answers (1)

Christopher Stapels
Christopher Stapels on 27 Jan 2021
Can you describe the data flow a bit more?
"in MATLAB Simulink via ThingSpeak Cloud from MIT APP Inventer Application "
What is the MIT App interacting with? Is it a deployed simulink model on hardware?
The MIT app will support POST commands (I'm pretty sure), you can post to you channel using the REST API write endpoint. You can update multiple fields simultaneously.
POST https://api.thingspeak.com/update
api_key=XXXXXXXXXXXXXXXX
field1=73
field2=37
etc...
You can also use the GET command and append additional fields
Similarly, you can read the whole feed (all fields ) at once with read data. I would use the JSON format, then you can parse the response for the fields you want.
https://api.thingspeak.com/channels/<channel_id>/feeds.<format>

  0 Comments

Sign in to comment.

Products

Communities

More Answers in the  ThingSpeak Community

Community Treasure Hunt

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

Start Hunting!