Webhook widget

Replace your API Link by this one
http://petstore-demo-endpoint.execute-api.com/petstore/pets
And give us the results you get.

HEy @Blynk_Coeur , Thank you for your interest in my issue…I can report that I get the same OOM result with the API link you provided. :frowning:

1 Like

Pete.

Hi @PeteKnight , Thank you also for your interest…here is the results from the exception decoder. I can’t make any sense from it myself. Does it give you clues?

*Decoding stack results* 
0x4020c06b:**BearSSL::WiFiClientSecureCtx::_installClientX509Validator()** at c:\users\gg & sg\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.3-gcc10.3-9bcba0b\xtensa-lx106-elf\include\c++\10.3.0\ext/**new_allocator.h** line **103** 

0x4020c06b:**BearSSL::WiFiClientSecureCtx::_installClientX509Validator()** at c:\users\gg & sg\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.3-gcc10.3-9bcba0b\xtensa-lx106-elf\include\c++\10.3.0\ext/**new_allocator.h** line **103** 

0x40212620: **operator new(unsigned int)** at C:\Users\GG & SG\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.1\cores\esp8266\**abi.cpp** line **44** 0x4020c06b:**BearSSL::WiFiClientSecureCtx::_installClientX509Validator()** at c:\users\gg & sg\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.3-gcc10.3-9bcba0b\xtensa-lx106-elf\include\c++\10.3.0\ext/**new_allocator.h** line **103**

0x4020bcd8: **std::__shared_ptr::operator=(std::__shared_ptr&&)** at c:\users\gg & sg\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.3-gcc10.3-9bcba0b\xtensa-lx106-elf\include\c++\10.3.0\bits/**shared_ptr_base.h** line **1183**

0x4020c4cd:**BearSSL::WiFiClientSecureCtx::_connectSSL(char const*)** at C:\Users\GG & SG\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.1\libraries\ESP8266WiFi\src\**WiFiClientSecureBearSSL.cpp** line **1128** 

0x402128ec: **__esp_yield()** at C:\Users\GG & SG\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.1\cores\esp8266\**core_esp8266_main.cpp** line **116**

0x40212fde: **__delay(unsigned long)** at C:\Users\GG & SG\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.1\cores\esp8266\**core_esp8266_wiring.cpp** line **54**

0x4020b11a: **WiFiClient::connect(IPAddress, unsigned short)** at C:\Users\GG & SG\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.1\libraries\ESP8266WiFi\src/include/**ClientContext.h** line **148**

0x4020c659: **BearSSL::WiFiClientSecureCtx::connect(char const*, unsigned short)** at C:\Users\GG & SG\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.1\libraries\ESP8266WiFi\src\**WiFiClientSecureBearSSL.cpp** line **231**

0x40215002: **BearSSL::WiFiClientSecure::connect(char const*, unsigned short)** at c:\users\gg & sg\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.3-gcc10.3-9bcba0b\xtensa-lx106-elf\include\c++\10.3.0\bits/**shared_ptr_base.h** line **1324** 

0x4020dc21: **HTTPClient::connect()** at C:\Users\GG & SG\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.1\cores\esp8266/**WString.h** line **277**

0x4020e656: **HTTPClient::sendRequest(char const*, unsigned char const*, unsigned int)** at C:\Users\GG & SG\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.1\libraries\ESP8266HTTPClient\src\**ESP8266HTTPClient.cpp** line **436**

0x4021220d: **String::substring(unsigned int, unsigned int) const** at C:\Users\GG & SG\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.1\cores\esp8266\**WString.cpp** line **696** 

0x40100a5b: **umm_free_core(umm_heap_context_t*, void*)** at C:\Users\GG & SG\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.1\cores\esp8266\umm_malloc\**umm_malloc.cpp** line **549** 

0x4020e78e: **HTTPClient::GET()** at C:\Users\GG & SG\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.1\libraries\ESP8266HTTPClient\src\**ESP8266HTTPClient.cpp** line **355** 

0x40202880: **RepeatTask()** at C:\Users\GG & SG\Documents\Arduino\sketch_aug24c/**sketch_aug24c.ino** line **43**

0x4022e8c2: **br_ssl_engine_flush** at src/ssl/**ssl_engine.c** line **1302** 

0x402089d4: **BlynkMillis()** at C:\Users\GG & SG\Documents\Arduino\libraries\Blynk\src\utility\**BlynkDebug.cpp** line **291** 

0x40208be0: **BlynkTimer::run()** at C:\Users\GG & SG\Documents\Arduino\libraries\Blynk\src\utility\**BlynkTimer.cpp** line **109**

0x402089ae: **loop()** at C:\Users\GG & SG\Documents\Arduino\sketch_aug24c/**sketch_aug24c.ino** line **65** 

0x40212a0c: **loop_wrapper()** at C:\Users\GG & SG\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.1\cores\esp8266\**core_esp8266_main.cpp** line **201**

I don’t understand that, i don’t know if it works well

WiFiClientSecure client1;
client1.setInsecure(); //the magic line, use with caution
//client.connect(host, httpsPort);

My understanding about this line is that it will bypass cetificate/Fingerprint check for https requests. Can be vulnerable to MIM attacks but for the data I’m retrieving it’s not that important. In addition you risk the certification changing in time therefore requiring recoding.

Hello Pete,
Good example. Perfectly works on ESP32.
Tried to port this to MKR1010 and still not able to get it working.
And not able to find any example blynk http for this board.
Have you tried to run same on MKR1010?
Thanks,
Max

I don’t use any Arduino boards I’m afraid.

Pete.

Ok, thank you for fast reply.

Regards,
Max

Solution implemented (REST API).
Works fine for both MKR1010 WiFi and MKR1010 WiFi + MKR Ethernet shield.

Regards,
iotbotscom

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