Blynk2 API documentation / example sketch mismatch

Hello!

I’m trying to implement API https requests, and after reading the official documentation and checking the built in example sketch in the lib, I see they are different…

to update value:
on the website:
https://blynk.cloud/external/api/update?token=ffujYGgbf805tgsf&v1=100

in the sketch:

httpRequest("GET", String("/external/api/update?token=") + BLYNK_AUTH_TOKEN + "&pin=V1&value=" + value, "", response)

…which would result in “/external/api/update?token=ffujYGgbf805tgsf&pin=V1&value=100”

to read value:
on the website:
https://blynk.cloud/external/api/get?token=Rps15JICmtRVbFyS_95houlLbm6xIQ2L&v1

in the sketch:

httpRequest("GET", String("/external/api/get?token=") + BLYNK_AUTH_TOKEN + "&pin=V1", "", response)

…which would result in “/external/api/update?token=ffujYGgbf805tgsf&pin=V1”

so I think there is bug in the example sketch. Can someone please look into this?

Hello, It looks like it’s C++ specific. I will check

Either syntax (for the part after the Auth Token) works. You can test them by pasting them into the address bar of your browser (the syntax from the sketch obviously needs the https://blynk.cloud/ prefix adding to the beginning.

Pete.

Thanks, I see. It was a bit confusing which one is correct…

Just one quick off-topic question, does the latest Blynk2 lib works with ESP8266 core v2.4.2?

Not sure, but I doubt it.
Why do you need to use such an old ESP8266 core version?

Pete.

Hi!

It works. Honestly, I do not remember the exact reason, it was a long long time ago: when the esp core 2.4.3+ appeared there were some general stability issues (not blynk related), like random crashes, restarts, etc, and the esp guys did not solve it for several new core versions. Back then I (and also other forum members) just kept using the last stable version, and since then it works really good :slight_smile:

Even i was using the old esp8266 2.4.2 core. And it was very stable for my use.

But the BlynkIoT requires 3.+.+ core. And the lasted core seems to be working fine. No crashes until i do something silly in the code.

1 Like