Webhook widget

Hi Pete, It’s been a whiiiiiile and I can tell I’m rusty… Are you still using this sketch? I don’t get any joy trying this on an 8266. Below is the error that comes up when I try compiling.











C:\Users\Surface\AppData\Local\Temp\arduino_modified_sketch_842165\Edgent_ESP8266.ino: In function 'void api_bridge(String, int, float)':
Edgent_ESP8266:66:13: error: call to 'HTTPClient::begin' declared with attribute error: obsolete API, use ::begin(WiFiClient, url)
   66 |   http.begin(server_path.c_str());
      |   ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
exit status 1
call to 'HTTPClient::begin' declared with attribute error: obsolete API, use ::begin(WiFiClient, url)

http.begin(server_path.c_str()); //line causing the error

Any ideas?

1 Like

Hi Dave, I’ve never really used this solution myself, except for testing, as I use Node-Red so do all my bridging in there.
As a short-term fix you could try downgrading your ESP core to the highest 2.xxx version - I suspect that will fix the issue.

I’m away at the moment, so when I get home next week I’ll do some testing and figure out a proper solution.

Pete.

1 Like

Hi Dave,
I might be off base here as I’m very much learning this coding stuff myself but I think the latest version of the HTTP client needs to have a WIFI client declared eg client (WIFI client library needs to be included). The http.begin statement is then http.begin(client, server_path.c_str()).

Cheers
Steve

Dear all,

the webhook feature work in progress currently. Hopefully, within the next week (3 weeks in the worst case), we’ll be able to release it.

2 Likes

Thanks for the update @Dmitriy. As you can see from this thread, it will be a popular addition.

Cheers
Steve

Yes I am looking forward to this. Will it be on the console as well as the app?

Only on the console.

Hi David ,

I use this code and it works well for me

#include <ESP8266HTTPClient.h>
.
//************ Bridges *********************//
String server_name = "http://fra1.blynk.cloud/external/api/"; // for French server
String Auth1 = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // token for the receiving device 1

.

 timer.setInterval(5000L, read_some_data); // call every 5 sec
.
.
.
.
// Bridge function
void BridgeRead(String token, int virtual_pin, float value_to_send) {
  String server_path = server_name + "get?token=" + token + "&v" + String(virtual_pin);
  http.begin(client, server_path.c_str()); //ESP8266
  int httpCode = http.GET(); //get info
  payload = http.getString();   //Get the request response payload
  http.end();   //Close connection
  fuel_level=payload.toInt();  // int conversion
  Blynk.virtualWrite(V5, fuel_level); // write to widget
}


void read_some_data() {
  BridgeRead(Auth1, 64, fuel_level); // Token , vPin , value
}

@Blynk_Coeur do you declare the client object elsewhere in your code?

Pete.

1 Like
#include <BlynkSimpleEsp8266.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#include <WidgetRTC.h>
WidgetLED led1(V21);
#include <Adafruit_AHTX0.h>
Adafruit_AHTX0 aht;
WiFiClient client; // <------------------- `client` object

#define SrlBaud 57600
1 Like

How could I forget you are the NR. @PeteKnight
I was determined that I would got that route but with the Blynk2 not being seamless w NR in the beginning I sat back waiting for it to get sorted out (because it was above my head to contribute :grin:) How is it working by now is there a different add on to install in NR or is the existing updated?

I’ll give @Blynk_Coeur ‘a code a shot this evening. Looks like it is what the compiler is looking for…

1 Like

Warning: I don’t use blynk edgent !

1 Like

You know of a potential conflict?

I don’t know, I never tried before .
I prefer to use hard-coding and arduinoOTA .

1 Like

Blynk Edgent and WebHooks do not like each other :frowning:

Webhooks are now should be available on the Web Console. There is a known validation issue, but it should work in general.

FREE plan - allows 1 webhook
PLUS - allows 5 wehooks
PRO - allows 10 webhooks

Limits could be changed based on further feedback.

2 Likes

Hi @Dmitriy, is this where I should find the webhook settings?

@GG07 correct.

I can’t see webhook, no more developers section on the Web Console , am I wrong ?

1 Like

Same here !!!