[Solved] Webhook problem

@Robert_Holscher the disconnect is because you have the readbytes in the wrong place. Must be before the Blynk libraries. json is approx 940 so 1024 is currently big enough.

All working here on my WeMos D1 Mini:

{"id":380876,"matchnr":20108,"datetime":"2015-11-06T19:00:00.000Z","matchtypeid":1,"teams":[{"id":1067751,"name":"DOV 4","teamplayers":[{"id":2137382,"name":"M. Petiet","subst":0},{"id":3294276,"name":"S. de Hoogt","subst":0},{"id":3413244,"name":"J. van der Aar","subst":0},{"id":3829013,"name":"D. Bendter","subst":0},{"id":4060662,"name":"R. Holscher","subst":0}],"matchplayers":[{"id":4060662,"name":"R. Holscher","dbl":1},{"id":3413244,"name":"J. van der Aar","dbl":1},{"id":3294276,"name":"S. de Hoogt","dbl":0}]},{"id":1067383,"name":"Stede Broec 5","teamplayers":[{"id":2220119,"name":"J. Broer","subst":0},{"id":3031636,"name":"R. Pronk","subst":0},{"id":3031644,"name":"J. Neuvel","subst":0},{"id":3033183,"name":"P. Sijm","subst":0},{"id":3293759,"name":"T. Buijsman","subst":0}],"matchplayers":[{"id":3293759,"name":"T. Buijsman","dbl":1},{"id":3033183,"name":"P. Sijm","dbl":1},{"id":3031644,"name":"J. Neuvel","dbl":0}]}]}

I am not getting the disconnect anymore, however also no response. With other links i am getting response. I dont know what you did differently.
The buffer define is now before libraries

@Robert_Holscher in webhook I am using GET with no body and the full url quoted incuding /pin[0]/, /pin[1]/ and /pin[2]. Do you have the button (V1) in Switch mode rather than Push mode (Switch for me)?

You can try increasing the baud rate from Blynk’s (old Arduino hardware) default of 9600 to a modern ESP of 115200.

If you are still struggling I’ll send my sketch but basically it’s the code you provided earlier in the thread.

Dear Costas, I will try with the higher baud rate and the push to switch and will let you know. Thanks for your help

Tried it with higher baudrate but still no luck. The call will not be returned with a json, I appreciate your code, maybe I am overlooking a typo.

// Webhook.ino by Costas 24 Dec 2016
#define BLYNK_MAX_READBYTES 1024
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char auth[]   = "xxxx";
char ssid[]   = "xxxx";
char pass[]   = "xxxx";
char server[] = "blynk-cloud.com";
// reference https://ttapp.nl/sbapi?getmatch&date=20151106&clubid=1358&matchnr=20108
int datum = 20151106;
int clubid=1358;
int matchnr= 20108;

void setup()
{
  Serial.begin(115200);
  Blynk.begin(auth, ssid, pass, server);
}

void loop()
{
  Blynk.run();
}

BLYNK_WRITE(V0){
  String webhookdata = param.asStr();
  Serial.println(webhookdata);
}

BLYNK_WRITE(V1){
  if (param.asInt() == 1) {
    Blynk.virtualWrite(V0,datum,clubid,matchnr);
    Serial.println(datum);
    Serial.println(clubid);
    Serial.println(matchnr);
  }
}

Cut and paste of the url in Webhook is:

https://ttapp.nl/sbapi?getmatch&date=/pin[0]/&clubid=/pin[1]/&matchnr=/pin[2]/

Dear Costas
I very much appreciate your help, however I am still having no results even with your code.
Is it possible something needs to change in the library to get it to work ? Something specific for NodeMCU ?
I am using Arduino IDE

Is there some debug info I can activate, since I am seeing nothing in my serial monitor except the three values, but no return.

Add the following lines as your second and third lines and then provide us with Serial Monitor details.

#define BLYNK_PRINT Serial // Defines the object that is used for printing
#define BLYNK_DEBUG        // Optional, this enables more detailed prints

Webhook is not fully functional widget. I tried to get help from Blynk founders and got nothing. I gave up webhooking with Blynk

Not accurate.

The webhook works fine for myself and a majority of Blynk’ers.
If you are experiences issues then it is a localised bug or user error.

I saw your previous posts from mid November and you never finished the discussion from the developers who were trying to help you.

I could also see a lack of understanding of Blynk basics.

3 Likes

Accurate.

I haven’t finish the discussion because lack of the help from developers. It’s waste of time for me.
Show me how to integrate Webhook widget with Thingspeak.com one of most popular IoT services. There is no response from the widget. That’s why I was asking for help (and still asking) Blynk offeres paid services, so it should be functional.

Dear Costas,

Hereby the log with the debug on. Sorry it took some time to get this , but here it is
As you can see, the button is pushed when the 3 numbers are showing in the log, but no return from the call

[253] Connecting to xxxxxxx
[7255] Connected to WiFi
[7255] IP: xxxxxxxxxxx
[7255] Blynk v0.3.9 on NodeMCU
[7255] Connecting to blynk-cloud.com:8442
[7285] <[02|00|01|00] xxxxxxxxxxxxxxx
[7344] >[00|00|01|00]È
[7344] Ready (ping: 41ms).
[7344] <[11|00|01|00]Hver[00]0.3.9[00]h-beat[00]10[00]buff-in[00]1024[00]dev[00]NodeMCU[00]build[00]Dec 29 2016 11:52:30[00]
[7365] >[00|00|01|00]È
[17365] <[06|00|02|00|00]
[17382] >[00|00|02|00]È
[27383] <[06|00|03|00|00]
[27402] >[00|00|03|00]È
[30327] >[14|00|01|00|02]
[30327] >pm
[34815] >[14]!4[00|06]
[34815] >vw[00]1[00]1
[34815] <[14]!4[00|18]vw[00]0[00]20151106[00]1358[00]20108
20151106
1358
20108
[44816] <[06|00|04|00|00]
[44836] >[00|00|04|00]È
[54835] <[06|00|05|00|00]
[54855] >[00|00|05|00]È
[64856] <[06|00|06|00|00]
[64874] >[00|00|06|00]È
[74875] <[06|00|07|00|00]
[74892] >[00|00|07|00]È
[84893] <[06|00|08|00|00]
[84909] >[00|00|08|00]È
[94910] <[06|00|09|00|00]
[94928] >[00|00|09|00]È
[104929] <[06|00|0A|00|00]
[104947] >[00|00|0A|00]È
[114948] <[06|00|0B|00|00]
[114965] >[00|00|0B|00]È
[124966] <[06|00|0C|00|00]
[124983] >[00|00|0C|00]È
[134983] <[06|00|0D|00|00]
[135000] >[00|00|0D|00]È
[145001] <[06|00|0E|00|00]
[145024] >[00|00|0E|00]È
[155025] <[06|00|0F|00|00]
[155046] >[00|00|0F|00]È
[165047] <[06|00|10|00|00]
[165063] >[00|00|10|00]È
[175064] <[06|00|11|00|00]
[175080] >[00|00|11|00]È
[185081] <[06|00|12|00|00]
[185097] >[00|00|12|00]È
[195098] <[06|00|13|00|00]
[195113] >[00|00|13|00]È
[205114] <[06|00|14|00|00]
[205137] >[00|00|14|00]È
[215138] <[06|00|15|00|00]
[215157] >[00|00|15|00]È
[225158] <[06|00|16|00|00]
[225174] >[00|00|16|00]È
[235175] <[06|00|17|00|00]
[235190] >[00|00|17|00]È

@Robert_Holscher try version 4.0 of the library as 3.9 is 3 months old.

I am currently using 4.0.

Hi Costas,

Does not make a difference. Tested with the just released library of blynk and with arduino 1.8 , but same result

Did you try 4.0?

I tried with 0.43 the latest library of blynk

@Jamin which library version are you using and are you using Blynk’s cloud server?

I am still on 0.4.0 and my webhook test was with a local server that is also a few versions behind.

@Robert_Holscher I actually wanted you to try 0.4.0 as that is working for me. I haven’t seen any reports of webhook bugs in the latest library or server so 0.4.3 should be ok.

Please paste as many screenshots of your project as possible and I will check with mine.

Using 0.4.2 with local server.

1 Like