You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Function**: HTTP server and WebSocket handler for UI
34
34
-**Operations**: Processes REST API calls, WebSocket messages, JSON serialization
35
-
-**Runs every**: 10ms
35
+
-**Runs every**: 20ms
36
36
-**Why Core 1, Priority 2**: Lower priority than system Tasks
37
37
38
38
## Task Interaction Flow
@@ -69,6 +69,29 @@ sequenceDiagram
69
69
DriverTask->>LEDs: Pixel data
70
70
```
71
71
72
+
HTTPP task
73
+
74
+
* no assigned core (OS decides), prio 5
75
+
* processes WebUI / Websockets
76
+
* calls ModuleState read() and update() functions
77
+
* MoonLight Modules: runs Modules::compareRecursive and Modules::checkReOrderSwap which calls postUpdate which presents a semaphore-guarded updatedItem (updateProcessedSem, updateReadySem)
78
+
* Page refresh: runs onLayout pass 1 for the monitor
79
+
80
+
SvelteKit task
81
+
82
+
* Module::loop() runs in the SvelteKit task and calls getUpdate() to retrieve the updatedItem in a synchronized way, getUpdate() calls processUpdatedItem()
83
+
* processUpdatedItem() calls Module::onUpdate(), which is a virtual function which is overridden by Modules to implement custom functionality
84
+
* NodeManager::onUpdate() propagates onUpdate() to Node Controls (together with Node::updateControl()), guarded by nodeMutex
85
+
86
+
Driver Task
87
+
88
+
* PhysicalLayer::loopDrivers(): if requestMap call mapLayout(). mapLayout() calls onLayout(), guarded by nodeMutex
89
+
* PhysicalLayer::loopDrivers(): Node::onSizeChanged() and Node::loop() guarded by nodeMutex
90
+
91
+
Effect Task
92
+
93
+
* PhysicalLayer::loop() calls VirtualLayer::Loop(): Node::onSizeChanged() and Node::loop(), guarded by nodeMutex
94
+
72
95
## Core Assignments
73
96
74
97
Why This Configuration is Optimal
@@ -278,16 +301,14 @@ For big setups, 16K LEDs typically, Task watchdog got triggered crashes occur mo
278
301
void effectOrDriverTask(void* pvParameters) {
279
302
// 🌙
280
303
esp_task_wdt_add(NULL);
281
-
282
304
setup();
283
305
284
306
while (true) {
285
-
286
-
loop();
287
-
288
307
esp_task_wdt_reset();
308
+
loop();
289
309
vTaskDelay(1);
290
310
}
311
+
291
312
// Cleanup (never reached in this case, but good practice)
* esp_task_wdt ( #include "esp_task_wdt.h" ) make sure the tasks are in the watchdog system and in the task loop it is reset and vTaskDelay(1) makes sure there is a yield each time
Install <ahref="https://github.com/MoonModules/MoonLight"target="_blank">MoonModules/MoonLight</a> on an ESP32 microcontroller. You need a compatible browser like Chrome, or Edge, not supported on Safari.
3
+
Install <ahref="https://github.com/MoonModules/MoonLight"target="_blank">MoonModules/MoonLight</a> on an ESP32 microcontroller.
4
+
You need a Web Serial–compatible browser such as **Chrome** or **Edge**. **Safari is not supported.**
4
5
5
-
For devices which have already MoonLight installed, go to [Update](#update-moonlight)
6
+
For devices that already have MoonLight installed, go to [Update](#update-moonlight).
Select your ESP32-device from the table below, press the corresponding **Connect** button and follow the steps. Your device should show up in this list. Press the **Erase** checkbox when installing MoonLight for the first time. After succesful install, go to Logs & Console, press **Restart** and close the installer.
28
+
Select your ESP32 device from the table below, press the corresponding **Connect** button, and follow the steps.
29
+
Your device should appear in the list.
30
+
31
+
When installing MoonLight for the **first time**, enable the **Erase** checkbox.
32
+
After a successful install, go to **Logs & Console**, press **Reset Device**, and close the installer.
28
33
29
34
!!! info "Bootloader mode"
30
-
If install doesn't work: some boards have to be placed in bootloader mode the first time: press and hold the `Boot` button on the ESP32, press the `Reset` button on the ESP32 and then release the `Boot` button.
35
+
If installation does not work, some boards must be placed into bootloader mode the first time:
36
+
press and hold the `Boot` button on the ESP32, press the `Reset` button, then release the `Boot` button.
31
37
32
38
| Name | Image*| Flash | Shop & Board presets |
33
39
|------|--------|-------|----------------------|
@@ -37,7 +43,7 @@ Select your ESP32-device from the table below, press the corresponding **Connect
A new MoonLight device will show itself as a WiFi Access Point (AP) in the WiFi settings of your PC, tablet or smartphone. The name starts with ML- and 4 characters.
63
+
A new MoonLight device will appear as a WiFi Access Point (AP) in the WiFi settings of your PC, tablet, or smartphone.
64
+
The name starts with `ML-` followed by four characters.
Enter a hostname, add your WiFi by adding the (+) button, enter SSID and password and press Apply Settings.
80
+
Enter a hostname, add your WiFi network using the (+) button, enter the SSID and password, and press **Apply Settings**.
74
81
75
-
Restart the device by pressing the boot button or simple unplug and plug the usb cable.
82
+
Restart the device by pressing the boot button, or simply unplug and reconnect the USB cable.
76
83
77
-
Go back to your home WiFi open a browser and enter hostname.local to open MoonLight via the new WiFi connection.
84
+
Reconnect to your home WiFi, open a browser, and go to `hostname.local` to access MoonLight via the new WiFi connection.
78
85
79
86
### IO Board Presets
80
87
81
-
Select your board in [Module IO](../../moonbase/inputoutput), if you have one of the premade boards supported (see above table), select this. If not sure, leave it as is.
88
+
Select your board in [Module IO](../../moonbase/inputoutput).
89
+
If you have one of the supported premade boards (see table above), select it.
Press save (💾). Saves your setup to the file system, so if a device is restarted, your settings are still there.
128
+
Press **Save** (💾).
129
+
This stores your configuration on the device, so your settings persist after a reboot.
114
130
115
-
If anything not working as expected, log an issue on GitHUB or contact us on Discord, Reddit or YouTube. See also [Installer troubleshooting](../../develop/installation/#moonlight-installer) and [USB-to-serial chip drivers](../../develop/installation/#usb-to-serial-chip-drivers)
131
+
If something does not work as expected, log an issue on GitHub or contact us via [Discord](https://discord.gg/TC8NSUSCdV), [Reddit](https://reddit.com/r/moonmodules) or [YouTube](https://www.youtube.com/@MoonModulesLighting).
132
+
See also [Installer troubleshooting](../../develop/installation/#moonlight-installer) and [USB-to-serial chip drivers](../../develop/installation/#usb-to-serial-chip-drivers).
116
133
117
134
!!! info "Next steps"
118
-
* You can now change effect or add effects, modifiers, layouts and drivers
119
-
* Go to[MoonLight Overview](../../moonlight/overview) to learn more
120
-
* press the (?) in MoonLight to go directly to the relevant page
135
+
* You can now change or add effects, modifiers, layouts, and drivers
136
+
* Visit the[MoonLight Overview](../../moonlight/overview) to learn more
137
+
* Press (?) in MoonLight to jump directly to the relevant documentation page
121
138
122
139
## Update MoonLight
123
140
124
-
MoonLight releases new versions regularly. As it is a new and growing platform it is recommended to update as soon as new releases are published. They can be installed via above procedure (without erase) or via one of the following procedures:
141
+
MoonLight releases new versions regularly.
142
+
As this is a new and growing platform, it is recommended to update as soon as new releases are published.
143
+
144
+
Updates can be installed using the installer above (without erasing), or via one of the methods below.
125
145
126
146
### System update
127
147
128
-
The preferred way to update MoonLight is directly in MoonLight via [System update](../../system/update). MoonLight notifies when new versions are available.
148
+
The preferred way to update MoonLight is directly within MoonLight via [System update](../../system/update).
149
+
MoonLight will notify you when new versions are available.
Currently not supported on smaller devices like the ESP32-D0 and ESP32-C3. Use the MoonLight Installer in this case.
153
+
This method is currently not supported on smaller devices such as the ESP32-D0 and ESP32-C3.
154
+
Use the MoonLight Installer instead for these devices.
133
155
134
156
### ESPConnect
135
157
136
-
Use ESPConnect to install unreleased firmware e.g. provided via [discord](https://discord.gg/MTn9mVUG5n) or GitHub issues. Published [releases](https://github.com/MoonModules/MoonLight/releases) can also be installed via this way.
158
+
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)).
159
+
Published [releases](https://github.com/MoonModules/MoonLight/releases) can also be installed this way.
Click Connect and choose your device. Select Flash Tools, go to Flash Firmware, open a firmware.bin file from your file system, select Flash Offset App0 and Flash.
143
-
144
-
### Visual Studio code
165
+
Click **Connect** and select your device.
166
+
Choose **Flash Tools**, go to **Flash Firmware**, open a `firmware.bin` file from your file system, select **Flash Offset App0**, and click **Flash**.
167
+
168
+
### Visual Studio Code
145
169
146
-
For developers. Upload directly from VSCode, see [Develop / Installation](../../develop/installation)
170
+
For developers: upload firmware directly from VS Code.
171
+
See [Develop / Installation](../../develop/installation).
| Fixed Rectangle | <imgwidth="120"alt="Rectangle"src="https://github.com/user-attachments/assets/474bd313-d961-4a95-8e44-015539a0ba7f" /> | <imgwidth="320"alt="RectangleC"src="https://github.com/user-attachments/assets/e9c1fca4-d7a2-42f4-9d23-643371b3c615" /> | To test a layout |
60
-
| Star Sky ||| tip: add the rotate modifier |
60
+
| Star Sky ||| tip: add the rotate modifier |
0 commit comments