Inconsistent Thingspeak webhook response

I am looking into migrating to the particle.io platform.

I am finding that the response from the Thingspeak webhook is inconsistent: many time the return data is "0" and at other times it is the correct number of channel entries.

When I post directly to Thingspeak using a different app Thingspeak consistently returns the number of channel entries.

Please point me to where I should be looking to get consistent results on particle.io

Thank you

What does the integration log in the console show? It should show the full request and response, and any errors, for the10 most recent requests.

What is the difference in the request and response between the success and failure cases?

this is myHandler code:

void myHandler(const char *event, const char *data) {
// Handle the integration response
Particle.publish("enter myHandler");
Particle.publish("event", event);
Particle.publish("data ", data);
Serial.println("data " + String(data));
Particle.publish("exit myHandler");
}

Attached are screenshots of:


Thingspeak successfully updates the data that is posted by Webhook and correctly increments the number of entries that it tries to return to the Webhook handler

Is myHandler a subscription handler? You can't Particle.publish from a subscription handler because they share a single buffer. You need to save the data from the subscription and publish from loop, otherwise the data will be corrupted.

1 Like