Skip to content

Commit 34e25fe

Browse files
committed
Develop docs
1 parent 8d0d5bc commit 34e25fe

File tree

7 files changed

+177
-180
lines changed

7 files changed

+177
-180
lines changed

docs/develop/customizingsveltekit.md

Lines changed: 0 additions & 66 deletions
This file was deleted.

docs/develop/drivers.md

Lines changed: 0 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +0,0 @@
1-
# Drivers
2-
3-
## Overview
4-
5-
## Initless drivers
6-
7-
Initless means there is no addLeds (like in FastLed) or initLed (like in physical and virtual driver):
8-
9-
* a Context (see below) will be set
10-
* Driver.show (see below) will use this context to set the right data to the right output.
11-
* The context can dynamically change without needing to reboot or recompile! e.g. changes in pin allocations, leds per pin, RGB or RGBW, or DMX lights like moving heads.
12-
13-
The Art-Net driver is currently working like this, to be added to physical and virtual driver and parallel IO (P4).
14-
15-
The advantages of dynamic context change are:
16-
17-
* No need to recompile any changed configs (e.g. colorOrder is fully flexible, not a setting in platformio.ini)
18-
* No need to restart while setting up a specific installation. Just change layouts until it works as intended.
19-
* Allows for a flexible mix of different outputs e.g. send the first 1024 leds to physical driver, next to virtual driver, next to spi, next to one Art-Net device, next to another Art-Net device.
20-
21-
### Context
22-
23-
Make sure the following is available before calling driver.show. Note: setup only sets variables the loop will use.
24-
25-
* channels[]: pka leds array (CRGB leds) but we now support any light: not only 3 or 4 channels
26-
* channelsPerLed: a light in the channels array can be found by index * channelsPerLed.
27-
* offsets within the channels (RGBW and more like pan and tilt)
28-
* outputs[]: pins[] for leds drivers, outputs[] for Art-Net. Use generic name outputs[]
29-
* lengths[]: nr of lights per output
30-
* driver[]: shows for each output for which driver it is ... 🚧 as currenlty all drivers process all lights which sometimes is what you want (monitor on leds what is on moving heads) but not always
31-
32-
This is the current list of supported lights ranging from 3 channels per light (the classic rgb LEDs) to 32 channels per light. Currently pre defined: lights preset. In the future configurable
33-
34-
* RGB
35-
* RBG
36-
* GRB: default WS2812
37-
* GBR
38-
* BRG
39-
* BGR
40-
* RGBW: e.g. 4 channel par/dmx light
41-
* GRBW: rgbw LED eg. SK6812
42-
* GRB6: some LED curtains
43-
* RGBWYP: 6 channel par/dmx light with UV etc
44-
* MHBeeEyes150W-15 🐺: 15 channels moving head, see https://moonmodules.org/MoonLight/moonbase/module/drivers/#art-net
45-
* MHBeTopper19x15W-32 🐺: 32 channels moving head
46-
* MH19x15W-24: 24 channels moving heads
47-
48-
Based on the choosen value, the channels per light and the offsets will be set e.g. for GRB: header->channelsPerLight = 3; header->offsetRed = 1; header->offsetGreen = 0; header->offsetBlue = 2;. Drivers should not make this mapping, the code calling drivers should do.
49-
50-
The RGB and W offsets needs to be re-ordered and brightness corrected from the channel array. Not only Art-Net but also a LEDs driver need to accept channel arrays with more then 4 channels per light. Eg GRB6 is a type of led curtain some of us have, which a Chinese manufacturer screwed up: 6 channels per light but only rgb is used, 3 channels do nothing
51-
52-
### Driver.show
53-
54-
Called by loop function.
55-
56-
* loop over all outputs (or pins) which are meant for a specific driver (e.g. all outputs for artnet)
57-
* pre channel actions (...)
58-
* loop over all lights in the output
59-
* for each light
60-
* pre light actions (e.g. setup dma ...)
61-
* copy all channels to the buffer (for art-net) or to the memory area / dma / parallelIO ... so the driver can process it
62-
* find them in the channels array
63-
* correct RGBW offsets when present for brightness using LUT (__red_map etc in Yves his drivers)
64-
* send the buffer/memory (artnetudp.writeTo sends one universe, Yves drivers ..., Troy drivers ...)
65-
* post light actions (e.g. increase universe etc)
66-
* post channel actions (...)
67-
68-
For an example of the loop, see [Artnet loop](https://github.com/MoonModules/MoonLight/blob/fc6c4b6c52bf0a9e9a5de677c1ec5b6536fb7a16/src/MoonLight/Mods.cpp#L260-L293). Not splitten in output loop and lights loop yet (as now all drivers process all lights). Before and after the loop are pre /post output / light actions.
69-
70-
### MoonLight layout nodes
71-
72-
In MoonLight you can define one or more layout nodes telling which position lights have in the real world. E.g. a strip, or a panel (orientation, snake, ...) or a ring or any fantasy shape.
73-
Each layout nodes addLights and addPins (will be renamed to addOutPut). Layouts can be reordered. The pins and lights arrays will be filled with the Layout nodes in the order they are defined.
74-
75-
Note: Above concept can also be offered in a library and imported in other projects like WLED, FastLED scripts etc.
76-
77-
### Notes on the I2S clockless driver
78-
79-
* nb_components -> channelsPerLed
80-
* p_r, p_g, p_b, p_w -> offsetRed, Green, Blue, White
81-
* stripSize[] -> lenghts[]
82-
83-
#### initLed
84-
85-
* setBrightness / setGamma -> done by MoonLight if brightness (or gamma) changes, driver.show expects the LUT to be set right
86-
* setPins(Pinsq): called by MoonLight as soon as pins changes: add function driver.updatePins which also cleans up previous defined pins (I think there is no cleanup, so can be called repeatedly?)
87-
* i2sInit(): not using context...: so this (and i2sReset...) can be called once in the setup...
88-
* i2sReset(): not using context...
89-
* i2sReset_DMA(): not using context...
90-
* i2sReset_FIFO(): not using context...
91-
* initDMABuffers(): uses __NB_DMA_BUFFER, nb_components -> should be called by MoonLight as soon as dma buffer (would be very nice if this is a variable instead of a constant, so can be tweaked in MoonLight without recompiling) or lights preset (channelsPerLed) changes. Add function driver.updateLightsPreset(dma_buffer, channelsPerLight)...
92-
* putdefaultones: uses nb_components
93-
94-
#### showPixels
95-
96-
* loadAndTranspose(): uses this for all dma buffers. All Okay
97-
* loop over num_strips (outputs[].length)
98-
* loop over stripSize (lenghts[]), light by light: triggered by _I2SClocklessLedDriverinterruptHandler
99-
* fills secondPixel using LUT and RGB(W) offsets
100-
* transpose16x1_noinline2(secondpixel)
101-
* i2sStart: uses dma buffers: Okay

docs/develop/nodes.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,104 @@ MoonLight specific
2929
* Effect nodes **set light**: Currently setRGB, setWhite, setBrightness, setPan, setTilt, setZoom, setRotate, setGobo, setRGB1, setRGB2, setRGB3, setBrightness2 is supported. In the background MoonLight calculates which channel need to be filled with values using the offsets (using the setLight function).
3030
* If offsetBrightness is defined, the RGB values will not be corrected for brightness in [ArtNed](https://moonmodules.org/MoonLight/moonlight/nodes/#art-net/).
3131

32+
## Layout nodes
33+
34+
In MoonLight you can define one or more layout nodes telling which position lights have in the real world. E.g. a strip, or a panel (orientation, snake, ...) or a ring or any fantasy shape.
35+
Each layout nodes addLights and addPins (will be renamed to addOutPut). Layouts can be reordered. Driver nodes will use these pins and the leds connected to it.
36+
37+
## Drivers
38+
39+
### Initless drivers
40+
41+
Initless means there is no addLeds (like in FastLed) or initLed (like in physical and virtual driver):
42+
43+
* a Context (see below) will be set
44+
* Driver.show (see below) will use this context to set the right data to the right output.
45+
* The context can dynamically change without needing to reboot or recompile! e.g. changes in pin allocations, leds per pin, RGB or RGBW, or DMX lights like moving heads.
46+
47+
The Art-Net driver is currently working like this, to be added to physical and virtual driver and parallel IO (P4).
48+
49+
The advantages of dynamic context change are:
50+
51+
* No need to recompile any changed configs (e.g. colorOrder is fully flexible, not a setting in platformio.ini)
52+
* No need to restart while setting up a specific installation. Just change layouts until it works as intended.
53+
* Allows for a flexible mix of different outputs e.g. send the first 1024 leds to physical driver, next to virtual driver, next to spi, next to one Art-Net device, next to another Art-Net device.
54+
55+
#### Context
56+
57+
Make sure the following is available before calling driver.show. Note: setup only sets variables the loop will use.
58+
59+
* channels[]: pka leds array (CRGB leds) but we now support any light: not only 3 or 4 channels
60+
* channelsPerLed: a light in the channels array can be found by index * channelsPerLed.
61+
* offsets within the channels (RGBW and more like pan and tilt)
62+
* outputs[]: pins[] for leds drivers, outputs[] for Art-Net. Use generic name outputs[]
63+
* lengths[]: nr of lights per output
64+
* driver[]: shows for each output for which driver it is ... 🚧 as currenlty all drivers process all lights which sometimes is what you want (monitor on leds what is on moving heads) but not always
65+
66+
This is the current list of supported lights ranging from 3 channels per light (the classic rgb LEDs) to 32 channels per light. Currently pre defined: lights preset. In the future configurable
67+
68+
* RGB
69+
* RBG
70+
* GRB: default WS2812
71+
* GBR
72+
* BRG
73+
* BGR
74+
* RGBW: e.g. 4 channel par/dmx light
75+
* GRBW: rgbw LED eg. SK6812
76+
* GRB6: some LED curtains
77+
* RGBWYP: 6 channel par/dmx light with UV etc
78+
* MHBeeEyes150W-15 🐺: 15 channels moving head, see https://moonmodules.org/MoonLight/moonbase/module/drivers/#art-net
79+
* MHBeTopper19x15W-32 🐺: 32 channels moving head
80+
* MH19x15W-24: 24 channels moving heads
81+
82+
Based on the choosen value, the channels per light and the offsets will be set e.g. for GRB: header->channelsPerLight = 3; header->offsetRed = 1; header->offsetGreen = 0; header->offsetBlue = 2;. Drivers should not make this mapping, the code calling drivers should do.
83+
84+
The RGB and W offsets needs to be re-ordered and brightness corrected from the channel array. Not only Art-Net but also a LEDs driver need to accept channel arrays with more then 4 channels per light. Eg GRB6 is a type of led curtain some of us have, which a Chinese manufacturer screwed up: 6 channels per light but only rgb is used, 3 channels do nothing
85+
86+
#### Driver.show
87+
88+
Called by loop function.
89+
90+
* loop over all outputs (or pins) which are meant for a specific driver (e.g. all outputs for artnet)
91+
* pre channel actions (...)
92+
* loop over all lights in the output
93+
* for each light
94+
* pre light actions (e.g. setup dma ...)
95+
* copy all channels to the buffer (for art-net) or to the memory area / dma / parallelIO ... so the driver can process it
96+
* find them in the channels array
97+
* correct RGBW offsets when present for brightness using LUT (__red_map etc in Yves his drivers)
98+
* send the buffer/memory (artnetudp.writeTo sends one universe, Yves drivers ..., Troy drivers ...)
99+
* post light actions (e.g. increase universe etc)
100+
* post channel actions (...)
101+
102+
For an example of the loop, see [Artnet loop](https://github.com/MoonModules/MoonLight/blob/fc6c4b6c52bf0a9e9a5de677c1ec5b6536fb7a16/src/MoonLight/Mods.cpp#L260-L293). Not splitten in output loop and lights loop yet (as now all drivers process all lights). Before and after the loop are pre /post output / light actions.
103+
104+
#### Notes on the I2S clockless driver
105+
106+
* nb_components -> channelsPerLed
107+
* p_r, p_g, p_b, p_w -> offsetRed, Green, Blue, White
108+
* stripSize[] -> lenghts[]
109+
110+
#### initLed
111+
112+
* setBrightness / setGamma -> done by MoonLight if brightness (or gamma) changes, driver.show expects the LUT to be set right
113+
* setPins(Pinsq): called by MoonLight as soon as pins changes: add function driver.updatePins which also cleans up previous defined pins (I think there is no cleanup, so can be called repeatedly?)
114+
* i2sInit(): not using context...: so this (and i2sReset...) can be called once in the setup...
115+
* i2sReset(): not using context...
116+
* i2sReset_DMA(): not using context...
117+
* i2sReset_FIFO(): not using context...
118+
* initDMABuffers(): uses __NB_DMA_BUFFER, nb_components -> should be called by MoonLight as soon as dma buffer (would be very nice if this is a variable instead of a constant, so can be tweaked in MoonLight without recompiling) or lights preset (channelsPerLed) changes. Add function driver.updateLightsPreset(dma_buffer, channelsPerLight)...
119+
* putdefaultones: uses nb_components
120+
121+
#### showPixels
122+
123+
* loadAndTranspose(): uses this for all dma buffers. All Okay
124+
* loop over num_strips (outputs[].length)
125+
* loop over stripSize (lenghts[]), light by light: triggered by _I2SClocklessLedDriverinterruptHandler
126+
* fills secondPixel using LUT and RGB(W) offsets
127+
* transpose16x1_noinline2(secondpixel)
128+
* i2sStart: uses dma buffers: Okay
129+
32130
## Archive
33131

34132
This page is 🚧, text below will be rewritten.

docs/develop/overview.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33

44
* [Install Development environment](https://moonmodules.org/MoonLight/develop/installation/)
55
* [Development](https://moonmodules.org/MoonLight/develop/development/)
6-
* MoonBase architecture
7-
* MoonLight architecture
8-
* [Sveltekit](https://moonmodules.org/MoonLight/develop/customizingsveltekit/)
9-
* [ESP32 Sveltekit](https://moonmodules.org/MoonLight/esp32sveltekit/)
6+
* [Nodes](https://moonmodules.org/MoonLight/develop/development/)
7+
* [Modules](https://moonmodules.org/MoonLight/develop/development/)
8+
* [Layers](https://moonmodules.org/MoonLight/develop/development/)
9+
* [Layers](https://moonmodules.org/MoonLight/develop/development/)
10+
* [Sveltekit](https://moonmodules.org/MoonLight/develop/sveltekit/)
1011

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Pull-Requests
1+
# Sveltekit
2+
3+
## Pull-Requests
24

35
<img width="300" src="https://github.com/user-attachments/assets/8750fc86-cbde-46ef-9392-9d6810340b52" />
46

@@ -58,4 +60,69 @@ Below lists are ordered in terms of likelyhood to be accepted:
5860
* main.cpp: esp_log_set_vprintf(my_vprintf); 🚧
5961
* ci pio
6062
* run in loopTask to avoid stack size crashes in httpd
61-
* updatedItems (to see what specifically has been updated)
63+
* updatedItems (to see what specifically has been updated)
64+
65+
## Steps made to make Sveltekit ready for MoonLight
66+
67+
This is a checklist, More info on most of the items can be found in the ESP32-Sveltekit specific documentation [ESP32 SvelteKit](https://moonmodules.org/MoonLight/esp32sveltekit/), [Build Tools](https://moonmodules.org/MoonLight/gettingstarted/), [Front end](https://moonmodules.org/MoonLight/sveltekit/) and [Back End](https://moonmodules.org/MoonLight/statefulservice/)
68+
69+
* {custom} = MoonLight or name of a forked repo
70+
71+
* docs/media/
72+
* add {custom}-logo.png (used in mkdocs.yml)
73+
* replace favicon.png
74+
* factory_settings.ini
75+
* FACTORY_AP_SSID=\"{custom}-#{unique_id}\"
76+
* FACTORY_AP_PASSWORD=\"\" (recommendation)
77+
* FACTORY_NTP_TIME_ZONE_LABEL=\"Europe/Berlin\"
78+
* package.json
79+
* name = "{custom}"
80+
* version: "0.5.9.3",
81+
* intrerface/source/lib/assets/logo.png
82+
* replace logo
83+
* interface/source/routes/+layout.ts
84+
* title: '{custom}'
85+
* github:
86+
* copyright
87+
* appname: '{custom}'
88+
* interface/source/routes/+page.svelte
89+
* Welcome to {custom}
90+
* Intro message
91+
* href="/"
92+
* Start {custom}
93+
* interface/source/routes/menu.svelte
94+
* const discord = { href: 'https://discord.gg/TC8NSUSCdV', active: true };
95+
* interface/static/manifest.json
96+
* name: "{custom}"
97+
* interface/static/favicon.png
98+
* replace favicon.png
99+
* lib/framework/APSettingsService.h
100+
* FACTORY_AP_SSID "{custom}-#{unique_id}"
101+
* FACTORY_AP_PASSWORD ""
102+
* mkdocs.yml
103+
* site_name: {custom}
104+
* nav: {custom}
105+
* repo_name and repo_url
106+
* theme logo: media/{custom}-logo.png
107+
* analytics: provider: google property: G-R6QYDG0126
108+
* Copyright
109+
* platformio.ini
110+
* description = {custom}
111+
* add [custom] build_flags and lib_deps
112+
* APP_NAME=\"{custom}\" ;
113+
* APP_VERSION=\"0.x.0\"
114+
* CORE_DEBUG_LEVEL=4
115+
* README.md
116+
* Custom intro
117+
* vite.config.ts
118+
* Set target: 'http://192.168.1.xxx'
119+
* setup custom code
120+
* src/custom
121+
* interface/src/routes/moonbase
122+
* interface/src/lib/components/moonbase
123+
* interface/src/lib/types/moonbase_model.ts
124+
* interface/src/lib/stores/moonbase_utilities.ts
125+
* Github repo
126+
* change license
127+
* change description
128+
* change webhook

docs/moonlight/overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Effects, Modifiers, Layouts and drivers use emoji's to visualize their usage. Se
120120

121121
* 🔥 Effect
122122
* 🎨 Using palette
123-
* 💡 WLED origin
123+
* 🐙 WLED origin
124124
* 💫 MoonLight origin
125125
* 🚨 Moving head color effect
126126
* 🗼 Moving head move effect
@@ -130,7 +130,7 @@ Effects, Modifiers, Layouts and drivers use emoji's to visualize their usage. Se
130130

131131
* ♫ Audio reactive FFT based
132132
* ♪ Audio reactive volume based
133-
* supports up to 0D
133+
* 💡 supports up to 0D
134134
* 📏 supports up to 1D
135135
* 🟦 supports up to 2D
136136
* 🧊 supports up to 3D

0 commit comments

Comments
 (0)