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.
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:
I hope this helps pointing you in the right direction.