ESP32 - Wifi
Android version 11
Blynk server
v 0.6.1
I have trouble when calling a Webhook: sometimes it works, but often it does not get triggered (not getting in the function at all). I have it in setup() and in pushed button to trigger the webhook. See here the code for the push button (V58):
BLYNK_WRITE(V58)
{
Blynk.virtualWrite(V57,1);
}
The code for the webhook itself:
BLYNK_WRITE(V57)
{
terminal.println("V57 API UTC offset started");
terminal.flush(); //it does not even get here!
const char* WebHookData= param.asStr();
const char* json = WebHookData;
StaticJsonDocument<512> doc;
// Deserialize the JSON document
DeserializationError error = deserializeJson(doc, json);
// Test if parsing succeeds.
if (error) {
terminal.print("deserializeJson() failed for WorldTimeAPI: ");
terminal.println(error.f_str());
terminal.flush();
return;
}
UtcOffset = doc["utc_offset"];
vCurrentUtcOffset= String(UtcOffset);
}
Maybe you should try re-reading what you’ve posted and asking yourself if a third part would be able to follow it, and whether other information (like how the webhook widget is configured) may be of assistance.
What you’ve posted also leaves people wondering if there is something in the rest of your sketch that is causing an issue, and whether you’ve used a #define BLYNK_MAX_READBYTES statement - neither of which can be ascertained from this code snippet.
So, sometimes it comes in the V57 function, and sometimes it doesn’t.
The #define BLYNK_MAX_READBYTES was not set, but when i added it (set to 1024) in the beginning of my sketch it did not change/solve the issue.