Jump to content
Corsair Community

HowTo: HD120 RGB Custom Lighting Controller


Recommended Posts

It was giving me errors because I was trying to use it while running it in debug. I have never used Visual Studio before so the zip file worked great. So far the biggest bug I see is that it crashes when you apply settings, but they do apply. All the settings I tried on the fans worked great. The strips did not work as well, I am assuming because the modes are different so the command does not match the name. The strips did take the settings that I applied, just not the right mode so it was not actually what I chose. Thank you both for all your great work so far! I enjoyed the ease of Link, but the possibilities are endless with this setup if you know how to use it.

 

Ok, Visual Studio is a lot easy but, as for every software, the first time you have to invest a bit of time to get familiar with the development environment; if you have any questions don't esitate to ask.

 

Building features without the ability to try them is like a blindfold-jump :biggrin:; By reading the Charixfox firmware documentation I understand that the difference between fans and stripes is only the group number (fans 1 to 6, stripes 7 to 10), example:

 

sets BPM mode needs 4 parameters:

 

- fan number 1 needs the following command:

^1.0.6, #selected mode: BPM

^1.1.2, #BPM parameter

^1.2.200, #Hue multiplier parameter

^1.7.10 #Beat multiplier parameter

 

 

- stripe number 1 needs the following command:

^7.0.6, #selected mode: BPM

^7.1.2, #BPM parameter

^7.2.200, #Hue multiplier parameter

^7.7.10 #Beat multiplier parameter

 

that's exactly what the application does.

 

@Charixfox is that correct or I'm doing something wrong?

Link to comment
Share on other sites

  • Replies 271
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Ok, Visual Studio is a lot easy but, as for every software, the first time you have to invest a bit of time to get familiar with the development environment; if you have any questions don't esitate to ask.

 

Building features without the ability to try them is like a blindfold-jump :biggrin:; By reading the Charixfox firmware documentation I understand that the difference between fans and stripes is only the group number (fans 1 to 6, stripes 7 to 10), example:

 

sets BPM mode needs 4 parameters:

 

- fan number 1 needs the following command:

^1.0.6, #selected mode: BPM

^1.1.2, #BPM parameter

^1.2.200, #Hue multiplier parameter

^1.7.10 #Beat multiplier parameter

 

 

- stripe number 1 needs the following command:

^7.0.6, #selected mode: BPM

^7.1.2, #BPM parameter

^7.2.200, #Hue multiplier parameter

^7.7.10 #Beat multiplier parameter

 

that's exactly what the application does.

 

@Charixfox is that correct or I'm doing something wrong?

 

O.O Wow... This thread exploded when I wasn't paying attention and Corsair only alerts me once (which I missed).

 

There are not very many LED strip modes yet and they are not the same as fan modes. Aaaaaand... they're not documented. O.O *wince* Sorries...

 

Strip modes are 0 through 5, so 6 would not work. I really need to make the strip modes more robust....

 

Current firmware Strip modes:

0 = Hue Shift

Settings: 1 = Starting Hue; 2 = Ending Hue; 3 = Hue Offset; 5 = Phase Offset; 7 = Rate in BPM

 

1 = Single Color

Setting 1 = Hue

 

2 = Single Color Pulse

Settings 1 = Hue 7 = Rate

 

3 = Rainbow

Setting 7 = Run speed

 

4 = BPM

Settings 7 = Rate 1 = Hue Multiplier 2 = Beat Multiplier

 

5 = RGB Color

Settings: 1 = R 2 = G 3 = B

 

So my bad on both not making more strip thingies and also not documenting any of the strip thingies.

Link to comment
Share on other sites

O.O Wow... This thread exploded when I wasn't paying attention and Corsair only alerts me once (which I missed).

 

There are not very many LED strip modes yet and they are not the same as fan modes. Aaaaaand... they're not documented. O.O *wince* Sorries...

 

Strip modes are 0 through 5, so 6 would not work. I really need to make the strip modes more robust....

 

Current firmware Strip modes:

0 = Hue Shift

Settings: 1 = Starting Hue; 2 = Ending Hue; 3 = Hue Offset; 5 = Phase Offset; 7 = Rate in BPM

 

1 = Single Color

Setting 1 = Hue

 

2 = Single Color Pulse

Settings 1 = Hue 7 = Rate

 

3 = Rainbow

Setting 7 = Run speed

 

4 = BPM

Settings 7 = Rate 1 = Hue Multiplier 2 = Beat Multiplier

 

5 = RGB Color

Settings: 1 = R 2 = G 3 = B

 

So my bad on both not making more strip thingies and also not documenting any of the strip thingies.

 

 

Ok, I'll introduce stripes configuration in a separate way.

Link to comment
Share on other sites

Added a second tab to manage stripe settings; by clicking Apply button both Fans and Stripes settings are sent if the following conditions are met:

 

Fans:

- at least one Fan is selected

- effect is selected

 

Stripes:

- at least one Stripe is selected

- effect is selected

 

Attached zip contains the current version, GitHub is also updated

LedControllerEngine.zip

Link to comment
Share on other sites

Added a second tab to manage stripe settings; by clicking Apply button both Fans and Stripes settings are sent if the following conditions are met:

 

Fans:

- at least one Fan is selected

- effect is selected

 

Stripes:

- at least one Stripe is selected

- effect is selected

 

Attached zip contains the current version, GitHub is also updated

 

Thank you, I will test it out tonight.

Link to comment
Share on other sites

Hey, wow a lot going on here. Downloaded your app kubdotnet, looks really good (nice icon too). Haven't gotten a chance to run it on my system that has fans and lights but the interface is way cool, let me know if there's anything I can do to help. My LL120's came in this week and I hooked 3 up tonight, as kinda expected they're in serial and my last fan had no lights since the 4 new center lights of each fan took up 12 lights replacing the last fan. Seems like 16 leds/fan would require a fair amount of incompatible changes to the controller firmware, also tried to imagine how 12 fans (6 outer and 6 inner) would change things. It still wasn't pretty since there would be 6 fans with 12 lights and 6 with 4 lights. I dunno, let me know if you want to support LL120's charixfox. Yeah, I know they're lesser fans but with 6 should I even care? ;)

 

Once again, good stuff here. Thanks all.

Link to comment
Share on other sites

The LLs have 16 LEDs per fan, as I understand it. The primary consideration for the firmware is currently the lack of the ability to differentiate between the center four and the outer ring. Otherwise I think it might work "okay" with LedsPerFan set to 16 (I don't have the code in front of me right now, but I think I coded it to adjust. <.< I hope I did at least.)

 

The idea of making it look at each ring as a separate unit is also something to consider. My downside to being an individual working on the firmware with a full time job and all that fun means less time to work on firmware. That and I have no LL fans to test against. :/ Can't justify the cost of them right now either. T^T

 

I'm also not pleased that I lost the fan-groups code to a crash. That was quite a lot of work that went into the bit bucket. And you know how it is... research, build the necessary function, and then you're good so don't need the research anymore... Riiiight. *sigh*

 

Always so many things to do and so little time to do them.

Link to comment
Share on other sites

The LLs have 16 LEDs per fan, as I understand it. The primary consideration for the firmware is currently the lack of the ability to differentiate between the center four and the outer ring. Otherwise I think it might work "okay" with LedsPerFan set to 16 (I don't have the code in front of me right now, but I think I coded it to adjust. <.< I hope I did at least.)

 

The idea of making it look at each ring as a separate unit is also something to consider. My downside to being an individual working on the firmware with a full time job and all that fun means less time to work on firmware. That and I have no LL fans to test against. :/ Can't justify the cost of them right now either. T^T

 

I'm also not pleased that I lost the fan-groups code to a crash. That was quite a lot of work that went into the bit bucket. And you know how it is... research, build the necessary function, and then you're good so don't need the research anymore... Riiiight. *sigh*

 

Always so many things to do and so little time to do them.

 

You did put an leds per fan line in the code, so it would be easy to change that part. It looks like most of the effects would work fine as well since they all use the leds per fan code.

 

That really sucks about the crash. I appreciate all the work you have put into this and cant wait to see what kind of things can be done with it!

 

kubdotnet: Is it just me or does the program crash whenever you apply settings to the fans or strips? I have tried your latest version, and the first effect I tried on the strips was just a red rgb setting. It crashed but sent the settings and worked, but after that I couldnt not get it to take any other strip setting without doing it in the arduino serial monitor.

Link to comment
Share on other sites

Hey, wow a lot going on here. Downloaded your app kubdotnet, looks really good (nice icon too). Haven't gotten a chance to run it on my system that has fans and lights but the interface is way cool, let me know if there's anything I can do to help. My LL120's came in this week and I hooked 3 up tonight, as kinda expected they're in serial and my last fan had no lights since the 4 new center lights of each fan took up 12 lights replacing the last fan. Seems like 16 leds/fan would require a fair amount of incompatible changes to the controller firmware, also tried to imagine how 12 fans (6 outer and 6 inner) would change things. It still wasn't pretty since there would be 6 fans with 12 lights and 6 with 4 lights. I dunno, let me know if you want to support LL120's charixfox. Yeah, I know they're lesser fans but with 6 should I even care? ;)

 

Once again, good stuff here. Thanks all.

 

 

Have you tried changing this to 16 to see if that makes all the fans light up?

Capturefan.thumb.JPG.6f891ff833389827260a2fbd9b44c753.JPG

Link to comment
Share on other sites

Hey, wow a lot going on here. Downloaded your app kubdotnet, looks really good (nice icon too). Haven't gotten a chance to run it on my system that has fans and lights but the interface is way cool, let me know if there's anything I can do to help. My LL120's came in this week and I hooked 3 up tonight, as kinda expected they're in serial and my last fan had no lights since the 4 new center lights of each fan took up 12 lights replacing the last fan. Seems like 16 leds/fan would require a fair amount of incompatible changes to the controller firmware, also tried to imagine how 12 fans (6 outer and 6 inner) would change things. It still wasn't pretty since there would be 6 fans with 12 lights and 6 with 4 lights. I dunno, let me know if you want to support LL120's charixfox. Yeah, I know they're lesser fans but with 6 should I even care? ;)

 

Once again, good stuff here. Thanks all.

 

Thank you, there is still a lot to do and my goal is very ambitious.

 

 

 

kubdotnet: Is it just me or does the program crash whenever you apply settings to the fans or strips? I have tried your latest version, and the first effect I tried on the strips was just a red rgb setting. It crashed but sent the settings and worked, but after that I couldnt not get it to take any other strip setting without doing it in the arduino serial monitor.

 

I do not know ... but it seems to be related to something that has nothing to do with board communications...

 

I fixed some bugs and added a bit of logging; try the attached version (as always GitHub is aligned) and the next time it crashes please pm me your log file; log files are in the folder "%appdata%\LedControllerEngine\logging" (Windows 7/8/10 by default is "c:\Users\<your name>\AppData\Roaming\LedControllerEngine\logging").

 

Thank you

LedControllerEngine.zip

Link to comment
Share on other sites

Thank you, there is still a lot to do and my goal is very ambitious.

 

 

 

 

 

I do not know ... but it seems to be related to something that has nothing to do with board communications...

 

I fixed some bugs and added a bit of logging; try the attached version (as always GitHub is aligned) and the next time it crashes please pm me your log file; log files are in the folder "%appdata%\LedControllerEngine\logging" (Windows 7/8/10 by default is "c:\Users\<your name>\AppData\Roaming\LedControllerEngine\logging").

 

Thank you

 

Thanks for the update! This version is working much better so far. I can apply settings to the fans and strips without crashing, and the modes all seem to work correctly.

Link to comment
Share on other sites

Have you tried changing this to 16 to see if that makes all the fans light up?
c

 

Yup, tried that right after I last posted. (and then fell asleep :zzzzzzzz:) All the fans do light up. Here's what I've found out.

 

LL120 info

The center leds are 1-4 and outer are 5-16.

The leds on the outer loop are sequenced differently, from the front the 1st

led is at 10 o'clock, on the HD120's the 1st led is at 2 o'clock. The first

attachment shows the difference, red is the 1st led, green 2nd, blue 3rd

and yellow 4th. Yeah the pic's bad. (unfortunately the transition from red

to green is more yellow than the yellow color) Both fans increment

counter clockwise.

 

So short of dealing with the center loop and sides/quarters it's not too bad of a change. 'course the devil's in the details.

 

I've played with some code to implement fan types to allow for number of led's per fan, offset of outer ring and identifying the type at run time. Hope you don't mind Charixfox. It's really prototype as a proof of concept but the second pic shows it's sort of working. I'll keep going as long as it's ok, I don't want to step on any toes. A very nice code base to work with, good job Charixfox.

 

Lemme know if I should keep going..

20171028_202345.thumb.jpg.f3c930320a37ae224c3be39664294041.jpg

20171028_202258.thumb.jpg.a12b96a163f019e22f3eeaf911a19c6d.jpg

Link to comment
Share on other sites

c

The leds on the outer loop are sequenced differently, from the front the 1st

led is at 10 o'clock, on the HD120's the 1st led is at 2 o'clock. The first

attachment shows the difference, red is the 1st led, green 2nd, blue 3rd

and yellow 4th. Yeah the pic's bad. (unfortunately the transition from red

to green is more yellow than the yellow color) Both fans increment

counter clockwise.

 

So short of dealing with the center loop and sides/quarters it's not too bad of a change. 'course the devil's in the details.

 

I've played with some code to implement fan types to allow for number of led's per fan, offset of outer ring and identifying the type at run time. Hope you don't mind Charixfox. It's really prototype as a proof of concept but the second pic shows it's sort of working. I'll keep going as long as it's ok, I don't want to step on any toes. A very nice code base to work with, good job Charixfox.

 

Lemme know if I should keep going..

 

Development is always welcome. That's why I have it on GitHub. :)

 

So it sounds like the initial data line goes to the hub from the upper right spoke, then goes to the ring along the upper left spoke. Incoming wire is still on the upper portion of the right side there, not on the left portion of the top side? Meh. Hardware.

 

There's a limit to what can be defined at runtime. The CRGBArrays all need to exist in the correct size at compile time, for example, they cannot be defined dynamically. Grouping was running up against the memory limits of the controller the first time I designed it when I had dynamically-allocated memory. Can't play fast and loose with that with a limit of 2560 bytes.

 

There's a new branch with some improvements and other such items, including some unfinished code on the GitHub. Feel free to push a new branch, or look at the latest branch that hasn't been merged.

 

@kubdotnet -

You will also want to take a peek at the developments in the unmerged branch since it changes one set of fan settings and adds several strip settings. It's very much not final, mind you, but good to know.

 

Would a way to query the controller for its firmware version be a benefit to you? Not necessarily needing to support many different firmware versions, but rather be able to decline to work on the wrong version of firmware.

Link to comment
Share on other sites

Development is always welcome. That's why I have it on GitHub. :)

 

There's a limit to what can be defined at runtime. The CRGBArrays all need to exist in the correct size at compile time, for example, they cannot be defined dynamically.

 

Thanks man, I'll try to push a branch in the morning. Excessive use of constexpr from C++11 (which at least the lasted arduino compiler supports, not sure of previous releases) allowed some nice compile time magic for static array sizing keeping the diffs to the master branch minimal. Still very early on, not happy with memory usage and still things I can't explain but that may be the nature of how I implemented the changes. I'll grab your latest from github so the merge won't be too bad in the future.

 

Also, sortry about your code loss. Have you tried using VS with vMicro under windows? Made development a lot easier than arduino IDE and makes it easy to restore unsaved changes in case of a crash.

 

@kubdotnet your software has made testing and experimentation way better. smarter, faster. Have you thought about making it a VS extension? If nothing else you could share the com port so changes to firmware don't require shutting down the LedControllerEngine to upload firmware changes. Maybe just my current workflow and wouldn't be as useful in the future.

Link to comment
Share on other sites

@kubdotnet your software has made testing and experimentation way better. smarter, faster. Have you thought about making it a VS extension? If nothing else you could share the com port so changes to firmware don't require shutting down the LedControllerEngine to upload firmware changes. Maybe just my current workflow and wouldn't be as useful in the future.

 

My goal is to have a software running in background where users can compose sequences of animations and that software let the animation switches at scheduled times/timespan/timeout.

 

I made a little change that closes serial port after the commands are sent; so you can do everything you need without closing and reopening the application :):

LedControllerEngine.zip

Link to comment
Share on other sites

Thanks man, I'll try to push a branch in the morning. Excessive use of constexpr from C++11 (which at least the lasted arduino compiler supports, not sure of previous releases) allowed some nice compile time magic for static array sizing keeping the diffs to the master branch minimal. Still very early on, not happy with memory usage and still things I can't explain but that may be the nature of how I implemented the changes. I'll grab your latest from github so the merge won't be too bad in the future.

 

There are probably a few more strip modes to add, and definitely one to delete (No reason to have both a static hue and a static RGB).

 

Program (flash) memory use is very much impacted by how the compiler behavior and code order. The difference between using a function to pull a value from an array into a variable that is then used in another function and nesting the initial function or array into the main function can be hundreds of bytes of machine code.

 

However if you're encountering odd behavior, it's possible that the FastLED claim of "We really, -really- need to know precisely where the CRGBArrays are and the LED handling is at compile time, because we use a lot of ASM wizardry to make this thing actually 'fast'." could be coming into play.

 

Also, sortry about your code loss. Have you tried using VS with vMicro under windows? Made development a lot easier than arduino IDE and makes it easy to restore unsaved changes in case of a crash.

 

Does that compile and upload directly to the Arduino or does it still need to be sent to the Arduino IDE? I'm willing to take a look if I have better direction than just mention. I'll see if Google can decide to let me find anything helpful.

 

@kubdotnet your software has made testing and experimentation way better. smarter, faster. Have you thought about making it a VS extension? If nothing else you could share the com port so changes to firmware don't require shutting down the LedControllerEngine to upload firmware changes. Maybe just my current workflow and wouldn't be as useful in the future.

 

For both of you, DevEntropy and kubdotnet, I'm wondering if this if a good time to consider working out USB-HID-based control so the Serial remains free. My concern about this idea is that if done wrong it will very happy lock down the Arduino into a non-updatable state. I believe that if the modified HID code is called after a standard 2-second delay for the bootloader, it may be okay..I know the IDE and the flasher for a Leonardo-style board both work at certain things faster than Windows shows updates of. Though rebooting an Arduino from internal code is hit or miss depending on the bootloader. I'd have to find a spare board and see if I can get HID code and Serial working at the same time.

 

I'm starting to feel outclassed code-wise. Which is fine. I tinker and know enough to get myself in trouble. ^.^;

Link to comment
Share on other sites

Hi

 

i wanted to ask, did you use Corsair RGB fan LED HUB with the arduino or arduino by itself?

 

The hub is needed, yes. The Arduino replaces the three button controller that plugs in to the data end of the hub. The hub itself has nothing but interconnection for the fans for data and power, and a small capacitor to smooth out the power.

 

You could technically wire things up manually without the hub, but it would be an absolute pain.

Link to comment
Share on other sites

The hub is needed, yes. The Arduino replaces the three button controller that plugs in to the data end of the hub. The hub itself has nothing but interconnection for the fans for data and power, and a small capacitor to smooth out the power.

 

You could technically wire things up manually without the hub, but it would be an absolute pain.

 

yeah it would, i just wanted to make sure. :)

thanks for the answer.

Link to comment
Share on other sites

TDoes that compile and upload directly to the Arduino or does it still need to be sent to the Arduino IDE? I'm willing to take a look if I have better direction than just mention. I'll see if Google can decide to let me find anything helpful.

 

For both of you, DevEntropy and kubdotnet, I'm wondering if this if a good time to consider working out USB-HID-based control so the Serial remains free. My concern about this idea is that if done wrong it will very happy lock down the Arduino into a non-updatable state. I believe that if the modified HID code is called after a standard 2-second delay for the bootloader, it may be okay..I know the IDE and the flasher for a Leonardo-style board both work at certain things faster than Windows shows updates of. Though rebooting an Arduino from internal code is hit or miss depending on the bootloader. I'd have to find a spare board and see if I can get HID code and Serial working at the same time.

 

I believe the arduino IDE is required, there is a pull down for Visual Micro (No IDE) but I haven't used it. But once you setup the arduino IDE you'll never even know it's there while you're in VS. The serial monitor is much better along with the editing and other improvements provided by VS.

 

You know a whole lot more about arduino than I do, so I'll be happy to follow your lead on USB-HID vs or in addition to a serial port. Let me know if I can help.

Link to comment
Share on other sites

I believe the arduino IDE is required, there is a pull down for Visual Micro (No IDE) but I haven't used it. But once you setup the arduino IDE you'll never even know it's there while you're in VS. The serial monitor is much better along with the editing and other improvements provided by VS.

 

You know a whole lot more about arduino than I do, so I'll be happy to follow your lead on USB-HID vs or in addition to a serial port. Let me know if I can help.

 

I'll have to see what I can find in VS then. I need to make sure not to get too complacent though. The Arduino IDE does lovely things like updating libraries and such, and I also need to make sure I maintain a good understanding of how the normal IDE works for when I need to direct people in its use. ... Unless I end up just packaging Arduino binaries and the loader. <.<

 

I'm hoping that it will work alongside a serial port, since having backward compatibility is a good. The main complication I have in developing this though is the lack of ability to create and read USB-HID packets on the computer side. *Goes hunting for something to do that*

Link to comment
Share on other sites

I'll have to see what I can find in VS then. I need to make sure not to get too complacent though. The Arduino IDE does lovely things like updating libraries and such, and I also need to make sure I maintain a good understanding of how the normal IDE works for when I need to direct people in its use. ... Unless I end up just packaging Arduino binaries and the loader. <.<

 

I'm hoping that it will work alongside a serial port, since having backward compatibility is a good. The main complication I have in developing this though is the lack of ability to create and read USB-HID packets on the computer side. *Goes hunting for something to do that*

 

 

Apologize, I'm a bit busy atm :laughing:.

 

I quickly tried the library HIDLib (https://github.com/mikeobrien/HidLibrary) but I was unable to find the device and also by looking on Device Manager I see Arduino under Ports but I didn't find it under USB controllers: Any ideas?

 

I will do some tests as soon as I have time :):

Link to comment
Share on other sites

Apologize, I'm a bit busy atm :laughing:.

 

I quickly tried the library HIDLib (https://github.com/mikeobrien/HidLibrary) but I was unable to find the device and also by looking on Device Manager I see Arduino under Ports but I didn't find it under USB controllers: Any ideas?

 

I will do some tests as soon as I have time :):

 

Quite busy myself too, so no worries.

 

HID processing with the default library requires that the library to be modified to allow the Arduino to read data sent to it, otherwise it can only generate data to the computer and that would not be too useful.

 

It's important to be very careful if any third party libraries are used that are not part of the core Arduino IDE setup, since people still need to currently download and compile the code themselves. Still might be of value to package the Arduino flasher and support stuff and just make an installer at this rate. *sheesh*

 

I'll take a look at the library you indicated, since anything working is better than nothing working. :)

Link to comment
Share on other sites


×
×
  • Create New...