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
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
Copy file name to clipboardExpand all lines: docs/develop/nodes.md
+98Lines changed: 98 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,104 @@ MoonLight specific
29
29
* 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).
30
30
* If offsetBrightness is defined, the RGB values will not be corrected for brightness in [ArtNed](https://moonmodules.org/MoonLight/moonlight/nodes/#art-net/).
31
31
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
@@ -58,4 +60,69 @@ Below lists are ordered in terms of likelyhood to be accepted:
58
60
* main.cpp: esp_log_set_vprintf(my_vprintf); 🚧
59
61
* ci pio
60
62
* 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/)
0 commit comments