Server and Atomic Fire Lamp multichannel #440
Replies: 4 comments
-
I have multichannel working, but haven’t tested multichannel over wifi in a year or so. I did work at one time, but don’t have a project here in production that uses it so no idea if it still works!
Every time a packet is sent from the server to the client, it includes a channel ID. 0 means “all channels”, and if non-zero it indicates which channel.
It should work locally before you try sending WiFi to it. When WiFi arrives, it will stop drawing local effects and only draw the wifi while available.
I’m pretty backed up this weekend but if I get a chance I will see if I can get any color data sending over wifi to my own 4-channel lamp and see what happens!
For now I would look at the ProcessIncomingData code and make sure that it’s really repeating the channel number when it receives it and putting the data in that channel’s buffer.
…-Dave
On Sep 23, 2023, at 6:09 AM, mikejohnau ***@***.***> wrote:
Hi,
So I have the server app running and would like to use it send colour data to each channel on my Fire Lamp. My end goal would be get 4 completely different effects on each leg or 4 variations of the same effect
I have looked in SiteControllers.ch and dont understand how the below would work. Also, it doesn't work/build.
new LightStrip("192.168.0.148", "ATOM0", compressData, ATOM_LENGTH, 1, ATOM_START, false, 1 + 2 + 4 + 8),
I have tried creating individual LightStrip instances in a location
new LightStrip("192.168.0.148", "ATOM1", compressData, ATOM_LENGTH, 1, ATOM_START, false, 1),
new LightStrip("192.168.0.148", "ATOM2", compressData, ATOM_LENGTH, 1, ATOM_START, false, 2),
new LightStrip("192.168.0.148", "ATOM3", compressData, ATOM_LENGTH, 1, ATOM_START, false, 3),
new LightStrip("192.168.0.148", "ATOM4", compressData, ATOM_LENGTH, 1, ATOM_START, false, 4),
and only get output on the first channel.
I have also tried creating a new location for each channel in SiteControllers.ch and adding in the appropriate line in Program.ch. This has zero impact as well. Nothing other than channel 1 outputting.
Dave, do you have multi channel working on your Atomic Lamp? I know on my current set up (not using server app) I'm invoking 4 different frame buffers and instances of fireEffect for each leg
FastLED.addLeds<WS2812B, LED_PIN0, GRB>(g_LEDs0, NUM_LEDS);
FastLED.addLeds<WS2812B, LED_PIN1, GRB>(g_LEDs1, NUM_LEDS);
FastLED.addLeds<WS2812B, LED_PIN2, GRB>(g_LEDs2, NUM_LEDS);
FastLED.addLeds<WS2812B, LED_PIN3, GRB>(g_LEDs3, NUM_LEDS);
ClassicFireEffect fire0(g_LEDs0, NUM_LEDS, 30, 100, 75, 10, true, true);
ClassicFireEffect fire1(g_LEDs1, NUM_LEDS, 30, 100, 75, 10, true, true);
ClassicFireEffect fire2(g_LEDs2, NUM_LEDS, 20, 100, 70, 20, false, false);
ClassicFireEffect fire3(g_LEDs3, NUM_LEDS, 15, 100, 90, 20, false, false);
and then draw 4 seperate times
fire0.DrawFire();
fire1.DrawFire();
fire2.DrawFire();
fire3.DrawFire();
FastLED.show(g_Brightness);
But it's not making sense to me because by creating individual locations in SiteController I'm recreating this structure. A frame buffer, a frame fill and a draw for each channel.
What am I missing?? This is my non working code for a seperate location for channel2 in SiteControllers.
public class AtomLight2 : Location
{
const bool compressData = true;
const int ATOM2_START = 0;
const int ATOM2_LENGTH = 53;
private CRGB[] _LEDs = InitializePixels<CRGB>(ATOM2_LENGTH);
private LightStrip[] _StripControllers =
{
new LightStrip("192.168.0.140", "ATOM2", compressData, ATOM2_LENGTH, 1, ATOM2_START, false, 2, false) { FramesPerBuffer = 5, BatchSize = 5 },
};
public ScheduledEffect[] _LEDEffects =
{
new ScheduledEffect(ScheduledEffect.AllDays, 0, 24, new FireworksEffect() { NewParticleProbability = 2.0, MaxSpeed = 150 } ),
};
public override LightStrip[] LightStrips { get { return _StripControllers; } }
public override ScheduledEffect[] LEDEffects { get { return _LEDEffects; } }
protected override CRGB[] LEDs { get { return _LEDs; } }
};
Any clues that you can give would be appreciated.
—
Reply to this email directly, view it on GitHub <#440>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AA4HCFYJZFMFAQ3XCJJA3ILX33NQTANCNFSM6AAAAAA5EGEZDU>.
You are receiving this because you are subscribed to this thread.
|
Beta Was this translation helpful? Give feedback.
-
Just some followup: I’ve got it working, over wifi, to all four channels.
I got the ATOMICLAMP configuration building and working, and added the FireFanEffect back. I also created a new variant of it with different colors on each spoke for the flames.
I’ll check those fixes into Rutger’s new-effects branch, if he lets me.
But really I think it should actually run as-is if you
#define MAX_BUFFERS 20
I also ran around in circles with a corruption issue that went away when I erased the flash and started fresh, so I suspect there was configuration code reading old data somehwhere.
Then on to the server side. You were very close! Here’s my AtomLight:
public class AtomLight : Location
{
const bool compressData = true;
const int ATOM_START = 0;
const int ATOM_LENGTH = 53;
private CRGB[] _LEDs = InitializePixels<CRGB>(ATOM_LENGTH);
private LightStrip[] _StripControllers =
{
new LightStrip("192.168.8.120", "ATOM0", compressData, ATOM_LENGTH, 1, ATOM_START, false, 1),
new LightStrip("192.168.8.120", "ATOM1", compressData, ATOM_LENGTH, 1, ATOM_START, false, 2),
new LightStrip("192.168.8.120", "ATOM2", compressData, ATOM_LENGTH, 1, ATOM_START, false, 4),
new LightStrip("192.168.8.120", "ATOM3", compressData, ATOM_LENGTH, 1, ATOM_START, false, 8),
};
public ScheduledEffect[] _LEDEffects =
{
new ScheduledEffect(ScheduledEffect.AllDays, 0, 24, EffectsDatabase.Football_Effect_Seattle),
};
public override LightStrip[] LightStrips { get { return _StripControllers; } }
public override ScheduledEffect[] LEDEffects { get { return _LEDEffects; } }
protected override CRGB[] LEDs { get { return _LEDs; } }
};
Each channel gets its own queue, which is a little overkill, but it works.
Note the IDs. Each channel gets a unique ID.
I have it working and sending color data to each of the spokes.

It’s expecting 30 frames of buffer, so another good reason to set MAX_BUFFERS=30 in your code.
Now the only problem is that the effect has no idea about any of this, and is just passed an ILEDGraphics instance from the Location. That means two things:
1) It means every channel gets its OWN effect
2) It means that effect doesn’t know about the other channels or what it’s channel ID is
So, you could add a GetChannelID() to ILEDGraphics and then effects could render based on which channel they are. You could have four fire effects running, each a different color, on each spoke.
Right now I’ve got a Seawhawks color fade and it’s running well on all four channels at once, over Wifi.
Hope this helps!
- Dave
… On Sep 23, 2023, at 8:05 AM, Dave Plummer ***@***.***> wrote:
I have multichannel working, but haven’t tested multichannel over wifi in a year or so. I did work at one time, but don’t have a project here in production that uses it so no idea if it still works!
Every time a packet is sent from the server to the client, it includes a channel ID. 0 means “all channels”, and if non-zero it indicates which channel.
It should work locally before you try sending WiFi to it. When WiFi arrives, it will stop drawing local effects and only draw the wifi while available.
I’m pretty backed up this weekend but if I get a chance I will see if I can get any color data sending over wifi to my own 4-channel lamp and see what happens!
For now I would look at the ProcessIncomingData code and make sure that it’s really repeating the channel number when it receives it and putting the data in that channel’s buffer.
-Dave
> On Sep 23, 2023, at 6:09 AM, mikejohnau ***@***.***> wrote:
>
>
> Hi,
> So I have the server app running and would like to use it send colour data to each channel on my Fire Lamp. My end goal would be get 4 completely different effects on each leg or 4 variations of the same effect
>
> I have looked in SiteControllers.ch and dont understand how the below would work. Also, it doesn't work/build.
>
> new LightStrip("192.168.0.148", "ATOM0", compressData, ATOM_LENGTH, 1, ATOM_START, false, 1 + 2 + 4 + 8),
> I have tried creating individual LightStrip instances in a location
> new LightStrip("192.168.0.148", "ATOM1", compressData, ATOM_LENGTH, 1, ATOM_START, false, 1),
> new LightStrip("192.168.0.148", "ATOM2", compressData, ATOM_LENGTH, 1, ATOM_START, false, 2),
> new LightStrip("192.168.0.148", "ATOM3", compressData, ATOM_LENGTH, 1, ATOM_START, false, 3),
> new LightStrip("192.168.0.148", "ATOM4", compressData, ATOM_LENGTH, 1, ATOM_START, false, 4),
>
> and only get output on the first channel.
>
> I have also tried creating a new location for each channel in SiteControllers.ch and adding in the appropriate line in Program.ch. This has zero impact as well. Nothing other than channel 1 outputting.
>
> Dave, do you have multi channel working on your Atomic Lamp? I know on my current set up (not using server app) I'm invoking 4 different frame buffers and instances of fireEffect for each leg
>
> FastLED.addLeds<WS2812B, LED_PIN0, GRB>(g_LEDs0, NUM_LEDS);
> FastLED.addLeds<WS2812B, LED_PIN1, GRB>(g_LEDs1, NUM_LEDS);
> FastLED.addLeds<WS2812B, LED_PIN2, GRB>(g_LEDs2, NUM_LEDS);
> FastLED.addLeds<WS2812B, LED_PIN3, GRB>(g_LEDs3, NUM_LEDS);
>
> ClassicFireEffect fire0(g_LEDs0, NUM_LEDS, 30, 100, 75, 10, true, true);
> ClassicFireEffect fire1(g_LEDs1, NUM_LEDS, 30, 100, 75, 10, true, true);
> ClassicFireEffect fire2(g_LEDs2, NUM_LEDS, 20, 100, 70, 20, false, false);
> ClassicFireEffect fire3(g_LEDs3, NUM_LEDS, 15, 100, 90, 20, false, false);
>
> and then draw 4 seperate times
> fire0.DrawFire();
> fire1.DrawFire();
> fire2.DrawFire();
> fire3.DrawFire();
> FastLED.show(g_Brightness);
>
> But it's not making sense to me because by creating individual locations in SiteController I'm recreating this structure. A frame buffer, a frame fill and a draw for each channel.
>
> What am I missing?? This is my non working code for a seperate location for channel2 in SiteControllers.
> public class AtomLight2 : Location
> {
> const bool compressData = true;
> const int ATOM2_START = 0;
> const int ATOM2_LENGTH = 53;
>
> private CRGB[] _LEDs = InitializePixels<CRGB>(ATOM2_LENGTH);
>
> private LightStrip[] _StripControllers =
> {
> new LightStrip("192.168.0.140", "ATOM2", compressData, ATOM2_LENGTH, 1, ATOM2_START, false, 2, false) { FramesPerBuffer = 5, BatchSize = 5 },
>
> };
>
> public ScheduledEffect[] _LEDEffects =
> {
> new ScheduledEffect(ScheduledEffect.AllDays, 0, 24, new FireworksEffect() { NewParticleProbability = 2.0, MaxSpeed = 150 } ),
> };
>
> public override LightStrip[] LightStrips { get { return _StripControllers; } }
> public override ScheduledEffect[] LEDEffects { get { return _LEDEffects; } }
> protected override CRGB[] LEDs { get { return _LEDs; } }
> };
> Any clues that you can give would be appreciated.
>
> —
> Reply to this email directly, view it on GitHub <#440>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AA4HCFYJZFMFAQ3XCJJA3ILX33NQTANCNFSM6AAAAAA5EGEZDU>.
> You are receiving this because you are subscribed to this thread.
>
|
Beta Was this translation helpful? Give feedback.
-
Ok, so figured it out. Issue 1 - I was an idiot. Issue 2 - I was an idiot, but still dont understand the channel numbering scheme. And in sitelocations.cs the 1st location must be using LED_PIN0 the 2nd LED_PIN1 and they must also be listed this way in program.cs in internal locations list. Also I dont know why in sitelocations.cs the channel that is selected must be 1, 2,4 or 8 and not just 1,2,3, or 4. But I'll work with it. But it's working for me. 4 legs/channels 4 different effects and WOW! The possibilities are endless. I've set it with FireEffect FireWorksEffect, BlueFire and Marquee. Even 4 completely different effects are mesmerising. My wife is overseas and due back mid week. She is a huge GoT fan. So I'm thinking opposing rings of FireEffect and BlueFire might make her think of "fire and ice". Happy wife, happy life.....lol For my conifg I had to set up each channel as a seperate location to drive it's own effects. Multiple channels in the same location showed the same effect. Also, "0 means “all channels” - looking through ProcessIncomingData code comments I think at some stage you may a call to change this and all calls for channel 0 are altered to be a request for channel 1. Finally, go the Seahawks! I did live in Rip City after all and even though I am tall the Trail Blazers weren't my thing. Seahawks and Sounders all the way. |
Beta Was this translation helpful? Give feedback.
-
I'm just thinking that my workbench setup is 4 x 1 metre (144LEDs) strips set up as LEDstrips and each one is controlled by a ESP32... But wouldn't that just be a FireLamp with 144 LEDs per channel? I see more coding and some freed up ESP32s in my future... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
So I have the server app running and would like to use it send colour data to each channel on my Fire Lamp. My end goal would be get 4 completely different effects on each leg or 4 variations of the same effect
I have looked in SiteControllers.ch and dont understand how the below would work. Also, it doesn't work/build.
I have tried creating individual LightStrip instances in a location
new LightStrip("192.168.0.148", "ATOM1", compressData, ATOM_LENGTH, 1, ATOM_START, false, 1),
new LightStrip("192.168.0.148", "ATOM2", compressData, ATOM_LENGTH, 1, ATOM_START, false, 2),
new LightStrip("192.168.0.148", "ATOM3", compressData, ATOM_LENGTH, 1, ATOM_START, false, 3),
new LightStrip("192.168.0.148", "ATOM4", compressData, ATOM_LENGTH, 1, ATOM_START, false, 4),
and only get output on the first channel.
I have also tried creating a new location for each channel in SiteControllers.ch and adding in the appropriate line in Program.ch. This has zero impact as well. Nothing other than channel 1 outputting.
Dave, do you have multi channel working on your Atomic Lamp? I know on my current set up (not using server app) I'm invoking 4 different frame buffers and instances of fireEffect for each leg
FastLED.addLeds<WS2812B, LED_PIN0, GRB>(g_LEDs0, NUM_LEDS);
FastLED.addLeds<WS2812B, LED_PIN1, GRB>(g_LEDs1, NUM_LEDS);
FastLED.addLeds<WS2812B, LED_PIN2, GRB>(g_LEDs2, NUM_LEDS);
FastLED.addLeds<WS2812B, LED_PIN3, GRB>(g_LEDs3, NUM_LEDS);
ClassicFireEffect fire0(g_LEDs0, NUM_LEDS, 30, 100, 75, 10, true, true);
ClassicFireEffect fire1(g_LEDs1, NUM_LEDS, 30, 100, 75, 10, true, true);
ClassicFireEffect fire2(g_LEDs2, NUM_LEDS, 20, 100, 70, 20, false, false);
ClassicFireEffect fire3(g_LEDs3, NUM_LEDS, 15, 100, 90, 20, false, false);
and then draw 4 seperate times
fire0.DrawFire();
fire1.DrawFire();
fire2.DrawFire();
fire3.DrawFire();
FastLED.show(g_Brightness);
But it's not making sense to me because by creating individual locations in SiteController I'm recreating this structure. A frame buffer, a frame fill and a draw for each channel.
What am I missing?? This is my non working code for a seperate location for channel2 in SiteControllers.
public class AtomLight2 : Location
{
const bool compressData = true;
const int ATOM2_START = 0;
const int ATOM2_LENGTH = 53;
Any clues that you can give would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions