It takes about a minute for my Spark Core’s connected status to update to the cloud. Is it possible to force the cloud to update this at shorter intervals?
The online status should be almost instantaneously, whereas the offline status can take a bit. The online status gets “pushed” to the cloud upon connection. The offline status is a check by the cloud. Since your device can’t send an “offline” message when it’s offline this can take some time before the cloud checks again. Perhaps @dave can elaborate(?)
I’m running a script that checks for when it goes offline. Is it possible to increase the rate at which the cloud checks?
As far as I’m aware, we’ve got little control over what the cloud does. Perhaps there are some alternatives you could explore to get similar results (Local cloud comes to mind - total control). Other than that, you’d have to ask @dave about Cloud functionalities.
What are you trying to achieve by checking the status? If you could explain what you’re trying to do, perhaps we can offer some alternatives(?)
I’m making a tracking system of a sort. When the Spark Core leaves the vicinity of the home, it drops from the wifi, and the script executes.
In that case, you could have your Core send keep-alives using SSE. Have your Core publish a “I’m still here” event every 5-10s and have your script listening for those. That should work similarly.
It’s just tricky when the TCP session isn’t closed cleanly, but I like the idea of adding some customizability to what the cloud should do when the device doesn’t respond, or how long the cloud should wait. I’m thinking we could add some commands like: “Hey, if you don’t hear from me for 30 seconds, consider me offline”, etc.