readme.md

Markdown · 64 lines

## Overview

This project creates an **open Wi-Fi AP** using the XIAO ESP32S3 and provides a web interface that allows users to turn the onboard LED **ON** or **OFF**.  
The interface automatically opens due to captive portal DNS routing and shows the LED state **live** via a `/state` JSON endpoint.

Features:
- Open Wi-Fi AP with captive portal auto-redirect
- Web UI for turning LED ON/OFF
- Live LED state indicator using AJAX polling
- Minimal network traffic for responsive updates
- Fully contained in a single `.ino` sketch

---

## Hardware

- **Board:** Seeed Studio XIAO ESP32S3  
- **Onboard LED:** GPIO 21, active LOW  

No other components are needed.

---


## Wi-Fi Access Pointt

SSID: XIAO-AP-WEBLED
Password: (none)
Address: 192.168.4.1

All DNS queries are mapped to ESP32 → **captive portal behavior**.

---

## Web Interface

The interface provides:

- Current LED state (live)
- ON button
- OFF button

JavaScript polls the `/state` endpoint every 500 ms:

```json
{ "led": "OFF" }When a button is clicked, the browser sends:

/on
/off
```

The LED updates instantly.

How to Use

Upload the sketch.

Connect to AP: XIAO-AP-WEBLED.

The browser should open the controller page automatically.

Click Turn LED ON / Turn LED OFF.

Watch the live indicator update instantly.