Writing data to channel using urllib python package

2 ビュー (過去 30 日間)
Owen Medeiros
Owen Medeiros 2019 年 11 月 5 日
コメント済み: Vinod 2019 年 11 月 5 日
Hello,
I am trying to write instrument data to a ThingSpeak channel using python. I have installed the urllib package and I am using using the urlopen command to write data. I am able to write data for multiple fields (I have shown t1 as an example but I also have t2, t3), however the rate is inconsistent. More explicitly, the time in between data points varies. I have tried different length delays between events, still inconsistent.
Is this because of Thingspeak, or my python script?
c1 = 'https://api.thingspeak.com/update?api_key=__________&field4='
t1 = urllib.urlopen(c1+str(temp4))
t1.close()
sleep(30)
  3 件のコメント
Owen Medeiros
Owen Medeiros 2019 年 11 月 5 日
Ok thank you for the info! I did not know about the 15 second delay, I have been using 30 second delays as a standard so I assume that would not be the issue.
Vinod
Vinod 2019 年 11 月 5 日
If you've resolved that, then another reason your rate is incosistent could be device being capacity limited. Are you sure your computer/device running the python code is not being capacity limited (CPU, memory, network bandwidth, etc.) and is not going to sleep?

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

回答 (0 件)

コミュニティ

その他の回答  ThingSpeak コミュニティ

カテゴリ

Help Center および File ExchangeWrite Data to Channel についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by