Set 'Realtime-mode / override' with a DMX (ArtNet / E1.31) channel slider

Hi (skilled developer) people, im trying to implement an automatic function in WLED, to use a function what already exists, but what is now triggered manually.

Case:

  • Most of the time I use DMX mode ‘effect’ (ArtNet) to control a ledstrip. If LedFX is running (DDP i think) then the WLED shows that its being used by another program (i think override is not active here).

  • At this point I have to manually override this (by pressing the star top left) to use it with DMX again. Since I want to switch fast between those 2, i want to use an (existing) channel slider (DMX, ArtNet) to set the realtimeMode.

I tought I could do this programming myself and I already read a lot of related posts, and did a lot of trial and error but… I still cant get it done.

My idea:

  • ‘Make an extra DMX mode which is actually the same as the Effect mode but with the adition that on the second slider (the ‘effect selector’), values above 245 can change the realtimeoverride’

What is my advantage:

  • Have the complete control of WLED effects, and LedFX on 1 platform: My DMX controller.

  • I can control all my fixtures from 1 place (Moving heads, Led pars, fog machine, lasers…)

What did I try:

  • I tried modifying the WLED code and compiling it to a Quinled ESP32. this was a succes (i think).

  • I made changes in the UI ‘settings sync html file’, and in e131.cpp and in const.h

  • Specifically I added an extra DMX mode in e131.cpp and const.h and the html of the UI.

  • In e131.cpp I tried adding condition that if the second channel value is higher than the value 245 AND the mode is set to the new added mode, THEN there is no real time override.

  • So this means i can set all the wled effects (there are not 255 effects) and if i want to use LedFX i just move my slider all the way above 245.

  • I tried developing this with a bit help of GPT ofcourse…

  • At this point, if i set the mode and press save, the mode does not remain active, but jumps to the previous selected mode. (this is because of my noob program skills)

My questions:

  • Is my approach / solution a good idea? And is there anyone that can give me the correct steps to implement this function and to make it work?

Thanks already!
Jefta

Well I think I am a step further. I added this in the e131.cpp code.:

          if (e131_data[dataOffset+1] < strip.getModeCount())
            if (e131_data[dataOffset+1] != seg.mode)      seg.setMode(   e131_data[dataOffset+1]); //2

          // Check if DMX_MODE_EFFECT is active, added myself part
          if (DMXMode == DMX_MODE_EFFECT) {
          // Set realtimeOverride based on the condition
          realtimeOverride = (e131_data[dataOffset + 1] <= 245);
          }

          if (e131_data[dataOffset+2]   != seg.speed)     seg.speed     = e131_data[dataOffset+2]; //3 
          if (e131_data[dataOffset+3]   != seg.intensity) seg.intensity = e131_data[dataOffset+3]; //4
          if (e131_data[dataOffset+4]   != seg.palette)   seg.setPalette(e131_data[dataOffset+4]); //5

The new mode I created did not work because it did not stay when I selected it. I tried adding this above code to the DMX_EFFECT_MODE , which I am going to use for control. It seems to work in part. If I put the channel slider 2 under 245 and refresh the page from WLED, with LedFX active, then I can control with DMX! Yes!!! So then I can set effects and as soon as I slide it above 245 then it shoots out of realtimeOverride and then it’s through LedFX again.

I still tested it on an empty test ESP but will soon test it in the real system, with the ledstrips attached.

Most likely this is still not the best solution because I noticed immediately that if I manually turn off realtimeOverride (with the little star). Then I have to first change the effect slider a value once so wled sees again that there was a change in the slider value.

I will keep you posted and if there is any tips on the software part to make a custom mode with this functionality then i am stil open for it. Maybe you guys have tips for a more complete better approach, since you should always look at the whole system, and not get lost in the wrong detail.

Hi @Jefta ,
I’m pursuing tha same functionality as you were exposing.
Did you have any success? If so, can you share how?
Thanks!