Ubidots Community

[SOLVED] Real-time applications

Greetings Ubidots community

I created a device that collects a lot of data every second (50 Hz). I want to make it IoT-based but I doubt that I can send that much data using Ubidots or can I? Basically my device gathers data every 0.02 second and then a software in MATLAB processes/graphs the data at that interval. Is it possible through Ubidots?

If not, I was thinking of implementing a Queue data structure and send huge traffic every second and then the software automatically determines the data with it’s corresponding time when it was measured.

1 Like

Hi @Flux,

Is posible, you should be send data using this endpoint for send multiple values to one variable, you should send all the data every second or two seconds using this endpoint, the time between samples should be calculated before sending.

Example using curl:

curl -X POST -H "Content-Type: application/json" -d '[{"value":11.21, "timestamp":1476023640000}, {"value":5.21, "timestamp":1476023640050}, {"value":5.21, "timestamp":1476023640100}, {"value":5.21, "timestamp":1476023640150}]' http://things.ubidots.com/api/v1.6/devices/lora-device/temperature/values?token=c74qFmzI7ikTmZ3dFvF3e2hPEmCfu5

In this case the time between samples is 50ms.

1 Like

Thanks @woakas, I’m not familiar with the Ubidots API yet but I’m glad to know it’s possible. I guess I’ll use Ubidots then.
Last question, does Ubidots have an interface with MATLAB, like allowing a MATLAB GUI App to retrieve data from Ubidots?

While I don’t have MATLAB installed, I’d recommend trying their webread function:

data = webread(url) 

where url = “http://things.ubidots.com/api/v1.6/variables/YOUR-VARIABLE-ID/values/?page_size=100&token=YOUR-TOKEN

This will retrieve a JSON array that you would parse in Matlab, see: https://www.mathworks.com/help/matlab/ref/webread.html

Thanks hackmed!