Send data to the channel asynchronously / as bulk | Raspberry Pi | Forum

The ThingSpeak community site has been upgraded to a new site. This site is currently in read-only mode. You can ask questions or post and read discussions on the new site.

Please consider registering

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —

— Match —

— Forum Options —

Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
Send data to the channel asynchronously / as bulk
No permission to create posts
August 23, 2018
7:12 am
New Member
Forum Posts: 1
Member Since:
August 23, 2018
sp_UserOfflineSmall Offline

Hi all,

I'm pretty new to this Topic but I have searched the Forum and the web but have not yet found a solution.

I am a hobby wine maker and just recently upgraded my production room with a temperature and humidity control System, using a raspberry pi and a DHT22. The data get's uploaded with the following code (slightly altered, as this is taken from a tutorial) to ThingSpeak:

import thingspeak
import time
import Adafruit_DHT

channel_id = 206897 # PUT CHANNEL ID HERE
write_key = '24GJQV17H7H4XGJ5' # PUT YOUR WRITE KEY HERE
pin = 4
sensor = Adafruit_DHT.DHT22

def measure(channel):
humidity, temperature = Adafruit_DHT.read_retry(sensor, pin)
# write
response = channel.update({'field1': temperature, 'field2': humidity})

# read
read = channel.get({})
print("Read:", read)

print("connection failed")

if __name__ == "__main__":
channel = thingspeak.Channel(id=channel_id, write_key=write_key, api_key=read_key)
while True:
# free account has an api limit of 15sec

The transmission itself and displaying of the data works without any complications.

Unfortunately, the router has some major issues and shuts down more or less every day. I will tackle that problem as well but for the moment I'd like to create a workaround.

Hence the question: is it possible to locally log the data (in a round robin data base for instance) as soon as the wifi shuts down AND transmit all the logged data as a bulk to ThingSpeak as soon as the connection is up again? This would help me to consistently monitor and analyze the necesseary information for the fermentation process online.

If I just missed the right tutorial to do just that, a link might suffice to solve my problem. I'm eager to read and learn to solve my problems on my own but as of yet, I don't see a starting point.

Thank you in advance.


August 30, 2018
10:28 am

Forum Posts: 885
Member Since:
March 7, 2017
sp_UserOfflineSmall Offline

I think I have the tutorial you ordered:
Please let us know how it works, and when there are open tastings!

Forum Timezone: America/New_York

Most Users Ever Online: 166

Currently Online:
30 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 272

Vinod: 240

piajola: 95

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 8665

Moderators: 1

Admins: 2

Forum Stats:

Groups: 3

Forums: 14

Topics: 1600

Posts: 5760

Newest Members:

bogart, estebanmateo93, mikewrite, onlinebusiness, winzy99, Zark_zeugan

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457