Uploaded data is not appearing in Imported data function

1 回表示 (過去 30 日間)
Emilio Rubio Garcia
Emilio Rubio Garcia 2020 年 1 月 23 日
回答済み: Emilio Rubio Garcia 2020 年 1 月 24 日
Hi,
There is some kind of problem in one of my channels (Weather Station). Data is not showing in downloaded data file although channel is reflecting that there are already some records. I've recently changed POST procedure by GET in software, but it is not still showing data.
Should I change anything else in code for data to appear?
Thank you very much in advance for your support.
Regards.
Emilio Rubio.

採用された回答

Christopher Stapels
Christopher Stapels 2020 年 1 月 23 日
Are you using the data export on the web site, or an HTTP call? If so, can you show the format of your HTTP call? ( you dont need to share the api keys, just the format)

その他の回答 (4 件)

Emilio Rubio Garcia
Emilio Rubio Garcia 2020 年 1 月 24 日
Hi,
Because I am not professional about this area, I am getting help from Youtube videos that maybe are not right, maybe because it´s out-of-date, or maybe because it's a wrong way for doing it. If it is not the right way, I think somebody keep track this information in any social network, because nowdays everybody get information very easily. As I said in my previous post, I changed POST statement by GET and I also changed slaightly of the whole sentence, wich I can't remember the way I did it.
Anyway, using NodeMCU, this is the way I am trying to upload records to server:
String url = "GET /update?api_key=";
url += APIWRITEKEY;
url += "&field1=";
url += String(t);
url += "&field2=";
url += String(h);
url += "\r\n";
client.print(url + " HTTP/1.1\r\n" + "HOST: " + HOST + "\r\n" + "Connection: close\r\n\r\n");
Please, let me know if I am doing something wrong or missing something else.
Thank you very much in advance for your support.
Regards,
Emilio Rubio.

Christopher Stapels
Christopher Stapels 2020 年 1 月 24 日
編集済み: Christopher Stapels 2020 年 1 月 24 日
I've found it easier to do a POST for update requests, since there is more control.
I would recomend using the ThingSpeak Library for Arduino and ESP8266. It will greatly simplify the communication with the ThingSpeak server. There are many examples built into the library for reading and writing. The proximity sensor shows some ways to read and write with the library.
If you must write the request out by yourself, there is code in the moisture monitor example of a POST request.

Emilio Rubio Garcia
Emilio Rubio Garcia 2020 年 1 月 24 日
Hi,
The way I was coding before changing HOST by GET statement was the way moisture monitor example actually is showing, and I change code because it was not working that way. Api Key tab shows that GET statement should be used in order to application works.
I ll try again that way and I will let you know about it.
Thank you very much for your quick answer.
Regards,
Emilio Rubio.
  1 件のコメント
Christopher Stapels
Christopher Stapels 2020 年 1 月 24 日
I'd also recomend trying it in the browser first. You can copy the text from the API keys tab right to a browser to make sure that works.
If you use the moisture code instead of the ThingSpeak arduino library, be careful to copy things pretty closely, the POST requires extra carriage returns and headers.

サインインしてコメントする。


Emilio Rubio Garcia
Emilio Rubio Garcia 2020 年 1 月 24 日
Hi,
I am currently trying moisture code and it is working, except that data is not showing in CSV file format. It does in JSON and XML file formats when exporting data, but not from the very first record.
Thank you very much for your quick answer.
Regards,
Emilio Rubio.

コミュニティ

その他の回答  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