AttributeError: module 'thingspeak' has no attribute 'Channel' channel = thingspeak.Channel(id=channel_id, api_key=key)
2 ビュー (過去 30 日間)
古いコメントを表示
In the example raspberry pi py script, which was working fine, now i am getting this error. Cant find any sililar issues on the net... any ideas peeps?
import thingspeak
import time
channel_id = 1231234 # PUT CHANNEL ID HERE
key = '123123123123' # PUT YOUR WRITE KEY HERE
pin = 4
def measure(channel):
try:
# write
response = channel.update({'field1': 2, 'field2': 1})
# read
read = channel.get({})
print("Read:", read)
except:
print("connection failed")
if __name__ == "__main__":
channel = thingspeak.Channel(id=channel_id, api_key=key)
while True:
measure(channel)
# free account has an api limit of 15sec
time.sleep(15)
2 件のコメント
回答 (0 件)
コミュニティ
その他の回答 ThingSpeak コミュニティ
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!