I have a webhook called “get_weather” as this JSON file:
{
"event": "get_weather",
"url": "https://raincheck-particle.herokuapp.com/api/weather/{{lat}}/{{lon}}?colors=true&format=text",
"requestType": "GET",
"mydevices": true
}
It’s created, registered with an ID, and I subscribe in my firmware here:
Particle.subscribe("hook-response/get_weather", onWeatherData, MY_DEVICES);
I publish an event with variables like this:
Serial.println("Requesting Weather!");
Particle.publish("get_weather", "{ \"lat\": 40.7127, \"lon\": -74.0059 }");
My serial monitor prints back “Requesting Weather!”, however, when I try to print output in onWeatherData, nothing comes back both in the serial monitor and in the dashboard.
void onWeatherData(const char *name, const char *data) {
Serial.println("Weather response!");
String str = String(data);
Serial.println(str);
}
What could possibly be going wrong here? I don’t know how else to troubleshoot this, any tips would be greatly appreciated!