McLighting icon indicating copy to clipboard operation
McLighting copied to clipboard

RGBW Support

Open debsahu opened this issue 5 years ago • 11 comments

Proposal: Add @bpohvoodoo as collaborator

Merge https://github.com/FabLab-Luenen/McLighting to develop branch.

Let users test this branch @TheAndi has already volunteered to test and provide feedback.

debsahu avatar Mar 18 '19 16:03 debsahu

Constant crashes in core v2.5.0, Could someone else also test it?

debsahu avatar Mar 18 '19 19:03 debsahu

Constant crashes in core v2.5.0, Could someone else also test it?

You have to erase the complete device not only sketch

bpohvoodoo avatar Mar 20 '19 16:03 bpohvoodoo

As much as I'd like a tested change to be merged, I quickly checked what would be required to drive an RGBW neopixel strip with McLighting. Indeed the only thing I had to do was to configure the strip. So extending the McLighting.ino part "server.on("/pixelconf", ..." to allow RGBW configurations seemed enough. The colors I set in the UI were correctly displayed by my GRBW strip.

Obviously it was not yet possible to use the white channel. Just wanted to let you know.

HiranChaudhuri avatar May 11 '19 22:05 HiranChaudhuri

So here is the remainder of my changes to enable RGBW on McLightning:

Extend McLighting.ino lines around 900 by RGBW modes so pixelconf will accept the correct modes. With this it is already possible to drive RGBW strips, although the white channel is still unused. '… if (RGBOrder == "grbw") { WS2812FXStripSettings.RGBOrder = NEO_GRBW; updateStrip = true; DBG_OUTPUT_PORT.println(RGBOrder); } else if (RGBOrder == "grb") { ...'

Extend struct ledstate in definitions.h with a fourth channel white. Add fourth channel to all of the setColor calls:

'strip->setColor(main_color.red, main_color.green, main_color.blue); strip->setColor(main_color.red, main_color.green, main_color.blue, main_color.white);'

Now the white channel is used correctly inside the controller, but there is no way to set the white channel from outside. For testing I added the /set_white url:

'server.on("/set_white", { if(server.hasArg("value")) { main_color.white = server.arg("value").toInt(); strip->setColor(main_color.red, main_color.green, main_color.blue, main_color.white); }

char whitecolor[3]; snprintf(whitecolor, sizeof(whitecolor), "%02X", main_color.white); server.sendHeader("Access-Control-Allow-Origin", "*"); server.send(200, "text/plain", whitecolor ); }); '

With that the fire flicker looks a lot more realistic, and the strip gets really bright by combining all channels. I love it. :-) The only thing missing is to have a nice UI for setting the white channel.

HiranChaudhuri avatar May 11 '19 23:05 HiranChaudhuri

So wait, is the white channel officially supported now?

VeniceNerd avatar Jun 16 '19 00:06 VeniceNerd

@VeniceNerd The code is not yet in the master branch, but you can try out the develop branch.

toblum avatar Jun 17 '19 19:06 toblum

@bpohvoodoo, @debsahu and @HiranChaudhuri Unfortunately I wasn't able to try everything out because of personal issues and I'm still waiting for my new RGBW strips (the ones I have seem to be fake ones or wrong labeled). Still got no luck ordering these from China. What is your feeeling about the version in DEV branch? I there something definitely missing or known problems?

toblum avatar Jun 17 '19 19:06 toblum

I ordered this one: https://www.amazon.com/dp/B079ZZ9BYH/ref=cm_sw_r_cp_api_i_aj.bDbGDXPZKQ

Has great reviews!

VeniceNerd avatar Jun 17 '19 20:06 VeniceNerd

@toblum where could I find the develop branch? Thx!

VeniceNerd avatar Jun 17 '19 23:06 VeniceNerd

@VeniceNerd Have a look here: https://github.com/toblum/McLighting/tree/develop

toblum avatar Jun 18 '19 18:06 toblum

Hi @bpohvoodoo ans @debsahu,

after a longer time-out for personal reasons, I wanted to deal again with McLighting and work again on a good last version of the software which can last for a longer time. The current version seems to have a few problems. I don't think we all have that much time left to actively work on more features for McLIghting, but I would like to provide a stable version with all available features. It would be a pity to leave McLighting in the current version. I would also like to include the RGBW functionality. But I have to admit that I can't handle the codebase very well anymore. I was not able to merge the PR so correctly that a working version comes out. This is also due to the fact that there is a lot of code from you that I don't know well anymore.

Would you join in building a last stable version that supports both RGB and RGBW and can last for some time?

Best regards Tobias

toblum avatar Jul 27 '19 22:07 toblum