# ESP DMX Controller v0.4.0 installation

Choose the image for the board and the attached Unit or Base. CoreS3SE Base DMX
is experimental. An MCU check cannot identify which CoreS3SE transceiver you use.
Replace the example COM port with your device's port, use a data cable, and close
other serial monitors. Use official esptool 4.7.0 for standalone flashing.
Public v0.4.0 firmware downloads are Factory BINs. Verify checksums against `SHA256SUMS.txt` before writing.

```powershell
python -m pip install esptool==4.7.0
Get-FileHash .\ESP-DMX-Controller-Lite-ESP32-4MB-Unit-v0.4.0-factory.bin -Algorithm SHA256
```

## First installation or clean reinstall

**Factory installation erases saved presets, Wi-Fi credentials and device
settings, even if you skip the separate erase command.** Export a preset Backup first if the current firmware supports it.
Record hardware and Wi-Fi settings separately. Use this path for blank hardware,
an incompatible layout, or an intentionally clean reinstall. Run one pair of
commands for the board you have.

Lite, classic ESP32 with the 4 MiB layout:

```powershell
python -m esptool --chip esp32 --port COM9 --baud 460800 erase_flash
python -m esptool --chip esp32 --port COM9 --baud 460800 write_flash --flash_mode keep --flash_freq keep --flash_size keep 0x0 .\ESP-DMX-Controller-Lite-ESP32-4MB-Unit-v0.4.0-factory.bin
```

CoreS3SE Unit, using the 16 MiB layout. For Base, substitute
`ESP-DMX-Controller-CoreS3SE-Base-v0.4.0-factory.bin`.

```powershell
python -m esptool --chip esp32s3 --port COM8 --baud 460800 erase_flash
python -m esptool --chip esp32s3 --port COM8 --baud 460800 write_flash --flash_mode keep --flash_freq keep --flash_size keep 0x0 .\ESP-DMX-Controller-CoreS3SE-Unit-v0.4.0-factory.bin
```

Each factory file starts at `0x0` and contains the bootloader, partition table,
OTA initialization data, and app0. Fill bytes cover the NVS interval even if
you skip the explicit erase. The verified headers use DIO, 40 MHz for Lite and
80 MHz for CoreS3SE. Keep the generated header settings.

## Application-only update that retains data

Back up first. Use the application from the exact matching PlatformIO build
only for an existing compatible board, storage format and **running app0 slot**.
Verify the running slot from the boot log or deployment record. Read the installed
partition table at `0x8000` using the exact byte length of the matching build's
`partitions.bin` (3,072 bytes for the profiles below). Compare both SHA-256
hashes and stop if they differ.

```powershell
python -m esptool --chip esp32 --port COM9 --baud 460800 read_flash 0x8000 0xc00 .\lite-installed-partitions.bin
Get-FileHash .\lite-installed-partitions.bin -Algorithm SHA256
Get-FileHash .\.pio\build\esp32lite_unit\partitions.bin -Algorithm SHA256
python -m esptool --chip esp32s3 --port COM8 --baud 460800 read_flash 0x8000 0xc00 .\core-installed-partitions.bin
Get-FileHash .\core-installed-partitions.bin -Algorithm SHA256
Get-FileHash .\.pio\build\cores3se_unit\partitions.bin -Algorithm SHA256
```

Write only the matching application. Leave flash erase, the partition table,
OTA metadata and the factory file out of this procedure. For CoreS3SE Base,
use `.\.pio\build\cores3se_base\firmware.bin` at `0x10000`. Use the Base build's partition table for the hash comparison.

```powershell
python -m esptool --chip esp32 --port COM9 --baud 460800 write_flash --flash_mode keep --flash_freq keep --flash_size keep 0x30000 .\.pio\build\esp32lite_unit\firmware.bin
python -m esptool --chip esp32s3 --port COM8 --baud 460800 write_flash --flash_mode keep --flash_freq keep --flash_size keep 0x10000 .\.pio\build\cores3se_unit\firmware.bin
```

| Flash data | Lite classic ESP32 | CoreS3SE |
|---|---|---|
| Bootloader | `0x1000` | `0x0` |
| Partition table | `0x8000` | `0x8000` |
| NVS, start and size | `0x9000` / `0x17000` | `0x9000` / `0x5000` |
| OTA initialization | `0x20000` | `0xe000` |
| app0, start and capacity | `0x30000` / `0x1e0000` | `0x10000` / `0x600000` |
| app1, start and capacity | `0x210000` / `0x1e0000` | `0x610000` / `0x600000` |
| Other partitions | coredump at `0x3f0000` / `0x10000` | SPIFFS at `0xc10000` / `0x3e0000`, coredump at `0xff0000` / `0x10000` |

The tested original CoreS3SE v0.3.0 upgrade uses the verified 16 MiB app0
layout and current generation-backed preset format. An older version label alone
cannot establish compatibility. Original v0.3.0 cannot read a selected DMP2 bank
after downgrading its application. Export before downgrading and follow the
[v2-to-v1 conversion and recovery procedure](PRESET_EXPORT_IMPORT.md#developer-v2-to-v1-conversion).
The normal UI exports v2 and imports either v1 or v2.

## Install from PlatformIO

From the matching source checkout, select the correct environment. The full
PlatformIO upload writes the bootloader, table, OTA initialization and application.
It is the source-build installation path. Use the app-only procedure above for
a data-preserving update. If performing an intentionally clean reinstall, use the
matching erase command first.

PlatformIO uses bundled esptool 4.5.1 for image generation and Lite uploads.
The first CoreS3SE Unit or Base upload automatically provisions official
esptool 4.7.0 in the project workspace and requires PyPI access and Python
`venv` support. Use the same PlatformIO commands below.

```powershell
pio run -e esp32lite_unit -t upload --upload-port COM9
pio run -e cores3se_unit -t upload --upload-port COM8
pio run -e cores3se_base -t upload --upload-port COM8
```

## First boot, recovery and Restore

- Join `ESP32-DMX-Lite-XXXX` or `CoreS3SE-DMX-XXXX`. The factory password
  is `espdmx-xxxx` with the SSID suffix in lowercase. Open **http://192.168.4.1/**
  and change the predictable password before untrusted use. CoreS3SE asks for
  physical approval. Existing valid Wi-Fi settings persist on a compatible update.
- Join the board's USB serial console at 115200, LF, DTR 0, RTS 0 and enter
  `help`. The website Web Serial Monitor passed bench testing on all three
  profiles. Use the external monitor for live lighting. On Lite, hold BOOT for ten seconds during normal operation for factory
  Wi-Fi recovery, or stop and reprovision Wi-Fi over USB. Use `hw show`,
  `hw cancel` or `hw reset` to recover staged GPIO settings.
- Import a previously exported preset collection from **Presets → Backup**.
  Keep the tab active. Restore replaces the saved collection and leaves live
  DMX unchanged. Confirm loaded settings and preset names after reboot.

[Exact console and recovery commands](ESP32_LITE_USER_GUIDE.md#usb-serial-console-and-diagnostics) ·
[Backup and Restore](PRESET_EXPORT_IMPORT.md) · [Known issues](../KNOWN_ISSUES.md)

## User guides

- [CoreS3SE touchscreen and hardware](CORES3SE_USER_GUIDE.md)
- [Lite hardware and recovery](ESP32_LITE_USER_GUIDE.md)
- [Web UI for both editions](WEB_UI_USER_GUIDE.md)
