Posts

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"=====(...