{"id":23073734,"url":"https://github.com/akashdip2001/esp32-host-html-website","last_synced_at":"2026-03-09T04:31:20.812Z","repository":{"id":246709397,"uuid":"821927425","full_name":"akashdip2001/ESP32-host-HTML-website","owner":"akashdip2001","description":"Host your custom website using ESP32 in your Local Area Network LAN","archived":false,"fork":false,"pushed_at":"2025-03-08T19:12:23.000Z","size":27473,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-20T02:46:00.766Z","etag":null,"topics":["esp32","html","iot","local-area-network","localhost","website"],"latest_commit_sha":null,"homepage":"https://akashdip2001.github.io/ESP32-host-HTML-website/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akashdip2001.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-06-29T20:44:08.000Z","updated_at":"2025-08-17T23:11:25.000Z","dependencies_parsed_at":"2024-07-05T13:55:02.081Z","dependency_job_id":"8e8afbe1-8b14-4d20-8ccf-639e665dee13","html_url":"https://github.com/akashdip2001/ESP32-host-HTML-website","commit_stats":null,"previous_names":["akashdip2001/esp32-host-html-website"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/akashdip2001/ESP32-host-HTML-website","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akashdip2001%2FESP32-host-HTML-website","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akashdip2001%2FESP32-host-HTML-website/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akashdip2001%2FESP32-host-HTML-website/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akashdip2001%2FESP32-host-HTML-website/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akashdip2001","download_url":"https://codeload.github.com/akashdip2001/ESP32-host-HTML-website/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akashdip2001%2FESP32-host-HTML-website/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30283414,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T02:57:19.223Z","status":"ssl_error","status_checked_at":"2026-03-09T02:56:26.373Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esp32","html","iot","local-area-network","localhost","website"],"created_at":"2024-12-16T08:18:49.945Z","updated_at":"2026-03-09T04:31:20.777Z","avatar_url":"https://github.com/akashdip2001.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp float=\"left\"\u003e\n  \u003cimg src=\"img/ESP32-38 PIN-DEVBOARD.png\" width=\"100%\" /\u003e\n\u003c/p\u003e\n\n# ESP32-host-HTML-website\n\n# ✅ HTML in CPP\n\n```cpp\n#include \u003cWiFi.h\u003e\n#include \u003cWebServer.h\u003e\n\nconst char* ssid = \"YourHotspotSSID\";\nconst char* password = \"YourHotspotPassword\";\n\nWebServer server(80);\n\nvoid setup() {\n    Serial.begin(115200);\n\n    // Connect to Wi-Fi\n    WiFi.begin(ssid, password);\n    while (WiFi.status() != WL_CONNECTED) {\n        delay(1000);\n        Serial.println(\"Connecting to WiFi...\");\n    }\n    Serial.println(\"Connected to WiFi\");\n\n    // Print ESP32 local IP address\n    Serial.println(WiFi.localIP());\n\n    // Route for root / web page\n    server.on(\"/\", HTTP_GET, [](){\n        server.send(200, \"text/plain\", \"Hello from ESP32!\");\n    });\n\n    // Start server\n    server.begin();\n    Serial.println(\"HTTP server started\");\n}\n\nvoid loop() {\n    server.handleClient();\n}\n\n```\n\n# big HTML =\u003e CPP \u0026 using as array[] [video](https://youtu.be/CPCTf20Sbvw)\n\n\u003cp float=\"left\"\u003e\n  \u003cimg src=\"img/1 (1).png\" width=\"49%\" /\u003e\n  \u003cimg src=\"img/1 (2).png\" width=\"49%\" /\u003e\n\u003c/p\u003e\n\n\u003cimg src=\"https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif\"\u003e\n\n# ✅ HTML =\u003e PowerShell with .NET Classes\n\n```kotlin\n/YourSketchFolder\n├── YourSketchName.ino\n├── data\n│   ├── index.html\n│   ├── style.css\n│   └── script.js\n```\n\nmove =\u003e Arduino IDE =\u003e File =\u003e Preferences =\u003e SketchBook Location =\u003e where 📁 \"sketch_jun28a.ino\" \u003cbr /\u003e\n\u0026 convart the index.html =\u003e index_html_gz.h using PowerShell\n\n\u003cp float=\"left\"\u003e\n  \u003cimg src=\"img/2 (3).png\" width=\"49%\" /\u003e\n  \u003cimg src=\"img/2 (4).png\" width=\"49%\" /\u003e\n\u003c/p\u003e\n\n```powershell\n$inputFile = \"C:\\Users\\akash\\OneDrive\\Documents\\Arduino\\data\\index.html.gz\"\n$outputFile = \"C:\\Users\\akash\\OneDrive\\Documents\\Arduino\\sketch_jun28a\\index_html_gz.h\"\n\n$fileBytes = [System.IO.File]::ReadAllBytes($inputFile)\n\n$hexString = \"const unsigned char index_html_gz[] PROGMEM = {\" + [System.Environment]::NewLine\n$hexArray = @()\n\nforeach ($byte in $fileBytes) {\n    $hexArray += \"0x\" + $byte.ToString(\"X2\")\n}\n\n$hexString += ($hexArray -join \", \") + [System.Environment]::NewLine\n$hexString += \"};\" + [System.Environment]::NewLine\n$hexString += \"const int index_html_gz_len = sizeof(index_html_gz) / sizeof(index_html_gz[0]);\" + [System.Environment]::NewLine\n\n$hexString | Out-File -FilePath $outputFile -Encoding ASCII\n```\n\u003cp float=\"left\"\u003e\n  \u003cimg src=\"img/2 (1).png\" width=\"49%\" /\u003e\n  \u003cimg src=\"img/2 (2).png\" width=\"49%\" /\u003e\n\u003c/p\u003e\n\n```cpp\n#include \u003cWiFi.h\u003e\n#include \u003cWebServer.h\u003e\n#include \"index_html_gz.h\" // Include the generated header file\n\nconst char* ssid = \"spa\";\nconst char* password = \"12345678\";\n\nWebServer server(80);\n\nvoid setup() {\n    Serial.begin(115200);\n\n    // Connect to Wi-Fi\n    WiFi.begin(ssid, password);\n    while (WiFi.status() != WL_CONNECTED) {\n        delay(1000);\n        Serial.println(\"Connecting to WiFi...\");\n    }\n    Serial.println(\"Connected to WiFi\");\n\n    // Print ESP32 local IP address\n    Serial.println(WiFi.localIP());\n\n    // Route for root / web page\n    server.on(\"/\", HTTP_GET, [](){\n        server.sendHeader(\"Content-Encoding\", \"gzip\");\n        server.send_P(200, \"text/html\", reinterpret_cast\u003cconst char*\u003e(index_html_gz), index_html_gz_len);\n    });\n\n    // Start server\n    server.begin();\n    Serial.println(\"HTTP server started\");\n}\n\nvoid loop() {\n    server.handleClient();\n}\n```\n\nin Bionary [index_html_gz.h (Generated header file):]\n\n\u003cp float=\"left\"\u003e\n  \u003cimg src=\"img/2 (7).png\" width=\"100%\" /\u003e\n\u003c/p\u003e\n\u003cp float=\"left\"\u003e\n  \u003cimg src=\"img/2 (5).png\" width=\"49%\" /\u003e\n  \u003cimg src=\"img/2 (6).png\" width=\"49%\" /\u003e\n\u003c/p\u003e\n\n# alternate process (use .h file without directly convert using cmd) [video](https://youtu.be/eHxkZ7poKHc)\n\nadvantage of this process - it's suitable for using javascript \n\n\u003cimg src=\"https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif\"\u003e\n\n# ❌ HTML in ESP32's SPIFFS (SPI Flash File System)\n\ngoTo [GitHub:](https://github.com/me-no-dev/arduino-esp32fs-plugin) =\u003e [Releases](https://github.com/me-no-dev/arduino-esp32fs-plugin/releases/tag/1.1) =\u003e download ESP32FS-1.1.zip \u003cbr /\u003e\nIDE =\u003e Files =\u003e Preferences =\u003e ScatchBook Location =\u003e create filder \"tools\" =\u003e copy-pest the folder 📂\"ESP32FS\" =\u003e Restart the IDE\n\n# guide [video_1](https://youtu.be/0ox1oF9pSus) , [video_2](https://youtu.be/LcMVoKb1NhE)\n\nIf you're encountering a \"404 Not Found\" error when trying to access `http://192.168.150.165/`, it typically indicates that the server (your ESP32 in this case) is running and reachable, but it couldn't find the requested resource (`index.html` or any other file you specified). Here are a few steps to troubleshoot and resolve this issue:\n\n### Steps to Troubleshoot:\n\n1. **Check SPIFFS Upload:**\n   - Ensure that you have successfully uploaded your `index.html` file and any other necessary files to SPIFFS. Use the SPIFFS upload tool in Arduino IDE or PlatformIO to verify that the files are indeed transferred to the ESP32.\n\n2. **Verify File Path:**\n   - Double-check the path and filename used in your `server.on(\"/\", ...)` handler. Ensure that it matches exactly with the file name (`index.html`) and path in SPIFFS where you uploaded it.\n\n3. **Serial Monitor Output:**\n   - Review the serial monitor output for any errors or messages indicating issues with SPIFFS initialization or file serving.\n\n4. **HTTP Request Handling:**\n   - Confirm that the server is correctly handling HTTP requests. In your case, the handler should respond to requests to the root path (\"/\") with the `index.html` file.\n\n### Adjusted Code Example:\n\n```cpp\n#include \u003cWiFi.h\u003e\n#include \u003cAsyncTCP.h\u003e\n#include \u003cESPAsyncWebServer.h\u003e\n#include \u003cSPIFFS.h\u003e\n\n// Replace with your network credentials\nconst char* ssid = \"your_SSID\";\nconst char* password = \"your_PASSWORD\";\n\nAsyncWebServer server(80);\n\nvoid setup() {\n    Serial.begin(115200);\n    delay(1000); // Allow time for serial monitor to open\n\n    // Connect to Wi-Fi\n    Serial.println();\n    Serial.print(\"Connecting to Wi-Fi...\");\n    WiFi.begin(ssid, password);\n    while (WiFi.status() != WL_CONNECTED) {\n        delay(1000);\n        Serial.print(\".\");\n    }\n    Serial.println(\"Connected to WiFi\");\n\n    // Print ESP32 local IP address\n    Serial.print(\"IP Address: \");\n    Serial.println(WiFi.localIP());\n\n    // Initialize SPIFFS\n    if (!SPIFFS.begin(true)) {\n        Serial.println(\"An error occurred while mounting SPIFFS\");\n        return;\n    }\n    Serial.println(\"SPIFFS initialized\");\n\n    // Route for root / web page\n    server.on(\"/\", HTTP_GET, [](AsyncWebServerRequest *request){\n        request-\u003esend(SPIFFS, \"/index.html\", \"text/html\");\n    });\n\n    // Start server\n    server.begin();\n    Serial.println(\"HTTP server started\");\n}\n\nvoid loop() {\n    // Keep the server running\n    // Not much to do here, but keep the server alive\n}\n```\n\n### Additional Checks:\n\n- **Clear Cache:** Sometimes browsers cache 404 errors. Clear your browser cache or try accessing the IP address from a different browser or incognito/private window.\n  \n- **Check IP Address:** Ensure that the IP address printed in the serial monitor (`Serial.println(WiFi.localIP())`) matches the one you're trying to access in the browser.\n\n- **Network Configuration:** If the problem persists, check your network configuration and ensure there are no firewall rules or network settings preventing access to the ESP32.\n\nBy following these steps and ensuring everything is configured correctly, you should be able to resolve the \"404 Not Found\" error and successfully access your ESP32 hosted web page at `http://192.168.150.165/`. \u003cbr /\u003e\noutput\n\n```\nConnecting to Wi-Fi........Connected to WiFi\nIP Address: 192.168.150.165\nSPIFFS initialized\nHTTP server started\n```\n\n\u003cimg src=\"https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif\"\u003e\n\n# ✅✅✅ using SD Card ♦️ module [my video ⤵️](https://youtu.be/ySJt3QGyr9w)\n\n\u003cp float=\"left\"\u003e\n  \u003cimg src=\"img/youtube_1.jpg\" width=\"100%\" /\u003e\n\u003c/p\u003e\n\n# [my video ⤴️](https://youtu.be/ySJt3QGyr9w) Complete explain the project \n\n# guide [video_1](https://youtu.be/JxjZXf7veMM) , [video_2](https://youtu.be/naZYr5vY4Sg) , [video_3](https://youtu.be/mFsLlakhVL8)\n\nTo host a website using your ESP-WROOM-32 module and a microSD card, you can follow these general steps:\n\n```\nESP-WROOM-32                    MicroSD Card Module\n  |                                  |\n  | CS (GPIO X) ---------------------| CS\n  | SCK (GPIO Y) --------------------| SCK\n  | MOSI (GPIO Z) -------------------| MOSI\n  | MISO (GPIO W) -------------------| MISO\n  | 3.3V ----------------------------| VCC (or 3.3V)\n  | GND -----------------------------| GND\n```\n\n\n\n### CODE\n\n```cpp\n#include \u003cWiFi.h\u003e\n#include \u003cSPI.h\u003e\n#include \u003cSD.h\u003e\n#include \u003cESPAsyncWebServer.h\u003e\n\n// Pin Definitions\n#define SD_CS    5   // Replace with the GPIO pin number connected to CS of microSD card module\n#define SD_SCK   18  // Replace with the GPIO pin number connected to SCK of microSD card module\n#define SD_MOSI  23  // Replace with the GPIO pin number connected to MOSI of microSD card module\n#define SD_MISO  19  // Replace with the GPIO pin number connected to MISO of microSD card module\n\nconst char* ssid = \"spa\";\nconst char* password = \"12345678\";\n\nAsyncWebServer server(80);\n\nvoid setup() {\n  // Initialize Serial and SD card\n  Serial.begin(115200);\n  \n  // Print Wi-Fi connection details\n  Serial.print(\"Connecting to \");\n  Serial.println(ssid);\n\n  // Connect to Wi-Fi\n  WiFi.begin(ssid, password);\n  int tries = 0;\n  while (WiFi.status() != WL_CONNECTED) {\n    delay(1000);\n    Serial.print(\".\");\n    tries++;\n    if (tries \u003e 20) {\n      Serial.println(\"Failed to connect to WiFi\");\n      break;\n    }\n  }\n\n  if (WiFi.status() == WL_CONNECTED) {\n    Serial.println(\"\");\n    Serial.println(\"WiFi connected\");\n    Serial.print(\"IP address: \");\n    Serial.println(WiFi.localIP());\n  } else {\n    Serial.println(\"WiFi connection failed\");\n    return;\n  }\n\n  // Initialize SD card\n  if (!SD.begin(SD_CS)) {\n    Serial.println(\"Card Mount Failed\");\n    return;\n  }\n  \n  // Check if index.html exists\n  if (!SD.exists(\"/index.html\")) {\n    Serial.println(\"index.html missing\");\n    return;\n  }\n\n  // Route for serving files from SD card\n  server.onNotFound([](AsyncWebServerRequest *request){\n    String path = request-\u003eurl();\n\n    // Check if SD card is still connected\n    if (!SD.begin(SD_CS)) {\n      request-\u003esend(503, \"text/html\", \"\u003chtml\u003e\u003cbody\u003e\u003ch1\u003eSD card not connected\u003c/h1\u003e\u003c/body\u003e\u003c/html\u003e\");\n      return;\n    }\n\n    // Serve index.html by default if path ends with '/'\n    if(path.endsWith(\"/\")) path += \"index.html\";\n\n    String contentType = \"text/plain\";\n    if(path.endsWith(\".html\")) contentType = \"text/html\";\n    else if(path.endsWith(\".css\")) contentType = \"text/css\";\n    else if(path.endsWith(\".js\")) contentType = \"application/javascript\";\n\n    File file = SD.open(path.c_str());\n    if(file){\n      request-\u003esend(SD, path.c_str(), contentType);\n      file.close();\n    } else {\n      request-\u003esend(404, \"text/html\", \"\u003chtml\u003e\u003cbody\u003e\u003ch1\u003eFile not found\u003c/h1\u003e\u003c/body\u003e\u003c/html\u003e\");\n    }\n  });\n\n  // Start server\n  server.begin();\n}\n\nvoid loop() {\n  // Nothing to do here\n}\n\n```\n\u003cp float=\"left\"\u003e\n  \u003cimg src=\"img/SD web (1).jpg\" width=\"45%\" /\u003e\n  \u003cimg src=\"img/SD web (2).jpg\" width=\"45%\" /\u003e\n\u003c/p\u003e\n\nto make it portable using lithium ion batteries - and connect it with 5 voltage ⚡ pin in is ESP32 , BECAUSE IN THE SD CARD MODULE THERE WAS A VOLTAGE IC . otherwise you can supply 3 voltage from ESP32\n\n\n\u003cp float=\"left\"\u003e\n  \u003cimg src=\"img/sd.jpg\" width=\"100%\" /\u003e\n\u003c/p\u003e \n\n\u003cimg src=\"https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif\"\u003e\n\n\n\u003cdiv style=\"display: flex; align-items: center; gap: 10px;\" align=\"center\"\u003e\n\n---\n\n## ⭐ [NAS-with-ESP32](https://github.com/akashdip2001/NAS-with-ESP32) ⭐\n\n---\n\n\u003c/br\u003e\n\u003c/br\u003e\n\n[![NAS System](https://github.com/user-attachments/assets/45ffbb73-7364-4d2a-aaf8-0b6f8698d352)](https://github.com/akashdip2001/NAS-with-ESP32)\n\n\u003c/div\u003e\n\n\u003cimg src=\"https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif\"\u003e\n\n# LAN =\u003e WAN (Port Forward)\n\nIf you don't have a 🌐 router and want to port forward directly through a mobile hotspot on your Windows PC, the process is more complex because most mobile carriers do not support port forwarding due to the way mobile networks handle IP addresses and NAT (Network Address Translation). However, there are workarounds that might help you achieve similar results.\n\n### Using a VPN with Port Forwarding\n\n1. Find a VPN Service that Supports Port Forwarding:\n   - Some VPN services offer port forwarding as part of their features. Examples include PureVPN, Private Internet Access (PIA), and AirVPN.\n\n2. Sign Up and Install the VPN:\n   - Sign up for the VPN service.\n   - Download and install the VPN client on your Windows PC.\n\n3. Configure Port Forwarding in the VPN:\n   - Follow the VPN provider’s instructions to set up port forwarding. This usually involves logging into your VPN account, selecting a port to forward, and configuring the VPN client.\n\n4. Connect to the VPN:\n   - Use the VPN client to connect to a server that supports port forwarding.\n   - Note the external IP address provided by the VPN.\n\n5. Adjust Windows Firewall Settings:\n   - Ensure the Windows firewall allows traffic through the forwarded port:\n     - Open Control Panel.\n     - Go to System and Security \u003e Windows Defender Firewall \u003e Advanced Settings.\n     - Click on Inbound Rules, then New Rule.\n     - Choose Port, then Next.\n     - Select TCP, enter the port number, and click Next.\n     - Allow the connection, then click Next.\n     - Choose when to apply this rule (Domain, Private, Public), then click Next.\n     - Give the rule a name and click Finish.\n\n6. Test the Connection:\n   - Use a tool like [CanYouSeeMe](http://canyouseeme.org) to verify that the port is open and accessible.\n\n### 🌐 Using a Remote Server as a Proxy\n\nAnother approach is to use a remote server to act as a proxy for your local device. This involves setting up a server (such as a VPS) that forwards traffic to your local device.\n\n1. Set Up a VPS:\n   - Sign up for a VPS (Virtual Private Server) with a provider like DigitalOcean, AWS, or Linode.\n\n2. Configure SSH Tunneling:\n   - Use SSH tunneling to forward traffic from the VPS to your local device.\n   - Open Command Prompt on your Windows PC.\n   - Use an SSH client like OpenSSH or PuTTY to create a tunnel. For example:\n    \n     ```\n     ssh -R [VPS_PORT]:localhost:[LOCAL_PORT] [VPS_USER]@[VPS_IP]\n     ```\n     \n     Replace [VPS_PORT] with the port you want to forward on the VPS, [LOCAL_PORT] with the local port your NodeMCU service is using, [VPS_USER] with your VPS username, and [VPS_IP] with your VPS IP address.\n\n3. Access Your Service:\n   - Access your service using the VPS IP and forwarded port.\n\n### 🌐 Using Ngrok\n\nNgrok is a tool that creates secure tunnels to your localhost, making it accessible over the internet.\n\n1. Install Ngrok:\n   - Download and install Ngrok from [ngrok.com](https://ngrok.com).\n\n2. Set Up Ngrok:\n   - Open Command Prompt.\n   - Run the following command to create a tunnel to your local port:\n    \n     ```\n     ngrok http [LOCAL_PORT]\n     ```\n     \n     Replace [LOCAL_PORT] with the port your NodeMCU service is using.\n\n3. Access Your Service:\n   - Ngrok will provide a public URL that you can use to access your local service.\n\nBy using one of these methods, you can achieve port forwarding or similar functionality without needing a traditional router.\n\nNgrok is too costly, you can consider some free alternatives that offer similar tunneling services. Here are a few options:\n\n### 🌐 LocalTunnel\n\nLocalTunnel provides a simple way to expose a local server to the internet. It’s free and easy to set up.\n\n1. Install LocalTunnel:\n   - Open Command Prompt.\n   - Install LocalTunnel using npm (you need Node.js installed):\n  \n    ```sh\n     npm install -g localtunnel\n    ```\n    \n2. Start LocalTunnel:\n   - Run the following command to create a tunnel:\n     \n     ```sh\n     lt --port [LOCAL_PORT]\n     ```\n     \n     Replace [LOCAL_PORT] with the port your NodeMCU service is using.\n\n4. Access Your Service:\n   - LocalTunnel will provide a public URL that you can use to access your local service.\n\n### 🌐 Serveo\n\nServeo is a free SSH-based tunneling service.\n\n1. Set Up Serveo:\n   - Open Command Prompt.\n   - Run the following command:\n    \n     ```sh\n     ssh -R 80:localhost:[LOCAL_PORT] serveo.net\n     ```\n     \n     Replace [LOCAL_PORT] with the port your NodeMCU service is using.\n\n2. Access Your Service:\n   - Serveo will provide a public URL that you can use to access your local service.\n\n### 🌐 Telebit\n\nTelebit is another free service for exposing your local server to the internet.\n\n1. Install Telebit:\n   - Open Command Prompt.\n   - Install Telebit using npm (you need Node.js installed):\n    \n     ```sh\n     npm install -g telebit\n     ```\n     \n2. Configure Telebit:\n   - Run the following command to configure Telebit:\n    \n     ```sh\n     telebit init\n     ```\n     \n   - Follow the prompts to set up your Telebit account and configuration.\n\n3. Start Telebit:\n   - Run the following command to start the tunnel:\n    \n     ```sh\n     telebit http [LOCAL_PORT]\n     ```\n     \n     Replace [LOCAL_PORT] with the port your NodeMCU service is using.\n\n4. Access Your Service:\n   - Telebit will provide a public URL that you can use to access your local service.\n\nThese alternatives provide free options to expose your local services to the internet, similar to Ngrok but without the cost.\n\n\u003cimg src=\"https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif\"\u003e\n\n# Diractly connect your SD-card to internet 🛜 using 4G LTE GSM (SIM800L)\n\n\u003cp float=\"left\"\u003e\n  \u003cimg src=\"img/4G LTE (1).jpg\" width=\"45%\" /\u003e\n  \u003cimg src=\"img/4G LTE (2).jpg\" width=\"45%\" /\u003e\n\u003c/p\u003e\n\nTo connect your ESP32 to the internet using the SIM800L module and make your website accessible globally, you'll need to configure the ESP32 to communicate with the SIM800L and establish a GPRS connection. Below is an outline of the steps and the modified code to achieve this.\n\n### Requirements:\n\n  - ESP32 board.\n  - SIM800L module with a valid SIM card and data plan.\n  - Connection wires and power supply for the SIM800L module.\n\n### Wiring:\n\n  - SIM800L -\u003e ESP32VCC -\u003e 3.7V (ensure proper voltage for SIM800L)\n  - GND -\u003e GND\n  - TXD -\u003e RX (GPIO 16)\n  - RXD -\u003e TX (GPIO 17)\n\n# Power supply =\u003e SIM 800L =\u003e 4.2 v\n\n### Components Needed\n   - ( R1 ) = 1.6kΩ resistor\n   - ( R2 ) = 8.4kΩ resistor\n   \n### Circuit Diagram\n\n```cpp\n   5V\n    |\n   [R1]\n    |\n   Vout (4.2V)\n    |\n   [R2]\n    |\n   GND\n```\n\n# or\n\n### Components Needed\n\n   - ( R1 ) = 1.5kΩ resistor\n   - ( R2 ) = 8.2kΩ resistor\n   \n### Circuit Diagram\n\n```cpp\n   5V\n    |\n   [R1] (1.5kΩ)\n    |\n   Vout (4.225V)\n    |\n   [R2] (8.2kΩ)\n    |\n  GND\n```\n\n\u003cp float=\"left\"\u003e\n  \u003cimg src=\"img/sim800l_5.jpg\" width=\"100%\" /\u003e\n\u003c/p\u003e\n\n### Code:\n\n```cpp\n#include \u003cWiFi.h\u003e\n#include \u003cSPI.h\u003e\n#include \u003cSD.h\u003e\n#include \u003cESPAsyncWebServer.h\u003e\n\n// Pin Definitions for SD Card\n#define SD_CS    5\n#define SD_SCK   18\n#define SD_MOSI  23\n#define SD_MISO  19\n\n// SIM800L configuration\n#define SIM800L_RX 16\n#define SIM800L_TX 17\n\n// Uncomment the appropriate settings for your SIM card\n// Jio\nconst char* apn = \"jionet\";\nconst char* gprsUser = \"\";\nconst char* gprsPass = \"\";\n\n// Vi (Vodafone Idea)\n //const char* apn = \"vi.internet\";\n //const char* gprsUser = \"\";\n //const char* gprsPass = \"\";\n\n// Airtel\n// const char* apn = \"airtelgprs.com\";\n// const char* gprsUser = \"\";\n// const char* gprsPass = \"\";\n\n// BSNL\n//const char* apn = \"bsnlnet\";\n//const char* gprsUser = \"\";\n//const char* gprsPass = \"\";\n\nHardwareSerial sim800l(1); // Use UART1 for SIM800L\nAsyncWebServer server(80);\n\nvoid setup() {\n  Serial.begin(115200);\n  sim800l.begin(9600, SERIAL_8N1, SIM800L_RX, SIM800L_TX);\n  \n  // Initialize SD card\n  if (!SD.begin(SD_CS)) {\n    Serial.println(\"Card Mount Failed\");\n    return;\n  }\n  \n  // Check if index.html exists\n  if (!SD.exists(\"/index.html\")) {\n    Serial.println(\"index.html missing\");\n    return;\n  }\n\n  // Connect to GPRS\n  if (connectToGPRS()) {\n    Serial.println(\"GPRS connected\");\n    Serial.print(\"IP address: \");\n    Serial.println(WiFi.localIP());\n  } else {\n    Serial.println(\"GPRS connection failed\");\n    return;\n  }\n\n  // Route for serving files from SD card\n  server.onNotFound([](AsyncWebServerRequest *request){\n    String path = request-\u003eurl();\n\n    // Check if SD card is still connected\n    if (!SD.begin(SD_CS)) {\n      request-\u003esend(503, \"text/html\", \"\u003chtml\u003e\u003cbody\u003e\u003ch1\u003eSD card not connected\u003c/h1\u003e\u003c/body\u003e\u003c/html\u003e\");\n      return;\n    }\n\n    // Serve index.html by default if path ends with '/'\n    if(path.endsWith(\"/\")) path += \"index.html\";\n\n    String contentType = \"text/plain\";\n    if(path.endsWith(\".html\")) contentType = \"text/html\";\n    else if(path.endsWith(\".css\")) contentType = \"text/css\";\n    else if(path.endsWith(\".js\")) contentType = \"application/javascript\";\n\n    File file = SD.open(path.c_str());\n    if(file){\n      request-\u003esend(SD, path.c_str(), contentType);\n      file.close();\n    } else {\n      request-\u003esend(404, \"text/html\", \"\u003chtml\u003e\u003cbody\u003e\u003ch1\u003eFile not found\u003c/h1\u003e\u003c/body\u003e\u003c/html\u003e\");\n    }\n  });\n\n  // Start server\n  server.begin();\n}\n\nvoid loop() {\n  // Nothing to do here\n}\n\nbool connectToGPRS() {\n  delay(3000); // Wait for SIM800L to initialize\n  sim800l.println(\"AT\");\n  delay(100);\n  if (sim800l.find(\"OK\")) {\n    Serial.println(\"Module is ready\");\n  } else {\n    Serial.println(\"Module is not responding\");\n    return false;\n  }\n\n  sim800l.println(\"AT+CSQ\"); // Signal quality\n  delay(500);\n  if (sim800l.find(\"OK\")) {\n    Serial.println(\"Signal quality checked\");\n  }\n\n  sim800l.println(\"AT+CGATT?\"); // Attach to GPRS\n  delay(500);\n  if (sim800l.find(\"OK\")) {\n    Serial.println(\"Attached to GPRS\");\n  }\n\n  sim800l.print(\"AT+CSTT=\\\"\");\n  sim800l.print(apn);\n  sim800l.print(\"\\\",\\\"\");\n  sim800l.print(gprsUser);\n  sim800l.print(\"\\\",\\\"\");\n  sim800l.print(gprsPass);\n  sim800l.println(\"\\\"\");\n  delay(500);\n  if (sim800l.find(\"OK\")) {\n    Serial.println(\"APN set\");\n  }\n\n  sim800l.println(\"AT+CIICR\"); // Bring up wireless connection\n  delay(3000);\n  if (sim800l.find(\"OK\")) {\n    Serial.println(\"Wireless connection brought up\");\n  } else {\n    Serial.println(\"Failed to bring up wireless connection\");\n    return false;\n  }\n\n  sim800l.println(\"AT+CIFSR\"); // Get IP address\n  delay(1000);\n  String ip;\n  if (sim800l.find(\"OK\")) {\n    ip = sim800l.readString();\n    Serial.print(\"IP address: \");\n    Serial.println(ip);\n    WiFi.config(IPAddressFromString(ip));\n    return true;\n  } else {\n    Serial.println(\"Failed to get IP address\");\n    return false;\n  }\n}\n\nIPAddress IPAddressFromString(String ipStr) {\n  int parts[4];\n  sscanf(ipStr.c_str(), \"%d.%d.%d.%d\", \u0026parts[0], \u0026parts[1], \u0026parts[2], \u0026parts[3]);\n  return IPAddress(parts[0], parts[1], parts[2], parts[3]);\n}\n```\n\n### ESP32 -\u003e SD Card Module\n\n   - 3.3V -\u003e VCC ,if voltage ⚡ ic present=\u003e use 5 volt\n   - GND -\u003e GND\n   - GPIO 5 -\u003e CS\n   - GPIO 18 -\u003e SCK\n   - GPIO 23 -\u003e MOSI\n   - GPIO 19 -\u003e MISO\n   \n### ESP32 -\u003e SIM800L Module\n\n   - 3.7V -\u003e VCC\n   - GND -\u003e GND\n   - GPIO 16 -\u003e TXD\n   - GPIO 17 -\u003e RXD\n\n\n\u003cp float=\"left\"\u003e\n  \u003cimg src=\"img/sim800l.jpg\" width=\"49%\" /\u003e\n  \u003cimg src=\"img/sim800l_2.jpg\" width=\"49%\" /\u003e\n\u003c/p\u003e\n\n\n\u003cp float=\"left\"\u003e\n  \u003cimg src=\"img/sim800l_3.jpg\" width=\"49%\" /\u003e\n  \u003cimg src=\"img/sim800l_4.jpg\" width=\"49%\" /\u003e\n\u003c/p\u003e\n\n# NB :  JIO NOT WORKING WITH SIM-800L : Jio only works on 4G LTE network 🛜 and SIM800L works on 2G GSM/GPRS network 🛜 wait for Complete video 📷 \n\n\u003cp float=\"left\"\u003e\n  \u003cimg src=\"img/sim800l_6.jpg\" width=\"100%\" /\u003e\n\u003c/p\u003e\n\nthe LAN server is working good you can try the code [video](https://youtu.be/ySJt3QGyr9w) , BUT USING THE SIM-800L MODULE - YOU NEED A STABLE AND GOOD 2G GSM INTERNET CONNECTION otherwise your website is very difficult to load through internet. MAYBE IN FUTURE I OPTIMISE THE CODE.\n\n\u003cp float=\"left\"\u003e\n  \u003cimg src=\"img/GHL.jpg\" width=\"100%\" /\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakashdip2001%2Fesp32-host-html-website","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakashdip2001%2Fesp32-host-html-website","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakashdip2001%2Fesp32-host-html-website/lists"}