MATLAB Answers

Can't get thingSpeak to display data

69 views (last 30 days)
Data is being sent by a webhook from a Particle Photon. I know the data is being received by thingSpeak because I see the entries number is being incremented when new data arrives.
Here is my setup page.
Can anyone help? Thank you. Larry

  4 Comments

Show 1 older comment
Larry McIntyre
Larry McIntyre on 22 Jan 2021
My data is not being exported. The csv only has a list of channel feeds (ctcurrent and interval). The Particle.Publish command requires that all elements are strings, so I don't know how else to send data to thingSpeak. All examples seem to send data to thingSpeak in this manner.
Christopher Stapels
Christopher Stapels on 22 Jan 2021
Yes, all data is sent to ThingSpeak as strings. If you sent a number that included a string, like 12.4h, ThingSpeak would not be able to interpret it. I was hoping you would use the "Export Recent Data" button on your channel to see what is being recieved by ThingSpeak.
There is a ThingSpeak library for particle devices, are you using this library?
Can you show the format for your webhook?
Larry McIntyre
Larry McIntyre on 23 Jan 2021
Great idea. Here is my export of the first field. No data, only times and entries.
Here is my webhook setup in Particle Console.
And here is my code to send data to thingSpeak. I'm using a library that I got from Particle that is commonly used. My data is being posted as events in Particle Console.
Here is my channel set up at thingSpeak.
I really appreciate your help.

Sign in to comment.

Accepted Answer

Christopher Stapels
Christopher Stapels on 25 Jan 2021
You are sending the string value "ctcurrent" to ThingSpeak, in your querry string parameters (not the value of the variable). You do have it as a parameter in the JSON, but I suspect the syntax is wrong. I would not send it in the JSON. Also, you have your write api key as a parameter in the webhook.
It is possible to use webhooks, and its nice to be able to abstract parameters so you can reuse a webhook for multiple processes. But it can be a bit tricky. I would really reccomend theThingSpeak library I mentioned above. It does all the work for you and doesn't need a webhook.
If you are really stuck on using the webhook, I'd find and example and carefully copy what you see.
Also, did you export only field 1? Do you have field 2 enabled in your channel view? If you exported the whole feed but only had channel 1 enabled, you might see something like what you show above. I was expecting to see the string "interval" based on what you shared.

  1 Comment

Larry McIntyre
Larry McIntyre on 26 Jan 2021
The TCPClient is working for me. I agree it is much easier than setting up a webhook. Thanks again for the help.

Sign in to comment.

More Answers (0)

Tags

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!