Batch data saving

I am building an application with blynk that required fast sampling of sensors and storage. Is the a way that I can upload a batch of data and store it on blynk cloud? can somebody point me to a good source or example for this?

Look in the API docs.

https://{server_address}
/external/api/get?token={token}&{pin}&{pinX}
Get Multiple Datastream values

If you configure for raw data it will all be available.

Screenshot(15)

If you’re wanting to capture data then batch upload it so that it appears with an earlier time stamp then no, there isn’t a way to do that.

The HTTP(S) API allows batch upload of values, which is effectively a way of combining multiple Blynk.virtualWrites into one command. However, all of these values will be time-stamped with the same time (the time at which they are uploaded). There is no way to upload values with corresponding timestamp values.

The API batch upload documentation is here…
https://docs.blynk.io/en/blynk.cloud/batch-update-values

Pete.

From the API documentation

Save RAW Data

By default server stores only 1 data point per data stream per minute. In case you sent more than 1 point within 1 minute interval - value for that data stream will be averaged.

Raw data allows you to store every value that hardware sends.

Enabling this option allows to view Datastreams data changes dynamic in graph.

Actually, there is:

  • You can do it via “Import data” action for the specific device (only for WL and PRO (don’t remmemebr if we enabled that for PRO users))
  • There is batch insert HTTPS API. I’ll add it to the docs today and will update this ticket with the reference
3 Likes

Thanks! My application has to sample at ~50Hz. So I was hoping that there was a way that I could put 100 samples in a json array and upload it to be saved on the cloud.

Where can I find the import data option?

@Robinhood I think it is only for PRO users.
I made an doc update, waiting for Pavel to merge and I’ll update this ticket with reference.

@Robinhood Single Datastream batch update with timestamps - Blynk Documentation, please let me know if something is not clear.

The single entry format: [timestamp, value]. Where timestamp - the difference, measured in milliseconds , between the current time and midnight, January 1, 1970 UTC. It’s the same as “Unix Epoch” or “Unix timestamp” multiplied by 1000 ms .

@Dmitriy the document doesn’t mention time zone. I assume that the time needs to be UTC ?

If so then maybe worth adding this to the documentation.

Pete.

Yes. I think this “January 1, 1970 UTC” says that. But you’re right, it better to say it explicitly.

1 Like

Is it available in Blynk app or only via using POST?
If it’s only post , can somebody give some example for ESP32 Arduino api?
For beginners is very difficult just by looking at the instruction in the doc file. And it seems like there is no examples that I can build code to upload my batch timestamped past data.

@Bartman please don’t spam the forum with the same question in multiple historic topics. It would be far better if you simply created a new “need help with my project” topic and explained in detail what you are trying to achieve, what hardware you are using, and which version of Blynk you are using.

It appears from your various questions that you wish to upload time stamped data to a virtual pin. This is now possible, but only with the HTTP(S) Rest API. The documentation for this is here:

https://docs.blynk.io/en/blynk.cloud/upload-set-of-data-with-timestamps-api

If you have questions about how to implement this, please ask them in a new topic and please provide ALL of the information that is requested when you do that.

Pete.