Add LED web UI with AP, Wi-Fi client, mDNS and patterns
Brings the led_strip example into the cpp app, targeting the ESP32-C3: - Access point led-XXXXXX (open) plus a Wi-Fi client configured from the web Settings tab, with credentials stored in NVS and reconnect backoff - mDNS as led.local with an HTTP service on port 80 - HTTP server with an embedded web UI and a JSON API for patterns and Wi-Fi - Pattern runner for solid, rainbow, chase, breathe, blink, pulse, transition and circle on a 119-LED WS2812 strip (GPIO 10) Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
df43820acd
commit
89f996096c
20 files changed
+1539
-18
No files matched your search
@@ -0,0 +1,64 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>LED strip</title>
|
||||
<link rel="stylesheet" href="/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>LED strip</h1>
|
||||
<nav>
|
||||
<button class="tab active" data-tab="patterns">Patterns</button>
|
||||
<button class="tab" data-tab="settings">Settings</button>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<section id="patterns">
|
||||
<label>Pattern
|
||||
<select id="mode"></select>
|
||||
</label>
|
||||
<div class="row">
|
||||
<label>Colour
|
||||
<input type="color" id="c1" value="#ff0000">
|
||||
</label>
|
||||
<label>Colour 2
|
||||
<input type="color" id="c2" value="#000000">
|
||||
</label>
|
||||
</div>
|
||||
<label>Speed <output id="speedOut"></output>
|
||||
<input type="range" id="speed" min="10" max="3000" step="10">
|
||||
</label>
|
||||
<label>Brightness <output id="brightOut"></output>
|
||||
<input type="range" id="bright" min="0" max="255" step="1">
|
||||
</label>
|
||||
<p id="status" class="muted" role="status"></p>
|
||||
</section>
|
||||
|
||||
<section id="settings" hidden>
|
||||
<h2>Access point</h2>
|
||||
<p>Network <strong id="apName">…</strong> (open). Address <strong>192.168.4.1</strong>.</p>
|
||||
|
||||
<h2>Wi-Fi client</h2>
|
||||
<p>Status: <span id="staState">…</span></p>
|
||||
<button id="scan" type="button">Scan for networks</button>
|
||||
<ul id="networks" class="list"></ul>
|
||||
|
||||
<form id="wifiForm">
|
||||
<label>Network name (SSID)
|
||||
<input id="ssid" required maxlength="32" autocomplete="off">
|
||||
</label>
|
||||
<label>Password <span class="muted">(blank for open networks)</span>
|
||||
<input id="pass" type="password" maxlength="64" autocomplete="off">
|
||||
</label>
|
||||
<button type="submit">Save and connect</button>
|
||||
</form>
|
||||
<p id="wifiMsg" class="muted" role="status"></p>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<script src="/app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user