I have about 20 Electrons active right now, happily publishing data every hour. Just now (30min. ago) 17 out of 20 devices conencted to the Cloud, published the data, but the webhook Integration I have with Ubidots simply shows “sleep”. No request/response log is shown, just the event log (which appears to be 100% fine to me).
What does this mean? From what I understand the main results are “success” and “error” - in which case there’s usually a detailed error log. But what does “sleep” indicate? My devices connected + published fine, the data just didn’t appear in Ubidots.
Is this a Particle Cloud issue, or an Ubidots issue?
EDIT: All devices connected again + submitted data to Ubidots for the next check-in. Still, I’m curious as to what exactly happened here, particularlywhether the issue pertains to Ubidots or Particle Cloud.
It's my understanding that Sleeping Webhooks are usually beyond Particle's Control. It's the Endpoint.
I have an Electron Gateway that sends a lot of publishes a day to ThinkSpeak from my private Mesh.
On the pic below, ThingSpeak was having some problems that day and the Webhook graph showed 19 Sleep Events:
So the Sleeping webhooks usually are the results of an Error coming from the Endpoint? My devices all publish at the exact same time so it would make sense, but in this case I haven’t had any Errors for the last 5 days.
I think you need to think at a grander scale.
Do you know how many concurrent requests hit the Ubidots endpoint, from other sources than your few devices, at the very moment and can you exclude the possibility that Ubidots may have degraded QoS due to maintenance or things like DDoS or stuff.
If it’s a one-off, I’d leave it for the time being - especially since it seemed to self-heal -, but if it keeps happening repeatedly you may want to contact Ubidots.
Where and when would you expect that return code to be delivered to you?
Success and failure on the remote end are already reported via the respective webhook response events and - if I’m not mistaken - the cloud now also provides a response (including possible reason) when a webhook was muted.
Your device just needs to subscribe to these evens.
I can see how the webhook response could work; haven’t used it before, but the Particle console shows the xml response for success and failure, but not for sleep. Console only lists the event that triggered it.
Is that how it suppose to work?
I’d not subscribt to System.deviceID() + "/hook-response/twilio3" but rather only to System.deviceID() + "/hook-response/"
Also double check that System.deviceID() and your obscured <device id> match exactly.
I’d put the subscribe filter prefix into a string and print that out or expose it via Particle.variable() to check.
And since your do get a <device id>/hook-response/twilio3/0 response I’d suspect there are also some <device id>/hook-response/twilio3/1 ... n responses that also need to be used.
It’s also not advisded to Particle.publish()from a Particle.subscribe() handler
removed the Particle.publish() from the event handler, as you pointed out and is documented
removed {{{PARTICLE_EVENT_VALUE}}} from the response template
I also implemented a moustache template per @rickkas7 excellent webhooks intermediate tutorial and the appropriate response data is easily retrieved for use by the electron.
The assistance you guys provide via the forum and tutorials/online docs is awesome.
Thanks for the help!