I'm working on Homework which will allow me to send specific address to web browser in order to execute Something but the problem that I keep getting access denied and Failure when trying to post http address to browser VIA esp8266
this is my code :
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <ESP8266HTTPClient.h>
#define USE_SERIAL Serial
ESP8266WiFiMulti WiFiMulti;
void setup() {
USE_SERIAL.begin(115200);
// USE_SERIAL.setDebugOutput(true);
USE_SERIAL.println();
USE_SERIAL.println();
USE_SERIAL.println();
for(uint8_t t = 4; t > 0; t--) {
USE_SERIAL.printf("[SETUP] WAIT %d...\n", t);
USE_SERIAL.flush();
delay(1000);
}
WiFi.mode(WIFI_STA);
WiFiMulti.addAP("itserv", "azerty98769876");
}
void loop() {
// wait for WiFi connection
if((WiFiMulti.run() == WL_CONNECTED)) {
HTTPClient http;
USE_SERIAL.print("[HTTP] begin...\n");
// configure traged server and url
http.begin("https://192.168.8.100:80\info.php?request=testing");
USE_SERIAL.print("[HTTP] GET...\n");
// start connection and send HTTP header
int httpCode = http.GET();
// httpCode will be negative on error
if(httpCode > 0) {
USE_SERIAL.printf("[HTTP] GET... code: %d\n", httpCode);
// file found at server
if(httpCode == HTTP_CODE_OK) {
String payload = http.getString();
USE_SERIAL.println(payload);
}
} else {
USE_SERIAL.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());
}
http.end();
}
delay(10000);
}
and then errow is below :
01:38:03.235 ->
01:38:03.235 ->
01:38:03.235 ->
01:38:03.235 -> [SETUP] WAIT 4...
01:38:04.247 -> [SETUP] WAIT 3...
01:38:05.269 -> [SETUP] WAIT 2...
01:38:06.255 -> [SETUP] WAIT 1...
01:38:07.258 -> [HTTP] begin...
01:38:07.258 -> [HTTP] GET...
01:38:07.258 -> [HTTP] GET... failed, error: connection refused
01:38:17.272 -> [HTTP] begin...
01:38:17.272 -> [HTTP] GET...
01:38:17.272 -> [HTTP] GET... failed, error: connection refused
01:38:27.256 -> [HTTP] begin...
01:38:27.256 -> [HTTP] GET...
01:38:27.256 -> [HTTP] GET... failed, error: connection refused
01:38:37.236 -> [HTTP] begin...
01:38:37.236 -> [HTTP] GET...
01:38:37.236 -> [HTTP] GET... failed, error: connection refused
I tried many things , any idea are welcome
Best Regars ,
sam