Corsair RMi, HXi, AXi PSU Statistics - CyanLabs's fork


Fma965

Recommended Posts

1 hour ago, b3rs3rk said:

 

@Fma965


https://github.com/CyanLabs/corsairpsu-unraid/blob/224941e4e1f056decc07d1e422eb7c75c0019ae0/src/corsairpsu/usr/local/emhttp/plugins/corsairpsu/status.page#L97
 

That line is your problem.  You're looking for $update in PHP to be true but in 6.9.0 and up that variable is either not set (NULL) or set to false from the UnRAID code.  What I did for my plugin is allowed to the user to decide if they want it to automatically refresh while the dashboard is open or not and then checked that variable since I knew it would always be there.  But there are reasons (like log spam from a weird Nvidia issue) for doing that in my case that might not make sense in yours.  If you just want it to update regardless I would either get rid of that IF conditional or set $update in PHP to be true somewhere above that JavaScript portion of your page file.

https://github.com/b3rs3rk/gpustat-unraid/blob/f82c490d0d5f24d8777310aeaf9f7241d086a0dd/src/gpustat/usr/local/emhttp/plugins/gpustat/gpustatus.page#L234

Thanks, but i don't have time to investigate this currently so someone can PR me if they want or i will look when i can

Link to comment
On 3/5/2021 at 9:19 AM, Fma965 said:

Thanks, but i don't have time to investigate this currently so someone can PR me if they want or i will look when i can

 

Opened the PR for the fix.  Tested on my own install to verify it was working and not getting any errors in developer console.  All you should have to do is merge, run mkpkg, commit and push.

  • Like 1
Link to comment
10 minutes ago, Fma965 said:

it doesn't seem to work though


When I look at the files from git (comparing with what comes out of your pkg file), it is saying there are CRLF line endings in them.  In my source tree (local branch) where I made the changes I only have LF endings and by default PhpStorm doesn't commit anything with CRLF.  In fact, it warns you if you attempt to do that.  CRLF line endings will cause all of the .page rendering to fail.  When I updated my plugin after you pushed, it all stopped working.  Didn't even show up as a page in Settings anymore.

I'd make sure whatever machine you're using to run the mkpkg script and doing the git commit from has:

 

git config --global core.autocrlf input


set.

Edited by b3rs3rk
Wrong CRLF setting
Link to comment

I can confirm that if I pull the two .page files from my branch where I committed the change and dump them back to my UnRAID, everything works properly again.  If I pull the two .page files from your pkg file and use those, everything fails.

 

EDIT:  When I download and open the .page files from your master branch (which is merged with my changes) in Notepad++ and enable View -> Show Symbol -> Show End of Line all I see is LF endings which is good.  If I download the latest PKG file from your master branch, extract, and open the same .page files all line endings show as CRLF.  So somewhere in the mkpg and/or commit process you're introducing CRLF endings.

Edited by b3rs3rk
Additional info
  • Like 1
Link to comment
9 minutes ago, bastl said:

@Fma965 With Unraid Update 6.9.0 and next point release 6.9.1 Your plugin stopped working for me. Nothing changed. I use a H1200i and never had an issue before showing the stats on the dashboard. Any idea how to troubleshoot and to fix it?

 

grafik.png.e0e11edfaeed38c1bcf0f093b4bf4838.png

 

grafik.png.7bb3202fdbcf3ffe5392b568c57468c4.png

 

Have you tried unplug and replug usb to psu, just on the off chance it may work.

Link to comment
3 minutes ago, turnipisum said:

Have you tried unplug and replug usb to psu, just on the off chance it may work.

Not sure if this will fix it. Will try. But it looks like its stil recognized. Not sure if the a different USB Bus changes something. The ID (1c08) is the same.

 

Unbenannt.png.0c50d236ee016e7828be1991597c71a8.png

 

Unbenannt2.png.740e27b7389af061be0cd047b2bdbaea.png

 

Link to comment
  • 5 weeks later...
On 1/15/2020 at 2:41 AM, Fma965 said:

Guys i need more peoples AX outputs to be able to fully determine what values are important etc if you have a AX psu download the compiled binary above and send me a text copy of the applications output like above.

 

@FranciumF @buggex @cpthzrd


Hi @Fma965
I haven't had a chance to read through the whole thread.
I have a Corsair AX1600i and I haven't managed to get this plugin working. I'm not sure if I have to add something to the device context? I have had it working while passed through to a VM and the USB header is connected to my server.
Not sure how to get this binary code that you would need either?

Cheers
skidaddl3

Link to comment
15 hours ago, skidaddl3 said:


Hi @Fma965
I haven't had a chance to read through the whole thread.
I have a Corsair AX1600i and I haven't managed to get this plugin working. I'm not sure if I have to add something to the device context? I have had it working while passed through to a VM and the USB header is connected to my server.
Not sure how to get this binary code that you would need either?

Cheers
skidaddl3

it uses a different protocol this won't work.

Link to comment
  • 3 months later...

Hi,

I made some changes to add the efficiency on my PS.
I found a python version that include the metrics to calculate the efficiency, so I add this on the PHP.

https://github.com/liquidctl/liquidctl/blob/main/liquidctl/driver/corsair_hid_psu.py

 

the code:

    $output_power = round($data['total watts']);
    $input_voltage = round($data['supply volts']);
    $fpowin115 = 0.000122800024680 * $output_power * $output_power + 1.0159421430340847 * $output_power + 13.555472968718759;
    $fpowin230 = 0.000088160542548 * $output_power * $output_power + 1.0234738318592156 * $output_power + 10.832902491655597;
    $est_input_power = $fpowin115 + ($fpowin230 - $fpowin115) / 115 * ($input_voltage - 115);
    $efficiency = round($output_power * 100 / $est_input_power);

 

 

SPOILER_unknown.png

Edited by eontech
Link to comment
1 hour ago, eontech said:

Hi,

I made some changes to add the efficiency on my PS.
I found a python version that include the metrics to calculate the efficiency, so I add this on the PHP.

https://github.com/liquidctl/liquidctl/blob/main/liquidctl/driver/corsair_hid_psu.py

 

the code:


    $output_power = round($data['total watts']);
    $input_voltage = round($data['supply volts']);
    $fpowin115 = 0.000122800024680 * $output_power * $output_power + 1.0159421430340847 * $output_power + 13.555472968718759;
    $fpowin230 = 0.000088160542548 * $output_power * $output_power + 1.0234738318592156 * $output_power + 10.832902491655597;
    $est_input_power = $fpowin115 + ($fpowin230 - $fpowin115) / 115 * ($input_voltage - 115);
    $efficiency = round($output_power * 100 / $est_input_power);

 

 

SPOILER_unknown.png

Nice work, send a PR and i'll merge it, maybe have a option to toggle it on or off though? 

Link to comment
On 7/17/2021 at 10:59 PM, Fma965 said:

Nice work, send a PR and i'll merge it, maybe have a option to toggle it on or off though? 

 

Hi again, I think I made the PR. Its my first time, so let me know if I've do it right.

I don't know how to add the option to toggle it :P any tips?

 

btw, I added the estimation for 8 PSU, RMi and HX, I've tested with my RM850i and with an unknown, to check that don't fail to the rest of the users.

Please let me know if anyone can check with others PSU.

Thanks

Edited by eontech
added what I've done
Link to comment
7 hours ago, eontech said:

 

Hi again, I think I made the PR. Its my first time, so let me know if I've do it right.

I don't know how to add the option to toggle it :P any tips?

 

btw, I added the estimation for 8 PSU, RMi and HX, I've tested with my RM850i and with an unknown, to check that don't fail to the rest of the users.

Please let me know if anyone can check with others PSU.

Thanks

image.png.51fbd2a16aa044b5d5fd831af5dc9800.png

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.