Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,11 @@ MoonLight periodically merges upstream ESP32-sveltekit changes. To keep merges c
**Memory** — On S3/P4 with PSRAM, `operator new` is overridden in `main.cpp` to prefer PSRAM for allocations above a threshold. On ESP32-D0 (no PSRAM), heap is very tight; watch flash usage too (target <3MB firmware).

**Logging** — Use `EXT_LOGD` / `EXT_LOGI` / `EXT_LOGW` / `EXT_LOGE` (not `Serial.printf` directly in module/node code). Tag constants: `ML_TAG` (MoonLight), `MB_TAG` (MoonBase).

## Additional Reference Documents

Supplementary guidance for AI assistants lives in `/misc/instructions/`:

- **`MoonLight.md`** — project philosophy, architectural goals, future roadmap, and broader context not covered above.
- **`GEMINI.md`** — structural overview of the upstream [ESP32-sveltekit](https://github.com/theelims/ESP32-sveltekit) repo (services, file layout, key dependencies). Useful when touching upstream-derived code.
- **`svelte.instructions.md`** — Svelte 5 development guidelines. Applies **only** to moonbase-specific frontend files (`src/routes/moonbase/`, `src/lib/components/moonbase/`, `moonbase_utilities.ts`, `moonbase_models.ts`). Do not apply runes patterns or reformatting to upstream files.
2 changes: 1 addition & 1 deletion docs/gettingstarted/installer.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Use the MoonLight Installer instead for these devices.

### ESPConnect

Use ESPConnect to install unreleased firmware (for example, versions shared via [Discord](https://discord.gg/TC8NSUSCdV) or [GitHub issues](https://github.com/MoonModules/MoonLight/issues)).
Use ESPConnect to install unreleased firmware (for example, versions shared via [Discord](https://discord.gg/TC8NSUSCdV) or [GitHub issues](../moonlight/overview.md#reporting-issues)).
Published [releases](https://github.com/MoonModules/MoonLight/releases) can also be installed this way.

Launch [ESPConnect](https://thelastoutpostworkshop.github.io/microcontroller_devkit/espconnect).
Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Start creating stunning effects immediately on both mobile and desktop.
### Version 0.9.0 - March 2026
**FastLED Channels API, FastLED Audio, sensors and palettes**

See [v0.9.0 Kanban board](https://github.com/users/MoonModules/projects/4) or log an [Issue](https://github.com/MoonModules/MoonLight/issues/new/choose) to report issues or request enhancements.
See [v0.9.0 Kanban board](https://github.com/users/MoonModules/projects/4) or log an [Issue](moonlight/overview.md#reporting-issues) to report issues or request enhancements.

---

Expand All @@ -180,7 +180,7 @@ MoonLight is built on **MoonBase** and ESP32-Sveltekit, our complete IoT framewo

- 💬 **[Discord Community](https://discord.gg/TC8NSUSCdV)** - Real-time support & project sharing
- 🗨️ **[Reddit](https://reddit.com/r/moonmodules)** - Discussion and showcase
- 📋 **[GitHub Issues](https://github.com/MoonModules/MoonLight/issues)** - Bug reports and feature requests
- 📋 **[GitHub Issues](moonlight/overview.md#reporting-issues)** - Bug reports and feature requests
- 📚 **[Documentation](https://moonmodules.org/MoonLight/)** - Complete technical guides

### Contributing
Expand Down
Binary file added docs/media/moonlight/effects/E_Ball2D.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/media/moonlight/effects/E_Cosmic3D.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/media/moonlight/effects/E_Geq2D.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/media/moonlight/effects/E_Hello1D.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/media/moonlight/effects/E_Noise2D.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/media/moonlight/effects/E_Noise3D.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/media/moonlight/effects/E_Orbit2D.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/media/moonlight/effects/E_Oscillate2D.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/media/moonlight/effects/E_Random1D.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/media/moonlight/effects/E_Sweep2D.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/media/moonlight/effects/E_Vu1D.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
138 changes: 120 additions & 18 deletions docs/moonbase/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,133 @@

<img width="170" src="https://github.com/user-attachments/assets/87ed3c78-7a4e-4331-b453-47762cce64fa" />

* [File Manager](https://moonmodules.org/MoonLight/moonbase/filemanager/)
* [Devices](https://moonmodules.org/MoonLight/moonbase/devices/)
* [Tasks](https://moonmodules.org/MoonLight/moonbase/tasks/)
* [IO](https://moonmodules.org/MoonLight/moonbase/inputoutput/)
MoonBase is the IoT foundation that MoonLight is built on. It runs independently of lights — you can use MoonBase on its own to build custom ESP32 applications with WiFi, MQTT, OTA, file management, task monitoring, and hardware I/O, all with a reactive SvelteKit web interface.

---

## What's inside MoonBase

| Module | What it does |
|---|---|
| [File Manager](https://moonmodules.org/MoonLight/moonbase/filemanager/) | Browse, create, edit, upload and download files on the device filesystem |
| [Devices](https://moonmodules.org/MoonLight/moonbase/devices/) | Discover and control MoonLight and WLED devices on your local network |
| [Tasks](https://moonmodules.org/MoonLight/moonbase/tasks/) | Live view of FreeRTOS tasks — CPU usage, state, stack, priority |
| [IO](https://moonmodules.org/MoonLight/moonbase/inputoutput/) | Board presets, pin assignment, power budget, ethernet, I2C peripherals |

---

## File Manager

The File Manager gives you direct access to the ESP32's LittleFS filesystem through the browser. You can:

- Navigate folders and create new files or directories
- Edit text files (`.json`, `.sc`, live scripts) directly in the browser
- Upload files from your computer (e.g. live script `.sc` files)
- Toggle visibility of hidden files (names starting with `.`)

Live scripts live in `/livescripts/` on the device. The File Manager is the easiest way to deploy or edit them without rebuilding firmware.

---

## Devices

The Devices module discovers all MoonLight and WLED devices on your local network using mDNS and the SuperSync broadcast protocol.

For each device you can see:

| Column | Description |
|---|---|
| **Name** | Device hostname — click to open its web UI via mDNS |
| **Lights On** | Toggle the device on/off |
| **Brightness** | Adjust brightness |
| **Palette** | Active palette |
| **Preset** | Active preset |
| **Last Sync** | How long ago a heartbeat was received (MoonLight: every 10 s; WLED: every 30 s) |
| **IP** | Click to open the device UI by IP address |
| **Version** | Firmware version |
| **Build** | Firmware build date |
| **Uptime** | Time since last boot |

### SuperSync

MoonLight devices broadcast their state every 10 seconds (and on every control change). The Devices module listens for these broadcasts and updates the table in real time.

Devices can be **grouped by hostname** using hyphens — for example `studio-left-1` and `studio-left-2` belong to the same group. When a grouped device receives a control update, it forwards the change to other devices in its group, keeping them in sync without manual coordination.

Distributed effects and synchronised clocks are planned for a future release.

---

## Tasks

The Tasks module shows a live snapshot of all FreeRTOS tasks running on the device — useful for diagnosing performance issues or runaway CPU usage.

| Column | Description |
|---|---|
| **Core** | Which core the task is pinned to (Core 0 or Core 1) |
| **Name** | Task name |
| **State** | 🧍 Ready · 🏃 Running · 🚧 Blocked · ⏸️ Suspended · 🗑️ Deleted |
| **CPU** | Percentage of CPU time consumed (per core) |
| **Priority** | FreeRTOS task priority |
| **Stack left** | Remaining stack space in bytes |
| **Runtime** | Total CPU cycles consumed |

MoonLight's three main tasks:

| Task | Core | Role |
|---|---|---|
| **AppEffects** | Core 0 | Runs effect nodes, writes `virtualChannels` |
| **AppDrivers** | Core 1 | Reads `channelsD`, sends data to LEDs/ArtNet/DMX |
| **Sveltekit** | Core 1 | HTTP server, WebSocket, module `loop()` |

---

## IO

The IO module defines the hardware identity of your ESP32 — which board it is, what each pin does, and how much power the LED driver is allowed to consume. All other nodes (LED drivers, audio, ethernet, I2C) read their pin assignments from here.

### Board Presets

Select your board from the dropdown and all pins, power budget, ethernet type, and switches are configured automatically. Currently supported boards include QuinLED (Dig-2-Go, Dig-Next-2, Dig-Uno, Dig-Quad, Dig-Octa), SE16, LightCrafter16, MHC P4 Nano Shield, Olimex ESP32-POE, Atom S3R, and more.

If your board is not listed, select the default preset and assign pins manually — the **modded** flag is set automatically so future preset changes won't overwrite your configuration.

### Pin Types

| Category | Pin types |
|---|---|
| **LED outputs** | LED data (WS2812B / SK6812), CW/WW PWM, R/G/B PWM |
| **Audio (I2S)** | SD, WS, SCK, MCLK — supports INMP441 (standard I2S) and PDM microphones |
| **I2C** | SDA, SCL — auto-scans for peripherals when both are assigned |
| **Buttons & relays** | Push button, toggle switch, LightOn button/relay |
| **Energy monitoring** | Voltage, current, battery ADC inputs |
| **Ethernet** | RMII data pins, SPI (W5500), MDC/MDIO, clock, power |
| **Communication** | Infrared receiver, RS-485 TX/RX/DE, UART serial |
| **Sensors** | PIR motion sensor |

See [IO Module](https://moonmodules.org/MoonLight/moonbase/inputoutput/) for the full pin reference, ethernet type selection, board-specific wiring notes, and I2C peripheral scanning.

---

## Status Bar

<img width="306" src="https://github.com/user-attachments/assets/5568bcdf-8d12-430e-9801-3c851f4204b5" />
<img width="362" src="https://github.com/user-attachments/assets/2379c5c4-0b85-4810-aac3-d4e6c650a12b" />

* **Safe Mode**: MoonBase will jump into safe mode after a crash, see 🛡️ in the statusbar or [System Status](https://moonmodules.org/MoonLight/system/status/). In safe mode, MoonLight will disable the following features:
* Add more then 1024 lights
* Start LED drivers
* Execute a live script

Clicking on the 🛡️ icon allows you to restart. If the reason for crash has dissappeared the device will start normally (not in safe mode).

* **Restart needed**: e.g. when drivers are changed, a restart might be needed, see 🔄 in the statusbar. Clicking on the 🔄 icon allows you to restart
The status bar at the top of every page shows live device state at a glance:

* **Save** and **Cancel**: When there are unsaved changes, a Save button 💾 and a Cancel button ↻ appear. Save applies your changes permanently. Cancel discards the changes and restores the last saved state.
| Icon | Meaning |
|---|---|
| 🛡️ | **Safe mode** — device crashed and restarted with reduced functionality. Click to restart. Once the crash cause is gone, the device boots normally. In safe mode: no layouts > 1024 lights, no LED drivers, no live scripts. |
| 🔄 | **Restart needed** — a change (e.g. new driver) requires a reboot to take effect. Click to restart. |
| 💾 / ↻ | **Save / Cancel** — unsaved changes are pending. Save applies them permanently; Cancel discards and restores the last saved state. |
| ☀️ / 🌙 | **Theme toggle** — switch between Light, Dark, and Auto. |
| ⚡️ | **Energy** — charging voltage and current (only on boards with energy monitoring, e.g. SE16). |
| 🔔 | **New firmware** — a newer firmware version is available for download. |
| 📶 | **WiFi** — connection status (see [ESP32-SvelteKit](https://github.com/theelims/ESP32-sveltekit)). |

* **Theme**: Light, Dark, Auto
---

* **Energy**: Show charging status (voltage and current), only enabled at some boards (e.g. SE16)
## Reporting Issues

* **New firmware**: New firmware available.

* **Wifi**: See ESP32-Sveltekit
Found a bug or want to request a feature? See the [reporting issues guide](../moonlight/overview.md#reporting-issues) for guidelines on writing a good bug report, including how to attach the module API output.
6 changes: 3 additions & 3 deletions docs/moonlight/drivers.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ Sends pixel data over the network to LED controllers and DMX fixtures. Supports
* **FPS Limiter**: Maximum frames per second sent. Art-Net spec recommends ~44 FPS; higher rates (up to ~130 FPS tested) work with most controllers.
* **Universe size**: Channels per universe (max 512). Match the setting on your controller.
* **Used channels** *(read-only)*: Channels actually used per universe after rounding down to a whole number of lights (e.g. 510 for RGB at 512-channel universes). Always at least one light's worth of channels — if **Universe size** is set smaller than the channels per light, one full light is still included per universe.
* **#Outputs per IP**: Number of physical outputs per controller. When all outputs for one IP are filled, sending continues on the next IP.
* **Universes per output**: How many universes each output handles, determining the maximum lights per output.
* **#Outputs per IP**: Number of physical outputs per controller. When all outputs for one IP are filled, sending continues on the next IP. E.g. the Club Lights 12 Pro Artnet Controller (see below) has 12 outputs.
* **Universes per output**: How many universes each output handles, determining the maximum lights per output. (check total universes)
* **Total universes** *(read-only)*: Universes required to transmit all lights.
* **Channels per output**: Channel budget per output.
* **Channels per output**: Channel budget per output. Make sure it matches the number of lights per output (check total channels)
* **Total channels** *(read-only)*: Total channels sent across all outputs and IPs.

!!! tip "Controller settings"
Expand Down
Loading
Loading