Posts

ESP32 Captive Portal Search Engine Code

Image
  #include <WiFi.h> #include <DNSServer.h> #include <WebServer.h> #include <HTTPClient.h> #include <WiFiClientSecure.h> #include <ArduinoJson.h> // ---------------- USER CONFIGURATION ---------------- // Backend Router (Internet connection for ESP32) const char* sta_ssid = "Airtel_X";       // Aapka router ka naam const char* sta_pass = "Gau@0369";    // Aapka router ka password // ESP32 Access Point (Network name for users) const char* ap_ssid = "ESP32 SEARCH ENGINE";        // AP Name jo mobile mein show hoga // ---------------------------------------------------- const byte DNS_PORT = 53; DNSServer dnsServer; WebServer server(80); // Function to safely encode search queries for URL (e.g. "Elon Musk" -> "Elon%20Musk") String urlEncode(String str) {   String encodedString = "";   char c;   char code0;   char code1;   for (int i = 0; i < str.lengt...

Offline chatting using a ESP32 code

Image
  #include <WiFi.h> #include <DNSServer.h> #include <WebServer.h> #include <vector> // Wi-Fi Configuration (Open Network) const char* ssid = "FREE CHAT"; // DNS and Web Server Settings const byte DNS_PORT = 53; IPAddress apIP(192, 168, 4, 1); DNSServer dnsServer; WebServer server(80); // Structure to store messages struct Message {   String sender;   String text; }; std::vector<Message> chatHistory; const size_t MAX_MESSAGES = 15; // Image support ke liye memory limit ko 15 kiya taaki crash na ho // JSON Escape helper to handle special characters and long strings safely String escapeJSON(String input) {   input.replace("\\", "\\\\");   input.replace("\"", "\\\"");   input.replace("\n", "\\n");   input.replace("\r", "");   return input; } // HTML, CSS, aur JavaScript (With Image Compression & Upload Feature) const char HTML_INDEX[] PROGMEM = R"=====(...