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


Fma965

Recommended Posts

7 hours ago, dwarfer said:

These are my usb devices

 

root@Tower:/sys/bus/usb/drivers/usbhid# lsusb
Bus 006 Device 003: ID 05e3:0626 Genesys Logic, Inc. USB3.1 Hub
Bus 006 Device 002: ID 05e3:0620 Genesys Logic, Inc. USB3.1 Hub
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 004: ID 413c:2107 Dell Computer Corp. 
Bus 005 Device 003: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 005 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 174c:3074 ASMedia Technology Inc. ASM1074 SuperSpeed hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 1b1c:1c11 Corsair USB API
Bus 001 Device 002: ID 174c:2074 ASMedia Technology Inc. ASM1074 High-Speed hub
Bus 001 Device 008: ID 0b05:18b8 ASUSTek Computer, Inc. Channel AURA MOTHERBOARD
Bus 001 Device 007: ID 8087:0025 Intel Corp. 
Bus 001 Device 006: ID 051d:0003 American Power Conversion UPS
Bus 001 Device 005: ID 090c:1000 Silicon Motion, Inc. - Taiwan (formerly Feiya Technology Corp.) Flash Drive
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

 

Here is what I have under /sys/bus/usb/drivers

 

root@Tower:/sys/bus/usb/drivers# ls -al
total 0
drwxr-xr-x 9 root root 0 Jan  7 13:31 ./
drwxr-xr-x 4 root root 0 Jan  7 13:31 ../
drwxr-xr-x 2 root root 0 Jan  7 13:31 btusb/
drwxr-xr-x 2 root root 0 Jan  7 13:31 hub/
drwxr-xr-x 2 root root 0 Jan  7 13:31 synaptics_usb/
drwxr-xr-x 2 root root 0 Jan  7 13:31 usb/
drwxr-xr-x 2 root root 0 Jan  7 13:31 usb-storage/
drwxr-xr-x 2 root root 0 Jan  7 13:31 usbfs/
drwxr-xr-x 2 root root 0 Jan  7 13:31 usbhid/
root@Tower:/sys/bus/usb/drivers# cd btusb
root@Tower:/sys/bus/usb/drivers/btusb# ls -al
total 0
drwxr-xr-x 2 root root    0 Jan  7 13:31 ./
drwxr-xr-x 9 root root    0 Jan  7 13:31 ../
lrwxrwxrwx 1 root root    0 Jan 22 12:01 1-13:1.0 -> ../../../../devices/pci0000:00/0000:00:14.0/usb1/1-13/1-13:1.0/
lrwxrwxrwx 1 root root    0 Jan 22 12:01 1-13:1.1 -> ../../../../devices/pci0000:00/0000:00:14.0/usb1/1-13/1-13:1.1/
--w------- 1 root root 4096 Jan 22 12:01 bind
lrwxrwxrwx 1 root root    0 Jan 22 12:01 module -> ../../../../module/btusb/
-rw-r--r-- 1 root root 4096 Jan 22 12:01 new_id
-rw-r--r-- 1 root root 4096 Jan 22 12:01 remove_id
--w------- 1 root root 4096 Jan  7 13:31 uevent
--w------- 1 root root 4096 Jan 22 12:01 unbind
root@Tower:/sys/bus/usb/drivers/btusb# cd ../hub
root@Tower:/sys/bus/usb/drivers/hub# ls -al
total 0
drwxr-xr-x 2 root root    0 Jan  7 13:31 ./
drwxr-xr-x 9 root root    0 Jan  7 13:31 ../
lrwxrwxrwx 1 root root    0 Jan  7 13:47 1-0:1.0 -> ../../../../devices/pci0000:00/0000:00:14.0/usb1/1-0:1.0/
lrwxrwxrwx 1 root root    0 Jan  7 13:47 1-6:1.0 -> ../../../../devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6:1.0/
lrwxrwxrwx 1 root root    0 Jan  7 13:47 2-0:1.0 -> ../../../../devices/pci0000:00/0000:00:14.0/usb2/2-0:1.0/
lrwxrwxrwx 1 root root    0 Jan  7 13:47 2-6:1.0 -> ../../../../devices/pci0000:00/0000:00:14.0/usb2/2-6/2-6:1.0/
lrwxrwxrwx 1 root root    0 Jan  7 13:47 3-0:1.0 -> ../../../../devices/pci0000:00/0000:00:1c.0/0000:03:00.0/usb3/3-0:1.0/
lrwxrwxrwx 1 root root    0 Jan  7 13:47 4-0:1.0 -> ../../../../devices/pci0000:00/0000:00:1c.0/0000:03:00.0/usb4/4-0:1.0/
lrwxrwxrwx 1 root root    0 Jan  7 13:47 5-0:1.0 -> ../../../../devices/pci0000:c0/0000:c0:00.0/0000:c1:00.2/usb5/5-0:1.0/
lrwxrwxrwx 1 root root    0 Jan  7 13:47 5-2.1:1.0 -> ../../../../devices/pci0000:c0/0000:c0:00.0/0000:c1:00.2/usb5/5-2/5-2.1/5-2.1:1.0/
lrwxrwxrwx 1 root root    0 Jan  7 13:47 5-2:1.0 -> ../../../../devices/pci0000:c0/0000:c0:00.0/0000:c1:00.2/usb5/5-2/5-2:1.0/
lrwxrwxrwx 1 root root    0 Jan  7 13:47 6-0:1.0 -> ../../../../devices/pci0000:c0/0000:c0:00.0/0000:c1:00.2/usb6/6-0:1.0/
lrwxrwxrwx 1 root root    0 Jan  7 13:47 6-2.2:1.0 -> ../../../../devices/pci0000:c0/0000:c0:00.0/0000:c1:00.2/usb6/6-2/6-2.2/6-2.2:1.0/
lrwxrwxrwx 1 root root    0 Jan  7 13:47 6-2:1.0 -> ../../../../devices/pci0000:c0/0000:c0:00.0/0000:c1:00.2/usb6/6-2/6-2:1.0/
--w------- 1 root root 4096 Jan  7 13:47 bind
lrwxrwxrwx 1 root root    0 Jan  7 13:47 module -> ../../../../module/usbcore/
-rw-r--r-- 1 root root 4096 Jan  7 13:47 new_id
-rw-r--r-- 1 root root 4096 Jan  7 13:47 remove_id
--w------- 1 root root 4096 Jan  7 13:31 uevent
--w------- 1 root root 4096 Jan  7 13:47 unbind
root@Tower:/sys/bus/usb/drivers/hub# cd ../synaptics_usb/
root@Tower:/sys/bus/usb/drivers/synaptics_usb# ls -al
total 0
drwxr-xr-x 2 root root    0 Jan  7 13:31 ./
drwxr-xr-x 9 root root    0 Jan  7 13:31 ../
--w------- 1 root root 4096 Jan 22 09:44 bind
-rw-r--r-- 1 root root 4096 Jan 22 09:44 new_id
-rw-r--r-- 1 root root 4096 Jan 22 09:44 remove_id
--w------- 1 root root 4096 Jan  7 13:31 uevent
--w------- 1 root root 4096 Jan 22 09:44 unbind
root@Tower:/sys/bus/usb/drivers/synaptics_usb# cd ../usb
root@Tower:/sys/bus/usb/drivers/usb# ls -al
total 0
drwxr-xr-x 2 root root    0 Jan  7 13:31 ./
drwxr-xr-x 9 root root    0 Jan  7 13:31 ../
lrwxrwxrwx 1 root root    0 Jan 22 09:37 1-11 -> ../../../../devices/pci0000:00/0000:00:14.0/usb1/1-11/
lrwxrwxrwx 1 root root    0 Jan 22 09:37 1-12 -> ../../../../devices/pci0000:00/0000:00:14.0/usb1/1-12/
lrwxrwxrwx 1 root root    0 Jan 22 09:37 1-13 -> ../../../../devices/pci0000:00/0000:00:14.0/usb1/1-13/
lrwxrwxrwx 1 root root    0 Jan 22 09:37 1-14 -> ../../../../devices/pci0000:00/0000:00:14.0/usb1/1-14/
lrwxrwxrwx 1 root root    0 Jan 22 09:37 1-6 -> ../../../../devices/pci0000:00/0000:00:14.0/usb1/1-6/
lrwxrwxrwx 1 root root    0 Jan 22 09:37 1-7 -> ../../../../devices/pci0000:00/0000:00:14.0/usb1/1-7/
lrwxrwxrwx 1 root root    0 Jan 22 09:37 2-6 -> ../../../../devices/pci0000:00/0000:00:14.0/usb2/2-6/
lrwxrwxrwx 1 root root    0 Jan 22 09:37 5-2 -> ../../../../devices/pci0000:c0/0000:c0:00.0/0000:c1:00.2/usb5/5-2/
lrwxrwxrwx 1 root root    0 Jan 22 09:37 5-2.1 -> ../../../../devices/pci0000:c0/0000:c0:00.0/0000:c1:00.2/usb5/5-2/5-2.1/
lrwxrwxrwx 1 root root    0 Jan 22 12:02 5-2.1.3 -> ../../../../devices/pci0000:c0/0000:c0:00.0/0000:c1:00.2/usb5/5-2/5-2.1/5-2.1.3/
lrwxrwxrwx 1 root root    0 Jan 22 09:37 6-2 -> ../../../../devices/pci0000:c0/0000:c0:00.0/0000:c1:00.2/usb6/6-2/
lrwxrwxrwx 1 root root    0 Jan 22 09:37 6-2.2 -> ../../../../devices/pci0000:c0/0000:c0:00.0/0000:c1:00.2/usb6/6-2/6-2.2/
--w------- 1 root root 4096 Jan 22 09:37 bind
--w------- 1 root root 4096 Jan  7 13:31 uevent
--w------- 1 root root 4096 Jan 22 09:37 unbind
lrwxrwxrwx 1 root root    0 Jan 22 09:37 usb1 -> ../../../../devices/pci0000:00/0000:00:14.0/usb1/
lrwxrwxrwx 1 root root    0 Jan 22 09:37 usb2 -> ../../../../devices/pci0000:00/0000:00:14.0/usb2/
lrwxrwxrwx 1 root root    0 Jan 22 09:37 usb3 -> ../../../../devices/pci0000:00/0000:00:1c.0/0000:03:00.0/usb3/
lrwxrwxrwx 1 root root    0 Jan 22 09:37 usb4 -> ../../../../devices/pci0000:00/0000:00:1c.0/0000:03:00.0/usb4/
lrwxrwxrwx 1 root root    0 Jan 22 09:37 usb5 -> ../../../../devices/pci0000:c0/0000:c0:00.0/0000:c1:00.2/usb5/
lrwxrwxrwx 1 root root    0 Jan 22 09:37 usb6 -> ../../../../devices/pci0000:c0/0000:c0:00.0/0000:c1:00.2/usb6/
root@Tower:/sys/bus/usb/drivers/usb# cd ../usb-storage
root@Tower:/sys/bus/usb/drivers/usb-storage# ls -al
total 0
drwxr-xr-x 2 root root    0 Jan  7 13:31 ./
drwxr-xr-x 9 root root    0 Jan  7 13:31 ../
lrwxrwxrwx 1 root root    0 Jan 22 12:02 1-11:1.0 -> ../../../../devices/pci0000:00/0000:00:14.0/usb1/1-11/1-11:1.0/
--w------- 1 root root 4096 Jan 22 12:02 bind
lrwxrwxrwx 1 root root    0 Jan 22 12:02 module -> ../../../../module/usb_storage/
-rw-r--r-- 1 root root 4096 Jan 22 12:02 new_id
-rw-r--r-- 1 root root 4096 Jan 22 12:02 remove_id
--w------- 1 root root 4096 Jan  7 13:31 uevent
--w------- 1 root root 4096 Jan 22 12:02 unbind
root@Tower:/sys/bus/usb/drivers/usb-storage# cd ../usbfs
root@Tower:/sys/bus/usb/drivers/usbfs# ls -al
total 0
drwxr-xr-x 2 root root    0 Jan  7 13:31 ./
drwxr-xr-x 9 root root    0 Jan  7 13:31 ../
--w------- 1 root root 4096 Jan 22 12:03 bind
lrwxrwxrwx 1 root root    0 Jan 22 12:03 module -> ../../../../module/usbcore/
-rw-r--r-- 1 root root 4096 Jan 22 12:03 new_id
-rw-r--r-- 1 root root 4096 Jan 22 12:03 remove_id
--w------- 1 root root 4096 Jan  7 13:31 uevent
--w------- 1 root root 4096 Jan 22 12:03 unbind
root@Tower:/sys/bus/usb/drivers/usbfs# cd ../usbhid
root@Tower:/sys/bus/usb/drivers/usbhid# ls -al
total 0
drwxr-xr-x 2 root root    0 Jan  7 13:31 ./
drwxr-xr-x 9 root root    0 Jan  7 13:31 ../
lrwxrwxrwx 1 root root    0 Jan 22 09:44 1-12:1.0 -> ../../../../devices/pci0000:00/0000:00:14.0/usb1/1-12/1-12:1.0/
lrwxrwxrwx 1 root root    0 Jan 22 09:44 1-14:1.0 -> ../../../../devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/
lrwxrwxrwx 1 root root    0 Jan 22 12:03 5-2.1.3:1.0 -> ../../../../devices/pci0000:c0/0000:c0:00.0/0000:c1:00.2/usb5/5-2/5-2.1/5-2.1.3/5-2.1.3:1.0/
--w------- 1 root root 4096 Jan 22 09:44 bind
lrwxrwxrwx 1 root root    0 Jan 22 09:44 module -> ../../../../module/usbhid/
-rw-r--r-- 1 root root 4096 Jan 22 09:44 new_id
-rw-r--r-- 1 root root 4096 Jan 22 09:44 remove_id
--w------- 1 root root 4096 Jan  7 13:31 uevent
--w------- 1 root root 4096 Jan 22 09:44 unbind
root@Tower:/sys/bus/usb/drivers/usbhid#

 

Do you need any more info?

 

Thanks!

Unfortunately i don't have one myself to test, please join https://discord.gg/rjb3z87 and hopefully me and @rasmus can figure it out

Link to comment
  • 2 weeks later...

Just an FYI,

 

CA's application feed is getting stricter on plugins.  The template for CA for this plugin references one URL which does not match the URL referenced within the plugin itself.

 

This is a security issue because if / when the plugin updates, effectively a different plugin winds up getting installed from the one CA has listed (even though in this case they are identical, but due to the differing URLs they effectively are different plugins).

 

Because of this the application feed is automatically blacklisting Corsair PSU until either the template or the plugin are fixed to point to the same URL

 

If the GitHub repository simply changed where the plugin is stored, then the solution is to change the template to that new repository

 

Fma965's Repository
https://raw.githubusercontent.com/Fma965/corsairpsu-unraid/master/corsairpsu.plg:
        Fatal: Plugin URL on xml template does not match PluginURL in .plg (https://raw.githubusercontent.com/Fma965/corsairpsu-unraid/master/corsairpsu.plg vs https://raw.githubusercontent.com/Cyanlabs/corsairpsu-unraid/master/corsairpsu.plg)

Edited by pluginCop
Link to comment
On 2/8/2020 at 2:45 PM, pluginCop said:

Just an FYI,

 

CA's application feed is getting stricter on plugins.  The template for CA for this plugin references one URL which does not match the URL referenced within the plugin itself.

 

This is a security issue because if / when the plugin updates, effectively a different plugin winds up getting installed from the one CA has listed (even though in this case they are identical, but due to the differing URLs they effectively are different plugins).

 

Because of this the application feed is automatically blacklisting Corsair PSU until either the template or the plugin are fixed to point to the same URL

 

If the GitHub repository simply changed where the plugin is stored, then the solution is to change the template to that new repository

 

Fma965's Repository
https://raw.githubusercontent.com/Fma965/corsairpsu-unraid/master/corsairpsu.plg:
        Fatal: Plugin URL on xml template does not match PluginURL in .plg (https://raw.githubusercontent.com/Fma965/corsairpsu-unraid/master/corsairpsu.plg vs https://raw.githubusercontent.com/Cyanlabs/corsairpsu-unraid/master/corsairpsu.plg)

fixed i think.

Link to comment

This is a super cool idea! 

 

I am unable to get output for my AX1500i.  I'm happy to help test and would appreciate some support.

 

This is the USB 

Bus 001 Device 005:ID 1b1c:1c02 Corsair Corsair Link TM USB Dongle

 

Unplugging and replugging hot =

 kernel: usb 1-13: USB disconnect, device number 5
 kernel: usb 1-13: new full-speed USB device number 8 using xhci_hcd

 

Now it is listed as: 

USB Devices

Bus 001 Device 001:ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 001 Device 002:ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS

Bus 001 Device 003:ID 0781:5583 SanDisk Corp. Ultra Fit

Bus 001 Device 007:ID 046d:c52b Logitech, Inc. Unifying Receiver

Bus 001 Device 008:ID 1b1c:1c02 Corsair Corsair Link TM USB Dongle

Bus 002 Device 001:ID 1d6b:0003 Linux Foundation 3.0 root hub

Edited by NOLA_DireWolff
Link to comment
Are you a Home Assistant user? Or are you planning to use this data outside the unraid dashboard in any way?
I didn't know it was for home assistant, it just looked nice.
I have an unopened icy994, but don't know yet when I'll have the time to play with it.

My objective was to be able to monitor psu usage with gaming vm off/on and display off. Any kind of export would be enough, csv, sheets, anything

Sent from my SM-G973F using Tapatalk

Link to comment
10 hours ago, dheg said:

I didn't know it was for home assistant, it just looked nice.
I have an unopened icy994, but don't know yet when I'll have the time to play with it.

My objective was to be able to monitor psu usage with gaming vm off/on and display off. Any kind of export would be enough, csv, sheets, anything

Sent from my SM-G973F using Tapatalk
 

This plugin exposes the data as raw JSON. If you can find a way to pull that into a database you’ll be all good. Unfortunately nothing I can assist with. Home assistant just happens to be an excellent use case 

Link to comment
On 2/14/2020 at 4:07 AM, januszwoj said:

Hi.
Is there any possibility to send data from this plugin directly to the "Grafana" desktop or via "telegraph" or "Influxdb"?

It would be great.
Regards Janusz

Thats exactly what i was thinking and was hoping for an answer. 

Link to comment
7 hours ago, Ahmed said:

Thats exactly what i was thinking and was hoping for an answer. 

Not 100% sure this is going to work properly and im sure there's prob a better way to do this.. i just wrote up a super amazing script to export the data into influxdb


#!/usr/bin/env bash
#set -x
RAW=$(/usr/local/bin/corsairmi)
OUTPUT=/mnt/user/appdata/telegraf/corsair-telegraf.csv

function simple() {
#       echo $(echo "$RAW" | grep "$1" | cut -d ':' -f2 | cut -d ' ' -f 2)
        echo "$RAW" | grep "$1" |  tr -s ' ' | cut -d ':' -f 2 | cut -d ' ' -f 2
}
function rail() {
#       echo "$RAW" | grep -A 3 "output ${1}v" | grep "$2" | tr -s ' ' | cut -d ' ' -f 2
        echo "$RAW" | grep "$1" | grep "$2" | tr -s ' ' |  cut -d ' ' -f 3
}

temp_0=$(simple "temp1")
temp_1=$(simple "temp2")
powered=$(simple "powered")
uptime=$(simple "uptime")
supply=$(simple "supply volts")
total_watts=$(simple "total watts")

# 12V Rail
volts_12v=$(rail "output0 volts")
amps_12v=$(rail "output0 amps")
watts_12v=$(rail "output0 watts")

# 5V Rail
volts_5v=$(rail "output1 volts")
amps_5v=$(rail "output1 amps")
watts_5v=$(rail "output1 watts")

# 3.3V Rail
volts_3_3v=$(rail "output2 volts")
amps_3_3v=$(rail "output2 amps")
watts_3_3v=$(rail "output2 watts")

# InfluxDB output
echo "power_supply temp_0=\"$temp_0\",temp_1=\"$temp_1\",total_time=\"$powered\",uptime=\"$uptime\",supply_volts=\"$supply\",total_watts=\"$total_watts\",12v_volts=\"$volts_12v\",12v_amps=\"$amps_12v\",12v_watts=\"$watts_12v\",5v_volts=\"$volts_5v\",5v_amps=\"$amps_5v\",5v_watts=\"$watts_5v\",3.3v_volts=\"$volts_3_3v\",3.3v_amps=\"$amps_3_3v\",3.3v_watts=\"$watts_3_3v\"" > $OUTPUT

WIth the output file you can import it straight to influxdb with a cron job to run for like every 5min. Here is how i did it manually

 

# curl -i -XPOST 'http://influxdb-ip:8086/write?db=telegraf' --data-binary @/dir/of/corsair-telegraf.csv
HTTP/1.1 204 No Content
Content-Type: application/json
Request-Id: fd24688f-5c64-11ea-93c0-7085c242ccc6
X-Influxdb-Build: OSS
X-Influxdb-Version: 1.7.10
X-Request-Id: fd24688f-5c64-11ea-93c0-7085c242ccc6
Date: Mon, 02 Mar 2020 09:05:40 GMT

and now i have to figure out how to get grafana to show the results. fun times!!

 

***ok scratch that. it didnt seem to work...... seems like it wont input the results even though they appear to be clearly showing in the file. 

 

Edited by Ahmed
Link to comment
On 3/4/2020 at 7:46 PM, NOLA_DireWolff said:

Does this work on the axi1500?

Second this. Anything we can do to get this going on the 1500i ? 

 

It is not working on the the 1500i as of 3/7/2020 

 

I am able to connect to it via windows VM and it obviously shows up in my usb devices. 

Edited by arvinbis@gmail.com
Link to comment
On 3/6/2020 at 6:28 AM, arvinbis@gmail.com said:

Second this. Anything we can do to get this going on the 1500i ? 

 

It is not working on the the 1500i as of 3/7/2020 

 

I am able to connect to it via windows VM and it obviously shows up in my usb devices. 

I am third !

Link to comment
  • 2 weeks later...
On 3/5/2020 at 3:46 AM, NOLA_DireWolff said:

Does this work on the axi1500?

 

On 3/6/2020 at 6:28 AM, arvinbis@gmail.com said:

Second this. Anything we can do to get this going on the 1500i ? 

 

It is not working on the the 1500i as of 3/7/2020 

 

I am able to connect to it via windows VM and it obviously shows up in my usb devices. 

 

On 3/8/2020 at 12:38 PM, ingux16 said:

I am third !

Any one tried this with HWInfo on windows, does that detect it? 

Link to comment
  • 3 weeks later...

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.