# Lite User Guide

## Hardware

[Lite Unit illustration](images/lite-unit.jpg). Use the pin assignments below and your board's pinout for wiring.

The current Lite build is for the classic ESP32 DEVKIT V1 with the Unit
DMX U183. Connect ESP32 GPIO17 (TX) to the Unit RX, ESP32 GPIO16 (RX)
to the Unit TX, and connect the grounds. Power the Unit according to its
hardware specification. The Unit handles RS-485 direction automatically. The board must have at least 512 KiB nominal internal SRAM, 4 MiB
flash and native 2.4 GHz Wi-Fi that supports an access point. Lite
does not require PSRAM. The existing CoreS3SE Base DMX profile remains
experimental.

See the [Installation Guide](V0_4_0_INSTALLATION.md) for first install and
app-only updates.

## Initial connection

1. Boot normally with BOOT released. On a fresh device with healthy NVS,
   look for `ESP32-DMX-Lite-` followed by four uppercase hexadecimal
   characters. Existing devices keep their saved SSID and password.
2. The factory password is `espdmx-` followed by the last four characters
   of the factory SSID in lowercase. For `ESP32-DMX-Lite-729C`, the
   password is `espdmx-729c`. The suffix comes from the last two bytes of
   the AP MAC and may repeat across devices.
3. Join the WPA2 network and open `http://192.168.4.1/`. A phone may ask
   whether to stay connected to the network without internet access.
4. Change the factory password in **Settings → Wi-Fi Configuration**
   before operating in an untrusted environment. Use the new password
   when you reconnect. Leaving both password fields blank keeps the
   current password, including a factory password.

The factory password is publicly derivable and is not a unique secret.
Anyone nearby who derives it may gain control while it is active. On
Lite, WPA2 access grants device control. The one-station and
one-application-web-client limits prevent concurrent control, and
provide no independent authentication.

## Wi-Fi recovery

While the application is running normally, release BOOT, then hold it
continuously for ten seconds and release it. Short or interrupted holds
do nothing. The AP restarts with its factory SSID and password. Rejoin
the network, open the web app and change the password again. Recovery
preserves GPIO settings, pending pins, saved presets, aliases, live DMX
and blackout. It does not reboot the controller. Keep normal BOOT/EN
flashing procedures separate from this runtime action.

If the AP is unavailable or BOOT cannot be reached, use the
[Lite USB Wi-Fi recovery procedure](#lite-usb-wi-fi-recovery).

## GPIO configuration

Open **Settings → Device Settings** to select and stage TX/RX pins.
The active pins stay in use until a controlled Restart. **Cancel
pending pins** clears a staged change. **Reset GPIOs** stages the profile
defaults for the next controlled Restart. It preserves all other data.
For local recovery use `hw show`, `hw cancel` or `hw reset`, and stop
Wi-Fi cleanly before serial `restart`.

## Presets and Backup

Use the [Web UI](WEB_UI_USER_GUIDE.md#presets-and-names) to save, load and
rename slots. New slot names use 1–12 printable ASCII characters, including letters A–Z
and a–z, digits, spaces and punctuation. Accented letters are outside
this character set. The existing 24-byte name capacity is preserved.
Longer names already stored can appear shortened to fit the display.
CoreS3SE touchscreen COPY fills an empty slot with the source channel
values and custom name. A default source name gives the destination its
own slot name. CLEAR and Delete preserve the slot name.
**Presets → Backup → Export** downloads v2 with channel values and all
eight names, including names on empty slots. **Import** accepts both
versions. v1 preserves current names. v2 restores channel values and
names together. Neither version changes the live DMX output.

An upgrade preserves saved data when the existing flash layout and NVS
are kept. The original CoreS3SE firmware accepts v1 backups only and
cannot read a selected on-flash bank written in the current DMP2 format.
The [downgrade notes](PRESET_EXPORT_IMPORT.md#developer-v2-to-v1-conversion)
describe the developer-level v1 conversion and the conditions for safe
downgrade recovery.

## USB Serial Console and Diagnostics

Use a data-capable USB cable. CoreS3SE uses native USB Serial/JTAG CDC
and Lite uses its USB-UART bridge on UART0. Both firmware editions run
with the monitor closed or USB disconnected. Close any monitor before
uploading or opening the port in another program.

Open your board's port at **115200 baud**, with **LF**, **DTR 0** and
**RTS 0**. These settings request inactive control lines. Some devices,
adapters or drivers can still reset the board when the port opens.
For PlatformIO on Windows, replace `COM9` with the board's port.

```powershell
& "$env:USERPROFILE\.platformio\penv\Scripts\platformio.exe" device monitor --port COM9 --baud 115200 --eol LF --dtr 0 --rts 0 --filter send_on_enter
```

Type `help` and press Enter. Native input accepts Backspace or DEL.
In line-buffered monitors, editing may happen locally before the line is
sent. Enter one command at a time. Command responses are paced so DMX
servicing can continue.

| Both editions | Purpose |
|---|---|
| `help`, `status` | Show available commands, build, controller mode and driver counters. |
| `mem status`, `mem app` | Show heap, stack watermarks and available application or network checkpoints. |
| `lat status`, `lat reset` | Read and reset owner-loop measurements. Lite also reports its timing phases. |
| `wifi status`, `http status`, `nvs status` | Inspect service and storage state. Wi-Fi status includes the current SSID. |
| `set <1..512> <0..255>` | Set one live DMX channel. |
| `pattern`, `zero` | Replace the universe with a bench vector or all zeros. The vector uses 16, 32 and 48 on channels 1, 256 and 512. |
| `blackout on`, `blackout off` | Force output to zero or restore the preceding live values. |
| `preset list` | List saved and empty slots and their aliases. |
| `preset save <1..8>`, `preset load <1..8>`, `preset delete <1..8>` | Save, recall or clear a slot. |
| `preset rename <1..8> <name>` | Assign a slot name with 1–12 printable ASCII characters. Spaces within a name are accepted without quotes. |
| `restart`, `restart status` | Request the controlled restart or inspect its phase and result. |

On CoreS3SE, use Sender mode for serial preset and DMX changes. Finish
any touchscreen maintenance or Wi-Fi confirmation before changing
presets or restarting. Wi-Fi changes and reset use the existing
CoreS3SE settings. USB serial is a local maintenance interface.
Diagnostic replies omit stored Wi-Fi passwords.

### Lite USB Wi-Fi recovery

1. Enter `wifi status` and `nvs status`. If the radio or HTTP is active,
   enter `wifi stop` and wait for `wifi status` to show them off.
2. Enter `wifi provision-default <password>` for the factory-format,
   MAC-derived SSID with a password you choose. `wifi provision <suffix> <password>`
   keeps the older provisioning syntax for custom suffixes. The
   console omits the password from its reply. A serial monitor may
   display the text entered locally.
3. Enter `wifi start`, check `wifi status` and reconnect. `wifi stop`
   applies to the current boot. Use `wifi forget` only to remove the
   saved Wi-Fi record. The next normal boot recreates factory credentials
   when the record is absent. A present but invalid record needs local
   recovery. Use `chip` to inspect the Lite board profile and flash.

### Lite USB GPIO recovery

1. Enter `hw show` to inspect active pins, pending pins and status.
2. Enter `hw validate <tx> <rx> -1 1 auto` to check the proposed pins.
   Enter `hw save <tx> <rx> -1 1 auto` to stage them. The profile uses
   UART1 and Unit automatic direction with no enable GPIO.
3. Enter `hw cancel` to discard a staged change or `hw reset` to stage
   the default GPIO17 TX and GPIO16 RX. The active pins continue in use.
4. To apply a staged change, enter `wifi stop`, verify Wi-Fi and HTTP are off
   with `wifi status`, then enter `restart`. After boot, check `hw show`
   for the active pins. Use `restart status` if the request fails.

### Troubleshooting

If a command gives no reply, check the selected COM port, cable, port
ownership and line endings. Send `help` after the controller starts.
If the board resets on connection, wait for normal boot and check the
port and DTR/RTS options again. A busy or rejected command can report
an active maintenance request or a failed transport. Check `status`,
`restart status` and the relevant service report before retrying.

On the tested ESP32 DEVKIT V1, the first monitor connection after physically
unplugging and reconnecting USB can be silent. Leave the monitor open,
press **EN/RESET**, and wait for normal boot. Later connections work while
USB remains attached. A reset interrupts live output and clears runtime
counters. The cause of the behavior is unverified.

For factory images, updates and the full partition layout, use the
[v0.4.0 installation guide](V0_4_0_INSTALLATION.md).
