Unable to post to Thingspeak channel

조회 수: 7 (최근 30일)
Jacob Warner
Jacob Warner 2019년 10월 31일
댓글: Christopher Stapels 2024년 4월 8일
Okay, I've tried a few different ways to post to any channel I've created but haven't had any success. I'm going to throw up a channel for anyone else to try and post to just in case I'm doing something way wrong. Originally I tried to post temerature data from a nodemcu/esp8266 and when that didn't work I set up another channel and used Postman to try and send data. That didn't work either. I can do GET requests to see channel info but I can't get any data to post to the channel. Any help is appreciated.
I made a test channel and made it public just to see if anyone can post to it. It's just a single field and on a free account so don't go crazy.
write: KYY2MERT251RV2OM
read: S325VXRJTWDUZQRI
Postman:
GET https://api.thingspeak.com/channels.json?api_key=XXXXXXXXXXXXXXXXX (Not sharing my account key but JSON results show the channel)
[
{
"id": 897564,
"name": "testCount",
"description": "",
"latitude": "0.0",
"longitude": "0.0",
"created_at": "2019-10-29T23:06:45Z",
"elevation": "",
"last_entry_id": null,
"public_flag": true,
"url": "",
"ranking": 30,
"metadata": "",
"license_id": 0,
"github_url": null,
"tags": [],
"api_keys": [
{
"api_key": "KYY2MERT251RV2OM",
"write_flag": true
},
{
"api_key": "S325VXRJTWDUZQRI",
"write_flag": false
}
]
}
]
Tried both the GET and POSTMAN tutorials here with no luck: https://www.mathworks.com/help/thingspeak/writedata.html
Any attempt to use a GET or POST to update the channel (field1) results in a return of '0' or 401, which I think means that Thingspeak is not recognizing my write API key. I've had the same problem on multiple channels.
Much appreciate any help. Please let me know if you need more information.
  댓글 수: 2
Benjamin
Benjamin 2024년 4월 8일
Hello great members I need your help i'm using and gsm sim800L to send remote sensor to thingspeak server at first it was showing but after a little changes was made in the code, the serial motnitor is working and showing but on the thingspeak server nothing is showing. any help
Christopher Stapels
Christopher Stapels 2024년 4월 8일
@Benjamin Please make a new post and show the issues you are having perhaps with some smalle code snippets.

댓글을 달려면 로그인하십시오.

채택된 답변

Christopher Stapels
Christopher Stapels 2019년 11월 6일
편집: Christopher Stapels 2019년 11월 6일
Have you had this account for several years? If so you probably would have recieved am email with instructions about how to renew sometime over the summer. We can look into the license issue, it should be possible to renew your free license. I would reccomend changing your API keys for security reasons. Dont worry about posting new screen shots, these are more than enough.
Can you tell us more about your project? We are always looking for interesting applications.
  댓글 수: 2
Jacob Warner
Jacob Warner 2019년 11월 7일
Success! I just did a postman test and can write to the channel. I've had the account since 2016, but haven't used it in a while. I went back in my email and did find the email about the change. I lose emails in the gmail updates tab all the time... Looks like the license renewal fixed the issue. I'll refresh the api keys. This project is a simple temperature/humidity sensor for my wife's lizard cage.
Thanks for the help!
Christopher Stapels
Christopher Stapels 2019년 11월 8일
편집: Christopher Stapels 2019년 11월 8일
Thanks for confirming and marking the answer (Vinod actually did all the work to fix it though). This may be our first lizzard cage monitor! Can we get a picture of the lizzard, or at least his/her/their name?

댓글을 달려면 로그인하십시오.

추가 답변 (4개)

Vinod
Vinod 2019년 10월 31일
편집: Vinod 2019년 11월 15일
Since your ultimate goal is to get this working on a NodeMCU, I'd recommend starting from the examples in the ThingSpeak Client Library here:
  댓글 수: 1
Jacob Warner
Jacob Warner 2019년 11월 6일
Thanks for the suggestion. I have tried to use the library on the nodeMCU but started with higher level examples. I can try the AT commands when I get a chance this weekend. However, I moved to postman in troubleshooting in order to see if my problem was with the nodeMCU or if it was actually an issue even posting to ThingSpeak using the API. Since I can't get data to post even in postman I think my problem is getting anything to post using the key.

댓글을 달려면 로그인하십시오.


Christopher Stapels
Christopher Stapels 2019년 11월 1일
That would be the format to try if those are truly the correct API keys for the channel. Be sure to check your API keys.
And definitely check out the library suggested by Vinod.
  댓글 수: 2
Jacob Warner
Jacob Warner 2019년 11월 6일
I tried this. I still can't get anything to post to the channel. I'll take screenshots this weekend when I get time to get back to this project. I think it might me an expired license issue, but I don't see a way to move forward with a free account. I'm not using ThingSpeak in any way that I would need a paid account... Apologies for these shots. I wanted to give you the exact view I'm seeing. Thanks again.
dashboard.PNG
keys.PNG
License.PNG
account.PNG
Vinod
Vinod 2019년 11월 6일
Jacob,
It appears an email from July 2019 requiring the account to be linked to a MathWorks Account before the end of August 2019 was ignored. Thereby making your old account inactive and license expired. Now that you have linked your ThingSpeak account to a MathWorks Account, we've re-enabled the account.
Let me know if you're still having trouble posting to your channel.
-Vinod

댓글을 달려면 로그인하십시오.


Hristo Simeonov
Hristo Simeonov 2019년 11월 15일
Hi, I also ignored e-mail from thingpseak, and now I can't post to my channel
Now linking with MathWorks account didn't help ;-(
Vinod, can you fix this for me ?
My channel is: 78900 (nice number to remember)
Thanks!
  댓글 수: 2
Christopher Stapels
Christopher Stapels 2019년 11월 18일
Hristo,
You should be all set now.
Hristo Simeonov
Hristo Simeonov 2019년 11월 19일
Yeah, it's working now.
Thank you Christopher.

댓글을 달려면 로그인하십시오.


Ashin John
Ashin John 2020년 1월 12일
편집: Ashin John 2020년 1월 12일
Hello Christopher,
I'm also facing the same issue.
I have an account since 2017, havent been using it for a while.
When i created a new channel today and tried to push data to thingspeak i'm getting HTTP error -401.
I have linked my thingspeak with matlab account
Channel ID: 957975
Thanks
  댓글 수: 2
Vinod
Vinod 2020년 1월 13일
@Ashin: It appears you also missed the window to link your accounts? We had to manually reset the account. Please let me know if you are still not able to update your channel.
Julien Jacquemet
Julien Jacquemet 2020년 1월 14일
Hi,
Same thing, my account was created in 2015, and not use for a long time.
I want to use again, i have link my account with mathworks. Could you reset my account ?
Thanks,
Best regars

댓글을 달려면 로그인하십시오.

커뮤니티

더 많은 답변 보기:  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