////////////////Basic wifi Network test//////////////////
//Based in BasicHttpClient ESP32 board example //////////////
#include <WiFi.h>
#include <HTTPClient.h>
String message="http://example.com/index.html";
void setup() {
Serial.begin(115200);
//Conect to wifi network
WiFi.begin("Wokwi-GUEST", ""); //Wifi_Network, Wifi_Password ******CHANGE
//Wait until connection
while((WiFi.status() != WL_CONNECTED)) {
delay(500);
Serial.print(".");
}
Serial.println("Wifi conected");
}
void loop() {
// wait for WiFi connection
if((WiFi.status() == WL_CONNECTED)) {
HTTPClient http;
http.begin(message); //HTTP
// start connection and send HTTP header, return error code
int httpCode = http.GET();
Serial.print("[HTTP] GET...\n");
Serial.printf("[HTTP] GET... code: %d\n", httpCode);
http.end();
}
delay(2000);
}