|
| 1 | +# ✨ Usermod FSEQ ✨ |
| 2 | + |
| 3 | +> **Created by: Andrej Chrcek** |
| 4 | +
|
| 5 | +Welcome to the **Usermod FSEQ** project! This innovative module empowers your WLED setup by enabling FSEQ file playback from an SD card, complete with a sleek web UI and UDP remote control. Dive into a world where creativity meets functionality and transform your lighting experience. |
| 6 | + |
| 7 | +# SWEB UI http://yourIP/sd/ui |
| 8 | + |
| 9 | +# SD & FSEQ Usermod for WLED |
| 10 | + |
| 11 | +This usermod adds support for playing FSEQ files from an SD card and provides a web interface for managing SD files and controlling FSEQ playback via HTTP and UDP. It also supports configurable SPI pin settings for SD SPI. The usermod exposes several HTTP endpoints for file management and playback control. |
| 12 | + |
| 13 | +--- |
| 14 | + |
| 15 | +## Features |
| 16 | + |
| 17 | +- **FSEQ Playback:** Play FSEQ files from an SD card. |
| 18 | +- **Web UI:** Manage SD files (list, upload, delete) and control FSEQ playback. |
| 19 | +- **UDP Synchronization:** Remote control via UDP packets. |
| 20 | +- **Configurable SPI Pins:** SPI pin assignments are configurable through WLED’s configuration JSON. |
| 21 | + |
| 22 | +--- |
| 23 | + |
| 24 | +## Installation |
| 25 | + |
| 26 | +### 1. Configure PlatformIO |
| 27 | + |
| 28 | +Add the following configuration to your `platformio_override.ini` (or `platformio.ini`) file: |
| 29 | + |
| 30 | +```ini |
| 31 | +[env:esp32dev_V4] |
| 32 | +build_flags = |
| 33 | + -D WLED_USE_SD_SPI |
| 34 | + -D USERMOD_FPP |
| 35 | + -D USERMOD_FSEQ |
| 36 | + -I wled00/src/dependencies/json |
| 37 | + ; optional: |
| 38 | + ; -D WLED_DEBUG |
| 39 | + |
| 40 | + |
| 41 | +### 2. Update the WLED Web Interface (Optional) |
| 42 | + |
| 43 | +To integrate the new FSEQ functionality into the WLED UI, add a new button to the navigation area in your `wled00/data/index.htm` file. For example: |
| 44 | + |
| 45 | +<!-- New button for SD & FSEQ Manager --> |
| 46 | +<button onclick="window.location.href=getURL('/fsequi');"> |
| 47 | + <i class="icons"></i> |
| 48 | + <p class="tab-label">Fseq</p> |
| 49 | +</button> |
| 50 | + |
| 51 | +### 3. Modify usermods_list.cpp |
| 52 | + |
| 53 | +Register the FSEQ usermod by adding the following lines to `usermods_list.cpp`. Ensure no conflicting modules are included: |
| 54 | + |
| 55 | +```cpp |
| 56 | +#ifdef USERMOD_FSEQ |
| 57 | + #include "../usermods/FSEQ/usermod_fseq.h" |
| 58 | +#endif |
| 59 | + |
| 60 | +#ifdef USERMOD_FSEQ |
| 61 | + UsermodManager::add(new UsermodFseq()); |
| 62 | +#endif |
| 63 | + |
| 64 | +// Remove or comment out any conflicting SD card usermod: |
| 65 | +// //#include "../usermods/sd_card/usermod_sd_card.h" |
| 66 | +// //#ifdef SD_ADAPTER |
| 67 | +// //UsermodManager::add(new UsermodSdCard()); |
| 68 | +// //#endif |
| 69 | + |
| 70 | +HTTP Endpoints |
| 71 | + |
| 72 | +The following endpoints are available: |
| 73 | + • GET /sd/ui |
| 74 | + Description: Returns an HTML page with the SD & FSEQ Manager interface. |
| 75 | + Usage: Open this URL in a browser. |
| 76 | + • GET /sd/list |
| 77 | + Description: Displays an HTML page listing all files on the SD card, with options to delete files and a form to upload new files. |
| 78 | + Usage: Access this URL to view the SD file list. |
| 79 | + • POST /sd/upload |
| 80 | + Description: Handles file uploads to the SD card using a multipart/form-data POST request. |
| 81 | + Usage: Use a file upload form or an HTTP client. |
| 82 | + • GET /sd/delete |
| 83 | + Description: Deletes a specified file from the SD card. Requires a query parameter path indicating the file path. |
| 84 | + Usage: Example: /sd/delete?path=/example.fseq. |
| 85 | + • GET /fseq/list |
| 86 | + Description: Returns an HTML page listing all FSEQ files (with .fseq or .FSEQ extensions) on the SD card. Each file includes a button to play it. |
| 87 | + Usage: Open this URL in a browser to view and interact with the file list. |
| 88 | + • GET /fseq/start |
| 89 | + Description: Starts playback of a selected FSEQ file. Requires a file query parameter and optionally a t parameter (time offset in seconds). |
| 90 | + Usage: Example: /fseq/start?file=/animation.fseq&t=10. |
| 91 | + • GET /fseq/stop |
| 92 | + Description: Stops the current FSEQ playback and clears the active playback session. |
| 93 | + Usage: Send an HTTP GET request to stop playback. |
| 94 | + • GET /fseqfilelist |
| 95 | + Description: Returns a JSON list of all FSEQ files found on the SD card. |
| 96 | + Usage: Open this URL or send an HTTP GET request to retrieve the file list. |
| 97 | + |
| 98 | + |
| 99 | +Configurable SPI Pin Settings |
| 100 | + |
| 101 | +The default SPI pin assignments for SD SPI are defined as follows: |
| 102 | + |
| 103 | +#ifdef WLED_USE_SD_SPI |
| 104 | +int8_t UsermodFseq::configPinSourceSelect = 5; |
| 105 | +int8_t UsermodFseq::configPinSourceClock = 18; |
| 106 | +int8_t UsermodFseq::configPinPoci = 19; |
| 107 | +int8_t UsermodFseq::configPinPico = 23; |
| 108 | +#endif |
| 109 | + |
| 110 | +These values can be modified via WLED’s configuration JSON using the addToConfig() and readFromConfig() methods. This allows you to change the pin settings without recompiling the firmware. |
| 111 | + |
| 112 | +Summary |
| 113 | + |
| 114 | +The SD & FSEQ Usermod for WLED enables FSEQ file playback from an SD card with a full-featured web UI and UDP synchronization for remote control. With configurable SPI pin settings, this usermod integrates seamlessly into WLED, providing additional functionality without modifying core code. |
| 115 | + |
| 116 | +For further customization or support, please refer to the project documentation or open an issue on GitHub. |
| 117 | + |
0 commit comments