mtongnz / ESP8266_ArtNetNode_v2

ESP8266 based WiFi ArtNet to DMX, RDM and LED Pixels
GNU General Public License v3.0
605 stars 159 forks source link

Sk6812 led pixels #42

Open Bensmall opened 7 years ago

Bensmall commented 7 years ago

Hi is it possible to implement the use of sk6812 pixels (same as ws2812b but rgbw Insted of rgb) as you get exactly 128 pixels per 512 dmx channels as configured for ws2812b only uses 510 dmx channels for 170 pixel Many thanks Ben

kaeltaz commented 7 years ago

zrzut ekranu 201

mtongnz commented 7 years ago

Thanks @kaeltaz. Donations are much appreciated and allow me to purchase more bits for testing. I have actually received a couple of donations in the last few days which I've used to purchase a strip of RGBW SK2812 LEDs.

I'll try to get this implemented for the next beta release so it can get tested by everyone before the final release. The hardest bit is going to be updating the Pixel FX engine - it was designed for RGB, not RGBW so may be a bit of a challenge but we'll see how it goes.

mtongnz commented 7 years ago

Implementing this is not quite as simple as I'd hoped - mainly due to the Pixel FX code being a bit sloppy. I'll be releasing the source soon with a couple of rewards up for grabs for people who fix a few of the issues. This will be one of the issues with a reward - it'll be one of the prototype boards I'm working on.

Bensmall commented 7 years ago

hi just having a think when using the code for controlling 8 universes of pixels does that allow me to use the full 8 universes worth of channels or is it just the 12 channels for pixel fx ? and could it be that with the sk6812 it uses just 8 universes with of channels if the fx code being a bit of a pain with the sk6812 ? many thanks Ben

On Mon, Mar 27, 2017 at 4:41 AM, Matt notifications@github.com wrote:

Implementing this is not quite as simple as I'd hoped - mainly due to the Pixel FX code being a bit sloppy. I'll be releasing the source soon with a couple of rewards up for grabs for people who fix a few of the issues. This will be one of the issues with a reward - it'll be one of the prototype boards I'm working on.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mtongnz/ESP8266_ArtNetNode_v2/issues/42#issuecomment-289346977, or mute the thread https://github.com/notifications/unsubscribe-auth/ANo52w9gzklNvykKRmqFguGU2y23pKGIks5rpzAHgaJpZM4MRDtX .

Deadeye5589 commented 6 years ago

What are the current problems with the implementation of this feature? Still trouble with the fx code or is it the driver itself?

mtongnz commented 6 years ago

The driver will just need the timings tweaked for it to work. The FX code needs to be re-written a fair bit for it to work. I haven't had time to play with the SK6812 strips yet so haven't seen how much will need to be done. Feel free to have a play with ws2812Driver.cpp and see if you can get the timings working.

Bensmall commented 6 years ago

Okay will give it a go just need some time off work to have a play lol

On 10 Oct 2017 06:33, "Matt" notifications@github.com wrote:

The driver will just need the timings tweaked for it to work. The FX code needs to be re-written a fair bit for it to work. I haven't had time to play with the SK6812 strips yet so haven't seen how much will need to be done. Feel free to have a play with ws2812Driver.cpp and see if you can get the timings working.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mtongnz/ESP8266_ArtNetNode_v2/issues/42#issuecomment-335365604, or mute the thread https://github.com/notifications/unsubscribe-auth/ANo52za_q5SXoT59XM5gx_P-Yx7u2y2Eks5sqwG-gaJpZM4MRDtX .

Deadeye5589 commented 6 years ago

Timing should not be that much of an issue, since they are very similar between WS and SK LEDs. For both WS and SK the timing deviation is +/- 0.15µs. If your program has a tighter tolerance there is a good chance to have the SK LED running without modifications to the timing.

image

Bensmall commented 6 years ago

The only issue I had when using sk6812 on ws2812 timing is that when using more than one universe of them the seconds one is 2 channels behind as 170 ws2812 pixels use 510 dmx channels and then the last 2 dmx channels are skipped, but with sk6812 128 pixels use 512 dmx channels so when using more than 128 pixels there is issues, all that needs doing really is to tell the code to use all 512 channels per universe of artnet and output it as spi data for the pixels :)

On 11 Oct 2017 08:10, "Deadeye5589" notifications@github.com wrote:

Timing should not be that much of an issue, since they are very similar between WS and SK LEDs. For both WS and SK the timing deviation is +/- 0.15µs. If your program has a tighter tolerance there is a good chance to have the SK LED running without modifications to the timing.

[image: image] https://user-images.githubusercontent.com/22077414/31426518-f682fa4a-ae63-11e7-842d-2cda9ee25eae.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mtongnz/ESP8266_ArtNetNode_v2/issues/42#issuecomment-335706625, or mute the thread https://github.com/notifications/unsubscribe-auth/ANo526bH4yHnrwQz5IB-FVfDlu00SJm8ks5srGn2gaJpZM4MRDtX .

Deadeye5589 commented 6 years ago

I finally had some time to look deeper into the code. After some problems understanding the structure of the code I'm now on my way to rewrite the ws2812 driver into a new class and rework of all of the function calls to distinguish between ws2812 and sk6812 LEDs. My biggest problem right now is understanding the Assembler code. Lets see if I can figure out how to modify the timing because my sk6812 strip won't work on the ws2812 timings.

Deadeye5589 commented 6 years ago

Hmm Arduino is blocking any progress on this. For some reasons the commented lines regarding the SK6812 will prevent the compilation of the project

void doStatusLedOutput() { uint8_t a[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0};

if (!statusLedsOff) { if (statusLedsDim) { for (uint8_t x = 0; x < 9; x++) a[x] = statusLedData[x] & STATUS_DIM; } else { for (uint8_t x = 0; x < 9; x++) a[x] = statusLedData[x]; } }

ifdef STATUS_LED_MODE_APA106

pixDriver.doAPA106(&a[0], STATUS_LED_PIN, 9);

endif

ifdef STATUS_LED_MODE_WS2812

pixDriver.doPixel(&a[0], STATUS_LED_PIN, 9);

endif

// No more space available after this ???? // #ifdef STATUS_LED_MODE_SK6812 // skpixDriver.doPixel(&a[0], STATUS_LED_PIN, 9); // #endif

// Tint LEDs red slightly - they'll be changed back before being displayed if no errors for (uint8_t x = 1; x < 9; x += 3) statusLedData[x] = 125; }

void setStatusLed(uint8_t num, uint32_t col) { memcpy(&statusLedData[num*3], &col, 3); }

The compiler error stated that the text' will not fit in region `iram1_0_seg but I don't see why this small change should use up all of the remaining resources. The original code only used 31% percent of the available program memory and 57% of dynamic memory.

Deadeye5589 commented 6 years ago

Good news,

both SK6812 and WS2812 LEDs are working with the same timings. Seems that the node was not working correctly when I first tried the SK leds. So the only thing that must be realized is the channel mapping 3 for ws and 4 for sk. Still I can't figure out why the chip should ran out of memory by adding a sk6812 class.