Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Support for WS2812B #25

Open
pigers opened this issue Aug 23, 2014 · 18 comments
Open

Support for WS2812B #25

pigers opened this issue Aug 23, 2014 · 18 comments

Comments

@pigers
Copy link

pigers commented Aug 23, 2014

Support for those LEDs would be very nice, as they are getting more more at market.
I have one strand to test ;)

@mrjono1
Copy link
Contributor

mrjono1 commented Aug 24, 2014

Hi pigers
I have not tested other LED types yet but it should work for many different LED types. In the Afterglow.ino file there is a section to change the LED type, below is the list of currently available options.

  • LPD6803 (currently selected)
  • TM1809
  • HL1606
  • 595
  • WS2801

If you change the option in the method setLEDChipSet() to WE2801 this might work for WS2812B, then upload this new version to the arduino.

We are using a library called fast spi to handle different LED types it is documented here https://code.google.com/p/fastspi/ and here https://github.com/FastLED/FastLED we are probably a few versions behind, if this option does not work for you we can look into updating to the latest version.

@pigers
Copy link
Author

pigers commented Aug 24, 2014

Hey Jono
I have tested attached .ino file with my 2812B leds and it won't work, leds are not showing what they are supposed to.

Yesterday I worked with newer version of FastLED and acheived blinking in blue&white rythm instead working correctly - looks like communication is working but there's problem with data received (at least I think).

Here's code I used for Arduino:
http://pastebin.com/nByXRXWM

Maybe there's something wrong with it.

@mrjono1
Copy link
Contributor

mrjono1 commented Aug 24, 2014

Your example is using 'A', 'd', 'a' as the 'prefix' it is currently expecting 'G', 'l', 'o' you can either change it to 'Glo' or change the Afterglow settings in the web interface to 'Ada'. This prefix is to ensure that the communication being received is intended for this the correct software. This means communication is being received but disregarded.

It sounds like I should update Afterglow to use FastLED

@pigers
Copy link
Author

pigers commented Aug 24, 2014

Im using "Ada" value in both AfterGlow and Ardunio code, so that's not an issue.

Yep, update is quite good, but I remember that newer fastLED wont work with older LEDs version, so it'd nice to have an copy for older ones.

@mrjono1
Copy link
Contributor

mrjono1 commented Sep 1, 2014

@pigers I have an old version of lights SPI_LPD6803 so if you are able to update to FastLED that would be great and I could create an Arduino release that for old lights like mine.

I think you need to add a buffer to the data being received, @spazzarama and I had issues so we added it. Without it we were getting strange colours, as the data was being received to fast and bits were being skipped causing incorrect colours.

@pigers
Copy link
Author

pigers commented Sep 1, 2014

@mrjono1 - could You post your code used for Arduino with that buffer ? Im playing with code for few hours without results.

After some code modifications I have get rid of frustrating blinking , I have spotted another problem, as for me there's no change in colour of LEDs despite changing background of my desktop.
I have switched to DirectX grab from XBMC, sadly didn't show any changes on LEDs.

Is there any chance to show what's AfterGlow pushing to COM port ?

@mrjono1
Copy link
Contributor

mrjono1 commented Sep 1, 2014

Opps I have not have documented that the Arduino code is also in this repo https://github.com/FrozenPickle/Afterglow/tree/master/Arduino

Afterglow is transmitting this to the COM port on each light change
serialData[0] = 'G'
serialData[1] = 'l'
serialData[2] = 'o'
serialData[3] = (byte)((50) >> 8); // LED count high byte
serialData[4] = (byte)((50) & 0xff); // LED count low byte
serialData[5] = (byte)(serialData[3] ^ serialData[4] ^ 0x55); // Checksum

lightData[0] = //light 1 R
lightData[1] = //light 1 G
lightData[2] = //light 1 B
lightData[3] = //light 2 R
lightData[4] = //light 2 G
lightData[5] = //light 2 B
lightData[6] = //light 3 R
lightData[7] = //light 3 G
lightData[8] = //light 3 B

//lightData can have a lot of data so we built the buffer to capture it as it is transmitted
serialData[6] = lightData;

When selecting a Capture Plugin it is good to know that only one or the other will work because of the way graphics processing is done. Most games and some media players use DirectX, windowed applications like browsers and most media players use the .Net Copy Screen. If you are able to run afterglow on your network and open it on your phone or tablet the preview will show if it works or not.

@pigers
Copy link
Author

pigers commented Sep 3, 2014

How do I purge settings of AfterGlow ? I extracted ZIP package but it read settings from somewhere and I cannot find this place.

@mrjono1
Copy link
Contributor

mrjono1 commented Sep 3, 2014

Settings are stored in "Environment.SpecialFolder.CommonApplicationData" / Afterglow / Afterglow.xml
on windows 7 and this is C:/ProgramData/Afterglow/Afterglow.xml, to reset the settings either delete it and the one in the application folder will automatically get moved to ProgramData or manually replace the xml file with one from the zip package or your own backup.

@pigers
Copy link
Author

pigers commented Sep 21, 2014

Back there

I have updated my Arduino code with FastLED to look similiar to your but it's not working now.
Grab code here: pigers.republika.pl/_backup/WS2812_static.zip
I have spotted one issue: when I update in Afterglow number of leds (to 30) after shutting down AG preview is not visible.

@mrjono1
Copy link
Contributor

mrjono1 commented Sep 24, 2014

I had a look at your code for while and it looks good to me, I haven't found any obvious issues.

Maybe call FastLED.Clear() in MODE_HEADER https://github.com/FastLED/FastLED/wiki/Basic-usage#bringing-in-external-controls this loop does it?

Most change that you do to the settings while running Afterglow will require that you start and stop the preview to make sure it gets the new settings. Also if you navigate away from the preview it should stop but afterglow should still be sending to the arduino.

@pigers
Copy link
Author

pigers commented Aug 3, 2015

I can confirm it's working nice with Win 7 : https://www.dropbox.com/s/de9h588qvdb15hz/WP_20150219_195811Z.mp4?dl=0

Now trying to cooperate with Windows 10. Keeps fingers crossed !

@mrjono1
Copy link
Contributor

mrjono1 commented Aug 4, 2015

pigers your vid looks great!

@justinstenning
Copy link
Contributor

Yeh that's looking great! Now I want to get mine up and running again :)

@pigers
Copy link
Author

pigers commented Aug 4, 2015

Unfortunetly on WIndows 10 it's not running correctly. I see some output on screen diagnostic (right screen) but no effect on LEDs. I see that led on Arduino is blinking (one responsible for data activity) but what's going on ... it requires more work to check.

Vid from Win 10 tests:
https://www.dropbox.com/s/ism3g5hdetnuizb/WP_20150804_182646Z.mp4?dl=0

@mrjono1
Copy link
Contributor

mrjono1 commented Aug 5, 2015

It could be the arduino driver for windows 10? I noticed that windows 10
auto installs divers but it didnt get the correct one for my video card
maybe you need to update it?

On Wed, Aug 5, 2015 at 4:45 AM, M0C [email protected] wrote:

Unfortunetly on WIndows 10 it's not running correctly. I see some output
on screen diagnostic (right screen) but no effect on LEDs. I see that led
on Arduino is blinking (one responsible for data activity) but what's going
on ... it requires more work to check.

Vid from Win 10 tests:
https://www.dropbox.com/s/ism3g5hdetnuizb/WP_20150804_182646Z.mp4?dl=0


Reply to this email directly or view it on GitHub
#25 (comment)
.

@pigers
Copy link
Author

pigers commented Aug 5, 2015

nope - i can program my arduino under Win 10
for example: https://www.dropbox.com/s/tfgytl18l7673v0/WP_20150806_192236Z.mp4?dl=0

@pigers
Copy link
Author

pigers commented Sep 3, 2015

Rolled back to Windows 7 - anyone got issue with Afterglow not showing settings in browser?
Example http://prntscr.com/8c9ta1 or better one with adress bar http://prntscr.com/8c9tnq

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants