sticilface / Melvanimate

Melvanimate
60 stars 7 forks source link

RGBW Support #29

Closed codmpm closed 7 years ago

codmpm commented 7 years ago

WOW! What a tremendous work! Just installed and was totally flashed - thank you so so much.

I have a fairly large RGBW-NeoPixel (1650 pixels) installation in a bar of a friend of mine. Right now it is controlled over network (http) with an Arduino Mega and some ragged code from me. It is slow and I have to admit that the animation thing is too complex for me.

Do you plan to support RGBW Neopixels? Would be terrific.

Cheers, Patrik

sticilface commented 7 years ago

RGBW support is easy!

just add #define WS2812_FOUR_COLOR

here https://github.com/sticilface/Melvanimate/blob/master/src/mybus.h#L21

easy :) it has to go in the maybes.h file as the arduino IDE doesn't seem to propagate them if u define it in the sketch.

sticilface commented 7 years ago

you'll struggle to do 1650 pixels though. especially RGBW as the buffer is bigger. you'll have to watch the heap and see what you can drive. you can do more without animations! let me know how u get on.

codmpm commented 7 years ago

Ha, sorry. Totally missed the FOUR_COLOR thing. Thank you!

I will get back to you and let you know how it works. Gimme some time...

codmpm commented 7 years ago

Sadly I get a wdt reset after adding #define WS2812_FOUR_COLOR to the sketch. I'm using an Olmiex MOD-ESP-8266 but will try with a generic ESP12-Module.

Melvanimate - WS2812 control
Free Heap: 25536
Ready IP: 192.168.xx.xx

Exception (4):
epc1=0x400005cb epc2=0x00000000 epc3=0x00000000 excvaddr=0x40013969 depc=0x00000000

ctx: cont 
sp: 3fff2750 end: 3fff29d0 offset: 01a0

>>>stack>>>
3fff28f0:  3fff5f40 3fff2940 3fff5c2c 4010068c  
3fff2900:  3fff5f40 0000001c 3fff19b0 00000000  
3fff2910:  00000000 3fff199c 4022c0e4 3fff19b0  
3fff2920:  40257a66 0000001d 00000064 3fff199c  
3fff2930:  3fffdad0 00000000 3fff12fc 402384ac  
3fff2940:  3fff5c44 40208778 3fff5914 40201830  
3fff2950:  3fffdad0 3fff1694 3fff14e0 4025764d  
3fff2960:  40229a6c 88ee88e8 3fff1268 40217b27  
3fff2970:  e88ee888 e8eee8e8 3fff1354 4021db34  
3fff2980:  3fffdad0 3fff1694 3fff12fc 4021e3da  
3fff2990:  3fff52d4 feefeffe feefeffe feefeffe  
3fff29a0:  3fffdad0 00000000 3fff1996 4020726c  
3fff29b0:  3fffdad0 00000000 3fff1996 4022c130  
3fff29c0:  feefeffe feefeffe 3fff19b0 40100718  
<<<stack<<<

 ets Jan  8 2013,rst cause:4, boot mode:(3,7)

wdt reset
load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v7b32e6ad
~ld

Melvanimate - WS2812 control

The neopixel strip was not connected (data nor power) to the circuitry. So there should be no power issue.

Do you have any tips?

sticilface commented 7 years ago

you have to change it in the mybus.h file. not the sketch. for whatever reason it don't apply globally when it is just in the sketch. It should just work, I'm using it routinely!

sticilface commented 7 years ago

I can reproduce that. you must place the #define WS2812_FOUR_COLOR in the mybus.h file, or if you are compiling using platoformio then define it globally. Then it works fine. :)

codmpm commented 7 years ago

Not at home right now, but I will test it and get back to you.

One question about RGBW: Do you use the WarmWhite color or are you just calculating RGB and use it on the RGBW pixels without touching W?

codmpm commented 7 years ago

Worked as you stated. Added the define to mybus.h...

So the only things left is my question above and time I have to invest to get to know how to configure Melvanimate. I have to find a way to integrate it...

May I hit you up for upcoming questions?

sticilface commented 7 years ago

Of course.

So the rgbw support came a bit later and was kinda added on top. The answer to your question is that it depends. For most of the effects they are controlled using rgb only. There is an effect white, and sunrise that use the w component. Generally u have to treat them separately. Makuna has not implemented a conversion between rgb and w as depending on the type of w i.e. Warm white, cool white etc.

This is a very new addition so I'm open to questions etc and feel free to fire them my way

codmpm commented 7 years ago

Ok. I think I will have to use at least 2 ESP's to drive this mass of pixels. Also I'm still trying to understand how I can "create" own animation types (presets?). The first problem now is, that I need a solution to select the mode including color via http or mqtt. Selecting the presets via mqtt should be possible - I need time to test and investigate 😉

Is it possible to chain one or more esp's together? I think I've read something about this, but can't find it again.

Hope you will integrate RGBW more and more and I am absolutely willing to test.

Cheers