Cloud API diagnostic (last) not in sync

Hi everyone,

Thinkering a bit with particle with a friend and have a device sending data to our server via webhooks. We started sending our own diagnostics too but found a lot of those are already on particle’s cloud end, so i thought that i can retrieve those instead.

Problem is that I don’t get why, when i call the API https://api.particle.io/v1/products/xxxxx/diagnostics/xxxxxxxxx/last the data is never in sync, even hours later. My device last reported at 5:20AM (this is what I store in my db as creation time as well as the “published_at” that comes from the particle event) today and the cloud API returns me the latest as 1:20AM (updated_at).

Can someone tell me why this is? bug? am i looking at timezone difference?

/Manuel

Hi @mm1987 - as far as I understand your question, diagnostics are typically only published from the device automatically under certain conditions (e.g. a handshake, a hard reset, etc…). You will have to ask the device to publish vitals (https://docs.particle.io/reference/device-os/firmware/argon/#particle-publishvitals-) in order to keep your requests more in sync.

Welcome to the community.

The question here is what are you actually trying to do or need to do?
You can publish the status of your device on a suitably regular basis including all the relevant data that you need. You can also put the actual local date/time on the device in that data so you don’t have to worry if the message gets buffered somewhere.

As an example - the device web app I work with requires a heartbeat/update from each device at least every minute except when they are sleeping. This means the web app can maintain a digital double pretty much in sync with the actual device.

Oh thanks guys! We found out that it’s something we ourselves can/have to push to the cloud. though it was something that happened automatically with any connection the device made.

Could you tick this thread as solved?

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.