Follow along with the video below to see how to install our site as a web app on your home screen.
Not: This feature may not be available in some browsers.
#include <WiFi.h>
#include <HTTPClient.h>
const char* ssid = "Senin_WiFi_Adi";
const char* password = "WiFi_Sifren";
const char* target = "http://192.168.1.1"; // Router'ın IP'si veya kendi ESP32 server'ın IP'si
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
Serial.print("WiFi'ya bağlanıyor...");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("Bağlandı!");
}
void loop() {
if (WiFi.status() == WL_CONNECTED) {
HTTPClient http;
http.begin(target);
int httpCode = http.GET(); // GET isteği at
if (httpCode > 0) {
Serial.printf("Cevap Kodu: %d\n", httpCode);
} else {
Serial.printf("Bağlantı hatası: %s\n", http.errorToString(httpCode).c_str());
}
http.end();
}
delay(100); // 0.1 saniyede 1 istek
}