This represents a single sample. I was sampling every second and I observed many samples were “missing” at Ubidots. I’d like to build larger payloads - maybe 10 samples - and send those every 10 seconds. If I take a second sample and use ubidots.add() will it overwrite the previous sample?
I have no coding experience, so any help with the actual code or an example would be much appreciated.
To answer your question, yes, using ubidots.add() multiple times for the same variable will cause Ubidots to only receive the first sample. To better explain, let’s assume the following code example:
As JSONs cannot contain repeated keys, Ubidots will only save the first “battery” value, the second will be discarded. I guess this is why you were missing data, because other than that, I don’t see why you’d miss data. With this in mind, the Ubidots’ library for Particle doesn’t support sending bulk data, only single samples at a time, and for the foreseeable future, at least in the short-term, it will remain that way.
Now, I recently found a new library developed by a Particle engineer that helps better managing sleep mode while at the same time allows sending bulk data to Ubidots. I’m not sure about the complexity of using it (maybe @chipmc can shed some light about that), but it’s getting traction and I’d recommend checking it out. This is the official post for the library:
I’d also point you to this specific replies that address sending bulk data to Ubidots: Context:
Update:
I hope this helps pointing you in the right direction.