i tested it with an ifttt url which does not work.
possible reason
i think that there is some problem with my code.
ps:- i am not at all good at coding (just an 18 year old)
when i enter the url in the blynk app using the WebHook Widget. it works.
basically this url turns on my Air Conditioner so by using the WebHook widet attached to a virtual pin and using a switch widget attached to the same Pin. i can turn on the ac but in order turn the AC off i need to send another url. which i don’t know how to send using the same swtch when in off position.
similarly i plan to use this approach. to controll by TV’s volume and my KODI’s media controlll using the blynk widgets for the same.
what i want is a sample code that i can enter into the then part of my if statement to send pretty much any url that works when entered into the url Tab of the browser.
i was able to turn on AC by using a WebHook Widget in the Blynk app. i did nothing to the code. as far as Blynk_write is concerned i know how to use that. i just don’t know how to send WEB REQUEST. and don’t be that rude bro
please post full code!!
Where you have declared the variable “http”?
you can try this code, and watch the return variable of GET command:
Serial.print("[HTTP] begin...\n");
// configure traged server and url
http.begin("http://192.168.0.18:1234/msg?code=B2BF50:COOLIX:24&pass=43616&simple=1"); //HTTP
Serial.print("[HTTP] GET...\n");
// start connection and send HTTP header
int httpCode = http.GET();
// httpCode will be negative on error
if (httpCode > 0) {
// HTTP header has been send and Server response header has been handled
Serial.printf("[HTTP] GET... code: %d\n", httpCode);
// file found at server
if (httpCode == HTTP_CODE_OK) {
String payload = http.getString();
Serial.println(payload);
}
} else {
Serial.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());
}
http.end();
Or maybe a problem of non standart http port “1234” ??