Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

save local and upload once a day
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

save local and upload once a day

by MasterReto on Fri Aug 28, 2020 1:22 pm

Hi adafruit community

I am now to this adafruit IO thing and it has been fun so far.

I want to do something you probably do not hear often. I googled for it but have not found anything accordingly. If there is a thread that covers what I want, feel free to provide me the link.

Okay, let's get to it:
I want to log things temperature and humidity in an interval of 10s to 5min, depending on the application. No problem so far.
But, during the night I turn my wifi off and the data is not logging anymore to adafruit IO. Is there a way I can store the data locally on my microcontroller and as soon as my wifi is back on, all the locally stored data is sent to adafruit IO. It also would be totally fine if the data is just stored once a day.

MasterReto
 
Posts: 1
Joined: Fri Aug 28, 2020 1:06 pm

Re: save local and upload once a day

by jwcooper on Mon Aug 31, 2020 3:23 pm

You would store the value, and the timestamp for that value locally, and then upload them all at once with our batch endpoint.

You can then upload all the data points at once:
https://io.adafruit.com/api/docs/#creat ... ta-records

You'll need to make sure you stay within the throttle limits of your account, so either split the batches up and wait, or only save as many data points as you can overnight for the throttle to not be triggered.

Here is an example with our ruby client:
https://github.com/adafruit/io-client-r ... ata.rb#L34

Here is an example with python:
https://github.com/adafruit/Adafruit_IO ... ata.py#L39

jwcooper
 
Posts: 692
Joined: Tue May 01, 2012 9:08 pm

Please be positive and constructive with your questions and comments.