Giter VIP home page Giter VIP logo

cm-rgb's Introduction

cm-rgb

Version Licence Downloads PayPal

Control your Wraith Prism RGB on Linux, Mac OS and Windows

Picutre

cm-rgb-monitor showing realtime cpu utilization.

Getting started

Installation & Configuration

Follow this simple guide on our wiki.

Usage

Package comes with two scripts cm-rgb-cli and cm-rgb-monitor.

cm-rgb-cli allows for fine grained control of each individual zone including turning off the LED's completely.

Check out the examples in our wiki.

Picture cm-rgb-gui GUI interface that serves the purpose of simplifying the usage of [cm-rgb-cli] (thanks to groovykiwi)

cm-rgb-monitor allows for displaying cpu utilization with ring LED's, along with temperature (thanks to mpsdskd).

Combining the cli + monitor can create neat transition from powering your system right to booting your OS.

Check out the examples in our wiki.

Licence

MIT

See LICENCE file for details

cm-rgb's People

Contributors

ausil avatar danieldk avatar gfduszynski avatar giacomocaironi avatar groovykiwi avatar mpsdskd avatar vexersa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cm-rgb's Issues

Several installation problems

Following installation guide on a fresh linux mint install I got some missing dependency problems

1. Missing deps

Can be installed by executing:

pip install wheel
pip install enum

I don't know much about python ecosystem, perhaps those deps could be added as project dependencies or at least document that in the installation guide

2. pip bin dir not in path

I had to manually add it in .bashrc

export PATH="$HOME/.local/bin/:$PATH"

3. /usr/bin/sh not found when executing cm-rgb-cli add-udev-rule

$ cm-rgb-cli add-udev-rule
sudo: /usr/bin/sh: command not found
Failed to create /etc/udev/rules.d/60-cm-rgb.rules

Quick & dirty workaround

sudo ln -s /bin/sh /usr/bin/sh

Hope this helps someone

Thanks for your great work!

problematic project name

In #53 I was attempting to clean things up because packaging up the project as it is is messy and problematic due to the inconsistency between the project name cm-rgb and the python module cm_rgb there are ways to make module loading working with a - in the name but it is not recommended. Therefore, it would be better to rename the project to cm_rgb or cmrgb or something else where there is consistency between the module name and the project name. I figured it is best to file an issue for a discussion.

Run as normal user

I've been able to run this as a normal (non-root) user by creating the following udev rules in Arch Linux

/usr/lib/udev/rules.d/99-cm-rgb.rules

# cm-rgbi
SUBSYSTEM=="usb", ATTR{idVendor}=="2516", ATTR{idProduct}=="0051", MODE="0660", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl"

Then load the new rules with

sudo udevadm control --reload-rules
sudo udevadm trigger

Maybe this CLI tool could offer a way to create these rules for users with sudo access?

SyntaxError: invalid syntax

Can you have python modules with hyphens in the name?

> cm-rgb-monitor
  File "/home/nsheff/.local/bin/cm-rgb-monitor", line 2
    from cm-rgb.ctrl import LedChannel, LedMode, CMRGBController
           ^
SyntaxError: invalid syntax

and:

cm-rgb-cli
  File "/home/nsheff/.local/bin/cm-rgb-cli", line 3
    from cm-rgb.ctrl import LedChannel, LedMode, CMRGBController
           ^
SyntaxError: invalid syntax
python3 --version
Python 3.8.5

cm-rgb

leaving the rgb off on the fan iisn't going to break anything is it?

"No devices found" without sudo

First off, I really love this project. Thank you for your work here.

I've looked through your documentation and believe I've followed the instructions to a T. Unfortunately, it doesn't seem that I can use the cli without sudo level access. I am on a Fedora work station on kernel 5.9.13 with python 3.9.

I understand this is probably related to #4 and you resolved this after the release of v0.1.0, but I'm not sure what the issue could be. Interestingly, if I switch from version v0.3.4 to v0.1.0 I'm able to add the udev rule without an issue but still can't run 'cm-rgb-cli` without sudo. I included some of the output below.

If I am missing some serious low hanging fruit, please let me know.

james@fedora-workstation: ~/Programmes/cm-rgb$ cm-rgb-cli set logo --mode=breathe --color=#00ff00 --speed=3 --brightness=5 fan --mode=breathe --color=#0000ff --speed=4 --brightness=1 ring --mode=swirl --color=#ff0000 --speed=1 --brightness=1                                                                   
Traceback (most recent call last):
  File "/home/james/.local/bin/cm-rgb-cli", line 151, in <module>
    main_group()
  File "/usr/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.9/site-packages/click/core.py", line 1268, in invoke
    Command.invoke(self, ctx)
  File "/usr/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/james/.local/bin/cm-rgb-cli", line 13, in setup_group
    'ctrl': CMRGBController(),
  File "/home/james/.local/lib/python3.9/site-packages/cm_rgb/ctrl.py", line 50, in __init__
    self.__init_hid_device()
  File "/home/james/.local/lib/python3.9/site-packages/cm_rgb/ctrl.py", line 57, in __init_hid_device
    raise Exception("No devices found")
Exception: No devices found

OSError: open failed

I just built a new system with a Wraith Prism cooler and stumbled across this fantastic tool in searching for a way to change the colour scheme under Linux. However, I'm getting an OSError: open failed error when trying to send commands.

OS is Ubuntu 20.04
Processor AMD Ryzen 7 3800x
MoBo: Gigabyte Aorus x570 Elite

user@system:~$ lsusb | grep 2516:0051
Bus 003 Device 003: ID 2516:0051 Cooler Master Co., Ltd. 

Command resulting in error:

user@system:~$ cm-rgb-cli set logo --mode=static --color=#ff4f00 --brightness=3 fan --mode=static --color=#ff4f00 --brightness=3 ring --mode=static --color=#ff4f00 --brightness=3
Traceback (most recent call last):
  File "/home/user/.local/bin/cm-rgb-cli", line 175, in <module>
    main_group()
  File "/home/user/.local/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/jeff/.local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/user/.local/lib/python3.8/site-packages/click/core.py", line 1268, in invoke
    Command.invoke(self, ctx)
  File "/home/user/.local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/user/.local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/user/.local/bin/cm-rgb-cli", line 13, in setup_group
    'ctrl': CMRGBController(),
  File "/home/user/.local/lib/python3.8/site-packages/cm_rgb/ctrl.py", line 54, in __init__
    self.__init_hid_device()
  File "/home/user/.local/lib/python3.8/site-packages/cm_rgb/ctrl.py", line 64, in __init_hid_device
    self.device.open_path(device_list[0]["path"])
  File "hid.pyx", line 72, in hid.device.open_path
OSError: open failed

Please let me know what else I can provide to help debug this issue.

Command not found

Greetings. cm-rgb: command not found is what I'm getting even before trying to give USB access to the script. What might be the reason if may I ask? (I'm quite new around here)

Feature request: Gentoo ebuild

Hi. Do you think it would be possible to provide an Gentoo ebuild for your project? It would be really great. Thank you.

Only the ring is changing

Currently, I'm only able to control the ring LEDs. The other commands seem to have no effect.

interface_number : 0
manufacturer_string : Cooler Master Technology Inc.
path : b'0001:0003:00'
product_id : 81
product_string : AMD SR4 lamplight Control
release_number : 264
serial_number :
usage : 0
usage_page : 0
vendor_id : 9494

interface_number : 1
manufacturer_string : Cooler Master Technology Inc.
path : b'0001:0003:01'
product_id : 81
product_string : AMD SR4 lamplight Control
release_number : 264
serial_number :
usage : 0
usage_page : 0
vendor_id : 9494

interface_number : 2
manufacturer_string : Cooler Master Technology Inc.
path : b'0001:0003:02'
product_id : 81
product_string : AMD SR4 lamplight Control
release_number : 264
serial_number :
usage : 0
usage_page : 0
vendor_id : 9494

Installation problems on Ubuntu 20.04 LTS

Tried to install and had to go back and install lots of packages before pip would complete:

apt-get install python-dev libusb-1.0-0-dev libudev-dev libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev build-essential

then tried run pip3 install cm-rgb and also using this git repository, no dice.

I can run the command:
cm-rgb-cli set logo --mode=off save

but the light doesnt turn off. I did run the lsusb | grep 2516:0051 command and got:

Bus 001 Device 004: ID 2516:0051 Cooler Master Co., Ltd. AMD SR4 lamplight Control

Version shows 0.3.4 and the CLI version shows V1.01.00

I have three machines, exact same boards/config, all three do the same thing. Thoughts?

Please respond

If i chose to uninstall cm-rgb and undo everything it has done, how would I go about doing that?

Feature Request: Allow for faster refresh times in cm-rgb-monitor

I would like to set a faster refresh time in cm-rgb-monitor.

The only change required for this is:
@click.option('--interval', type=click.FloatRange(0.01, 60, clamp=True), default=3)

Set interval as a FloatRange instead of IntRange. time.sleep does not care.

cm-rgb-monitor fails with UnboundLocalError: local variable 'sensorIndex' referenced before assignment

For some time now I've been getting the error as per title when starting cm-rgb-monitor. This may be tied to upgrading the Pop_os I'm running to 21.04 or something thereabouts.

The command I'm using is:
/home/domin/.local/bin/cm-rgb-monitor --cpu-color=#444499 --bg-color=#FFFFFF --show-temp --temp-low-color=#444444 --temp-high-color=#FF0000

The output is:
Traceback (most recent call last): File "/home/domin/.local/bin/cm-rgb-monitor", line 218, in <module> monitor() File "/usr/lib/python3/dist-packages/click/core.py", line 829, in __call__ return self.main(*args, **kwargs) File "/usr/lib/python3/dist-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/usr/lib/python3/dist-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/lib/python3/dist-packages/click/core.py", line 610, in invoke return callback(*args, **kwargs) File "/home/domin/.local/bin/cm-rgb-monitor", line 156, in monitor t = psutil.sensors_temperatures()[sensorGroup][sensorIndex].current UnboundLocalError: local variable 'sensorIndex' referenced before assignment

cm-rgb is installed using pip. The version listed is 0.3.6. Removing --show-temp fixes the issue.

Any idea what may be wrong? If there's any more info I can provide pls let me know.

Not working on MSI MB

I installed all the dependencies as indicated, i also added the udev rule succesfully through the indicated option "add-udev-rule", i even restarted my system to be sure the rule was applied. When i do any change the ring default sequence restarts to red but no apparent change even when i set --mode=off which should turn off the ring.

Hardware

  • Wraith prism cooler.

  • Motherboard MSI x470 gaming pro.

Thanks for your help.

ModuleNotFoundError: No module named 'cm_rgb'

I get this error when trying to add the udev rule. Manjaro linux.

$ sudo cm-rgb-cli add-udev-rule Traceback (most recent call last): File "/home/s/.local/bin/cm-rgb-cli", line 3, in <module> from cm_rgb.ctrl import LedChannel, LedMode, CMRGBController ModuleNotFoundError: No module named 'cm_rgb'

Restoring factory settings

Hi. Thanks for the great application. It finally allowed me to turn those fan LEDs off and sleep in a darker room. I was wondering if there is a way to restore the factory settings, though.

CPU Temp in Windows?

Thanks for this!

I'm trying to get the temp sensors working in Windows.
Any advice?

ubuntu 18.04: dependency: libusb-1.0-0-dev

I needed a "sudo apt-get install libusb-1.0-0-dev" to make "sudo pip install cm-rgb" successful.
Before I always got:

hidapi/libusb/hid.c:47:10: fatal error: libusb.h: Datei oder Verzeichnis nicht gefunden

Error running cm-rgb-cli

Dear gfduszynski:

Hello !

I'm suffering an error running cm-rgb-cli, ver 0.3.6. No matter what param I give, it raises the error:

Traceback (most recent call last):
  File "/usr/local/bin/cm-rgb-cli", line 23, in <module>
    @setup_group.resultcallback()
AttributeError: 'Group' object has no attribute 'resultcallback'

I'm running cm-rgb-cli in multi-user mode. The environment is Debian 11, kernel 5.10.0, python 3.9, package click is version 8.1.3. It's very likely that some of the packages have been refactored and mine are not in desirable version. Could you please check this out? If any more information is required, please tell me.

Thank you very much!

OSError: open failed

I googled this issue and I believe I got an usb device permission issue. I hope someone can help and thanks in advance.

I ran the 'cm-rgb-cli add-udev-rule' in the installation section but I am not sure if it was effective or not. Here is what I got:

'SUBSYSTEM=="usb", ATTR{idVendor}=="2516", ATTR{idProduct}=="0051", TAG+="uaccess", TAG+="udev-acl"' > /etc/udev/rules.d/60-cm-rgb.rules
Created /etc/udev/rules.d/60-cm-rgb.rules
udev should apply new rule automatically. If not, try running 'sudo udevadm trigger' 

when I ran any cm-rgb-cli command, I got the OSError: open failed issue:

self.device.open_path(device_list[0]["path"])
File "hid.pyx", line 72, in hid.device.open_path
OSError: open failed

my system is Ubuntu 20.04 system. Again, thanks for any helps.

V0.0.9 - IOError open failed

Hi,
I can't manage to make your project work on my Mint 19.2 but I'm not a python master so it's surely my mistake.
Install went great with pip. I can access --help so it's installed but when I try your example :

cm-rgb-cli logo --mode=breathe --color=#00ff00 --speed=3 --brightness=5 fan --mode=breathe --color=#0000ff --speed=4 --brightness=1 ring --mode=swirl --color=#ff0000 --speed=1 --brightness=1
Traceback (most recent call last):
  File "/home/user/.local/bin/cm-rgb-cli", line 161, in <module>
    cli()
  File "/home/user/.local/lib/python2.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/user/.local/lib/python2.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/user/.local/lib/python2.7/site-packages/click/core.py", line 1164, in invoke
    return _process_result(rv)
  File "/home/user/.local/lib/python2.7/site-packages/click/core.py", line 1102, in _process_result
    **ctx.params)
  File "/home/user/.local/lib/python2.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/user/.local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/user/.local/bin/cm-rgb-cli", line 22, in process_pipeline
    c = CMRGBController()
  File "/home/user/.local/lib/python2.7/site-packages/cm_rgb/ctrl.py", line 50, in __init__
    self.__init_hid_device()
  File "/home/user/.local/lib/python2.7/site-packages/cm_rgb/ctrl.py", line 60, in __init_hid_device
    self.device.open_path(device_list[0]["path"])
  File "hid.pyx", line 72, in hid.device.open_path
IOError: open failed

Did I miss something ?

cm-rgb-cli error when I try to change anything

after updating to version 0.0.8 when I tried to play around a bit I got this error and no changes actually happen to my cooler.
0.0.5 and 0.0.7 worked fine

I am running ubuntu 19.10
I upgrade using pip
sudo pip install --upgrade cm-rgb

sudo cm-rgb-cli logo --mode=static --color=#ffffff --speed=3 --brightness=5 fan --mode=breathe --color=#ff0000  --speed=3 --brightness=5 ring --mode=swirl --color=#ffffff  --speed=1 --brightness=5 save
Traceback (most recent call last):
  File "/usr/local/bin/cm-rgb-cli", line 160, in <module>
    cli()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1164, in invoke
    return _process_result(rv)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1102, in _process_result
    **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/bin/cm-rgb-cli", line 26, in process_pipeline
    elif ctx.obj['version']:
KeyError: 'version'

other than this hiccup, I love that I can control my coolers RGB over USB in Linux, I don't even have windows on this computer.

lotta errors

I ran cm-rgb-monitor on arch but got this also the command line app does the same

nonetrix@arch-PC1: ~/cm-rgb $ cm-rgb-monitor

Failed to access usb device. See: https://github.com/gfduszynski/cm-rgb/wiki/1.-Installation-&-Configuration#3-configuration
Also check if other process is not using the device.

Traceback (most recent call last):
File "/home/nonetrix/.local/bin/cm-rgb-monitor", line 218, in
monitor()
File "/home/nonetrix/.local/lib/python3.8/site-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/home/nonetrix/.local/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/nonetrix/.local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/nonetrix/.local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/nonetrix/.local/bin/cm-rgb-monitor", line 95, in monitor
c = CMRGBController()
File "/home/nonetrix/.local/lib/python3.8/site-packages/cm_rgb/ctrl.py", line 54, in init
self.__init_hid_device()
File "/home/nonetrix/.local/lib/python3.8/site-packages/cm_rgb/ctrl.py", line 66, in __init_hid_device
self.device.open_path(device_list[0]["path"])
File "hidraw.pyx", line 72, in hid.device.open_path
OSError: open failed

PySensor required?

I just looked at the source of cm-rgb-monitor and noticed everything is called with psutil. Is PySensor required like stated in docs.

Support for RGB header pins on motherboard

Hi
I have this program installed and get the error Exception: No devices found
My Prism is plugged into the RGB header pins on motherboard I'm guessing this program only works if the Prism is plugged into the USB pins? are you likely to support RGB pins in future or is that a lot more complicated?

Mirage support

Hello!

Do you plan on adding mirage support? I'd like to write a script that continuously polls the CPU fan speed through PySensors, then updates the LED frequency to maintain the same visual illusion.

Thanks,
Jordan

cm-rgb

If i chose to uninstall cm-rgb and undo everything it has done, how would I go about doing that?

No worky

Traceback (most recent call last):
File "/usr/local/bin/cm-rgb-monitor", line 2, in
from cm_rgb.ctrl import LedChannel, LedMode, CMRGBController
ModuleNotFoundError: No module named 'cm_rgb'

Dependencies met, altered the primary script to point to Python3 as 2.7 is the default for the system XUbuntu 18.04

5.0.0-25-generic #26~18.04.1-Ubuntu

Did some poking, no dice. Lemme know if you need anymore info.

Show CPU frequency using logo color

I wasn't sure whether just showing the CPU usage & temperature was nerdy enough....

So I programmed it to also show the CPU frequency with the logo color.

It periodically reads all frequency data from /sys/devices/system/cpu/cpu{i}/cpufreq/scaling_cur_freq.
https://github.com/mpsdskd/cm-rgb/blob/master/scripts/cm-rgb-monitor

What I do not know yet:

  • Is the sysfs path the same for all OSs?
  • I'm using the same colors for the logo as for the fan - configurable?
  • Didn't test for performance, might be possible more efficiently.

[FR] Control Prism via Project Aurora

Heya! Stumbled upon this repo after searching for people who were fed up to control 1 light from proprietary CM software. Thank you for taking the time to make this.

Was wondering if it would be possible to export the ability to change lights of all the zones (ring, fan, logo) to a great all-in-one project that links and controls RGB peripherals (https://github.com/antonpup/Aurora)?

cm-rgb-cli: command not found

After installing with pip(had to use pip3?), I keep getting this error:

system@myuser:/usr/local/bin$ cm-rgb-cli add-udev-rule
cm-rgb-cli: command not found

when I pip3 list I see cm-rgb-cli listed, but I seem to be unable to access it. I know it may be a bit unrelated. but I'm unable to figure out what to do

Segmentation Fault when trying to get cli version

Was wondering if anyone could help me with running the CLI on Ubuntu Server 20.04.4 LTS when running the following this error occurs.

$ cm-rgb-cli version
V1.01.00
python3: io.c:2115: handle_events: Assertion `ctx->pollfds_cnt >= internal_nfds' failed.
Aborted (core dumped)

cm-rgb-monitor stops running after sleep mode

As said in the headline, after waking up my computer from suspend cm-rgb-monitor does not show anything anymore.

Steps to reproduce:

  • Start cm-rgb-monitor
  • suspend computer to ram
  • wake computer up again
    --> cm-rgb-monitor stops showing CPU load/temperature

Simple mitigation like a try/except in the eternal while loop don not work, neither does a while/True around the monitor() function.

if __name__ == '__main__':
    while True:
        try:
            monitor()
        except Exception as e:
            print(e)

Additional information:

  • cm-rgb 0.1.0
  • OS Kubuntu 20.04
  • Python 3.8

Error message:

Traceback (most recent call last):
  File "/home/---/Programs/cm-rgb/scripts/cm-rgb-monitor", line 162, in <module>
    monitor()
  File "/home/---/.local/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/---/.local/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/---/.local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/---/.local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/---/Programs/cm-rgb/scripts/cm-rgb-monitor", line 151, in monitor
    c.apply()
  File "/home/---/.local/lib/python3.8/site-packages/cm_rgb-0.1.0-py3.8.egg/cm_rgb/ctrl.py", line 83, in apply
    return self.send_packet(self.P_APPLY)
  File "/home/---/.local/lib/python3.8/site-packages/cm_rgb-0.1.0-py3.8.egg/cm_rgb/ctrl.py", line 80, in send_packet
    return self.device.read(64)
  File "hid.pyx", line 123, in hid.device.read
OSError: read error

Possible to reset to default out-of-package behavior?

Hi, thanks for that great tool.

I played a little on 2 machines running Ubuntu Focal Fossa. Is there a way to switch back to the out-of-box behavior of the AMD Wraith Prism?

Out-of-box, w/o any intervention and no connection, logo & fan does cycle slowly thru a rainbow cycle and the ring also but with different speed, faster than logo & fan.

Cheers

ModuleNotFoundError: No module named 'hid'

Running on Ubuntu 20.04. Here's the trace:

sudo ./cm-rgb-cli add-udev-rule
Traceback (most recent call last):
  File "./cm-rgb-cli", line 3, in <module>
    from cm_rgb.ctrl import LedChannel, LedMode, CMRGBController
  File "/home/graeme/Documents/cm-rgb/scripts/cm_rgb/ctrl.py", line 1, in <module>
    import hid
ModuleNotFoundError: No module named 'hid'

However, I know that hid is already installed, as I can run import hid in the interpreter just fine.

Would appreciate help on this, I'm pretty stuck!

The ring can not be controlled

I have the problem that the ring can not be controlled. In addition, it does not work that I can turn off the logo and the ring.

Feature request: Other ring led options

Hey man, thanks for writing the code for this. I was actually looking into creating something similar. Turns out I don't have to! I hate that my Corsair ICUE schemes didn't sync with my prism fan, so now I can write some code to do the changes for me while switching profiles. It works great in Windows 10 as a standard user, even though you apparently wrote it for Linux. Awesome work!

I have two questions:

  1. How did you figure out what to send and reverse engineer this?
  2. Do you plan on adding the CoolerMaster software rainbow, chase, bounce, morse code and colour cycle modes?

I could implement something similar by sending the correct data to the LEDs, however it might already be built-in. Do you know if the firmware supports it or if it is part of the CM software instead?

Documentation request

Hi. Would you consider adding documentation on how to install cm-rgb from the github repo? (Currently you only point out the possibility of installing via pip, but I was curious about the new temp monitor feature)

ArchLinux dependencies

I had to install libusb and hidapi only before installing with pip.

sudo pacman -S libusb hidapi

pip install --user --upgrade cm-rgb

Feature request: Show CPU temperature as Fan color (contains prototype)

Are you interested in some code allowing for showing the CPU temperature using the fan color?

I coded a proof of concept version using pysensor for temperature value access, which is a wrapper for lm-sensors (additional requirements).

#!/usr/bin/env python3
from cm_rgb.ctrl import LedChannel, LedMode, CMRGBController
import psutil
import atexit
import time
import click

try:
    import sensors
    import ctypes
    atexit.register(sensors.cleanup)
    sensors.init()

except ImportError as e:
    print(e,
          "\n\nCould not import sensors.\n" +
          "Cannot show temperature as fan color.\n\n" +
          "To fix this, run:\npip3 install pysensors"
          )

@click.command()
@click.option("--bg-color",'bgColor', default='#00FFFF', help="Background LED's color")
@click.option("--cpu-color",'cpuColor', default='#FFA500', help="Color of the cpu load LED's")
@click.option('--brightness', type=click.IntRange(1, 5, clamp=True), default=3)
@click.option('--interval', type=click.FloatRange(0.01, 60, clamp=True), default=3)
@click.option("--show_temperature", is_flag=True)
def monitor(bgColor, cpuColor, brightness, interval, show_temperature):
    c = CMRGBController()

    bgChannel = LedChannel.R_STATIC
    cpuChannel = LedChannel.R_SWIRL

    b = [0x33,0x66,0x99,0xCC,0xFF][brightness-1]

    bgColor = bgColor.lstrip('#')
    col = [int(bgColor[i:i+2], 16) for i in (0, 2, 4)]
    c.set_channel(bgChannel,  LedMode.R_DEFAULT, b, col[0], col[1], col[2])

    cpuColor = cpuColor.lstrip('#')
    col = [int(cpuColor[i:i+2], 16) for i in (0, 2, 4)]
    c.set_channel(cpuChannel, LedMode.R_DEFAULT, b, col[0], col[1], col[2], 0x60)

    c.apply()


    def exit_handler():
        c.restore()

    atexit.register(exit_handler)

    low = {"t": 45, "color": [0, 64, 16]}
    high = {"t": 85, "color": [255, 0, 0]}

    if show_temperature:
        for chip in sensors.iter_detected_chips("k10temp-pci-00c3"):
            result_p = sensors._get_features(ctypes.byref(chip), ctypes.byref(ctypes.c_int(0)))
            if not result_p:
                break
            sensor = result_p.contents
            sensor.chip = chip

    while True:
        if show_temperature:
                print(sensor.label, sensor.get_value())
                t = sensor.get_value()
                interp_t = max(0, min(1, (t-low["t"])/(high["t"]-low["t"])))
                color = [
                    int(
                        interp_t * high["color"][i]
                        + (1 - interp_t)*low["color"][i]
                        )
                    for i in range(3)
                    ]
                print(color)

                c.set_channel(LedChannel.FAN, LedMode.STATIC, b, color[0], color[1], color[2])


        # gives a single float value
        cpu = psutil.cpu_percent()
        cpu_leds = int(round(cpu*15 / 100))

        total = 15 - cpu_leds

        ring_leds = ([cpuChannel]*cpu_leds)
        ring_leds = ring_leds + ([bgChannel]*total)

        shift = -8
        ring_leds = ring_leds[-shift:]+ring_leds[:-shift]

        c.assign_leds_to_channels(LedChannel.LOGO, LedChannel.FAN, *ring_leds)
        c.apply()


        time.sleep(interval)


if __name__ == '__main__':
    monitor()

If you are interested, I will clean it up a bit & create a pull request.

please go through this error

Traceback (most recent call last):
File "/usr/local/bin/cm-rgb-cli", line 181, in
main_group()
File "/home/user1/.local/lib/python3.7/site-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/home/user1/.local/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/user1/.local/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/user1/.local/lib/python3.7/site-packages/click/core.py", line 1268, in invoke
Command.invoke(self, ctx)
File "/home/user1/.local/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/user1/.local/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/user1/.local/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/bin/cm-rgb-cli", line 13, in setup_group
'ctrl': CMRGBController(),
File "/home/user1/.local/lib/python3.7/site-packages/cm_rgb/ctrl.py", line 54, in init
self.__init_hid_device()
File "/home/user1/.local/lib/python3.7/site-packages/cm_rgb/ctrl.py", line 61, in __init_hid_device
raise Exception("No devices found. See: #9")
Exception: No devices found. See: #9

Udev rule for macOS

Hello,

I have hackintosh machine with Ryzen 7 3700, I did install everything as required, however as far as I understood there is no udev for mac searching on Google and I cant add cm-rgb-cli add-udev-rule to access device.
I'm I missing something?

ERROR: Could not build wheels for PyGObject which use PEP 517 and cannot be installed directly

Error while installing using pip:
pip install cm-rgb

Processing /home/abhijay/Documents/clones/cm-rgb
Processing /home/abhijay/.cache/pip/wheels/77/e6/04/44ed63e242e5c576da83e0410120d084e9762d1911b1becf38/hidapi-0.9.0.post3-cp37-cp37m-linux_x86_64.whl
Requirement already satisfied: click in /home/abhijay/anaconda3/lib/python3.7/site-packages (from cm-rgb==0.3.4) (7.0)
Requirement already satisfied: psutil in /home/abhijay/anaconda3/lib/python3.7/site-packages (from cm-rgb==0.3.4) (5.6.7)
Collecting PyGObject
Using cached PyGObject-3.36.1.tar.gz (716 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Requirement already satisfied: setuptools>=19.0 in /home/abhijay/anaconda3/lib/python3.7/site-packages (from hidapi->cm-rgb==0.3.4) (49.6.0)
Requirement already satisfied: pycairo>=1.11.1 in /home/abhijay/anaconda3/lib/python3.7/site-packages (from PyGObject->cm-rgb==0.3.4) (1.11.1)
Building wheels for collected packages: cm-rgb, PyGObject
Building wheel for cm-rgb (setup.py) ... done
Created wheel for cm-rgb: filename=cm_rgb-0.3.4-py3-none-any.whl size=9216 sha256=4e34f5cc8689ef86432c881b393c48c616bdaa5d0385474d5b5e31cc25017ae0
Stored in directory: /home/abhijay/.cache/pip/wheels/60/31/da/c35036a9900e2c4067d8083c4b3a0799e89957eacd4b7c0649
Building wheel for PyGObject (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: /home/abhijay/anaconda3/bin/python /home/abhijay/anaconda3/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpb1nagat8
cwd: /tmp/pip-install-kka8rmmn/pygobject
Complete output (91 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/pygtkcompat
copying pygtkcompat/pygtkcompat.py -> build/lib.linux-x86_64-3.7/pygtkcompat
copying pygtkcompat/init.py -> build/lib.linux-x86_64-3.7/pygtkcompat
copying pygtkcompat/generictreemodel.py -> build/lib.linux-x86_64-3.7/pygtkcompat
creating build/lib.linux-x86_64-3.7/gi
copying gi/_constants.py -> build/lib.linux-x86_64-3.7/gi
copying gi/pygtkcompat.py -> build/lib.linux-x86_64-3.7/gi
copying gi/_ossighelper.py -> build/lib.linux-x86_64-3.7/gi
copying gi/init.py -> build/lib.linux-x86_64-3.7/gi
copying gi/_signalhelper.py -> build/lib.linux-x86_64-3.7/gi
copying gi/types.py -> build/lib.linux-x86_64-3.7/gi
copying gi/module.py -> build/lib.linux-x86_64-3.7/gi
copying gi/_gtktemplate.py -> build/lib.linux-x86_64-3.7/gi
copying gi/importer.py -> build/lib.linux-x86_64-3.7/gi
copying gi/_error.py -> build/lib.linux-x86_64-3.7/gi
copying gi/_compat.py -> build/lib.linux-x86_64-3.7/gi
copying gi/docstring.py -> build/lib.linux-x86_64-3.7/gi
copying gi/_propertyhelper.py -> build/lib.linux-x86_64-3.7/gi
copying gi/_option.py -> build/lib.linux-x86_64-3.7/gi
creating build/lib.linux-x86_64-3.7/gi/repository
copying gi/repository/init.py -> build/lib.linux-x86_64-3.7/gi/repository
creating build/lib.linux-x86_64-3.7/gi/overrides
copying gi/overrides/GdkPixbuf.py -> build/lib.linux-x86_64-3.7/gi/overrides
copying gi/overrides/init.py -> build/lib.linux-x86_64-3.7/gi/overrides
copying gi/overrides/Gtk.py -> build/lib.linux-x86_64-3.7/gi/overrides
copying gi/overrides/Gio.py -> build/lib.linux-x86_64-3.7/gi/overrides
copying gi/overrides/GLib.py -> build/lib.linux-x86_64-3.7/gi/overrides
copying gi/overrides/GIMarshallingTests.py -> build/lib.linux-x86_64-3.7/gi/overrides
copying gi/overrides/GObject.py -> build/lib.linux-x86_64-3.7/gi/overrides
copying gi/overrides/Gdk.py -> build/lib.linux-x86_64-3.7/gi/overrides
copying gi/overrides/Pango.py -> build/lib.linux-x86_64-3.7/gi/overrides
copying gi/overrides/keysyms.py -> build/lib.linux-x86_64-3.7/gi/overrides
running build_ext
pycairo: new API
Traceback (most recent call last):
File "/home/abhijay/anaconda3/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in
main()
File "/home/abhijay/anaconda3/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/abhijay/anaconda3/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 205, in build_wheel
metadata_directory)
File "/tmp/pip-build-env-28fmexef/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 230, in build_wheel
wheel_directory, config_settings)
File "/tmp/pip-build-env-28fmexef/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 215, in _build_with_temp_dir
self.run_setup()
File "/tmp/pip-build-env-28fmexef/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 267, in run_setup
self).run_setup(setup_script=setup_script)
File "/tmp/pip-build-env-28fmexef/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 158, in run_setup
exec(compile(code, file, 'exec'), locals())
File "setup.py", line 1288, in
main()
File "setup.py", line 1283, in main
zip_safe=False,
File "/tmp/pip-build-env-28fmexef/overlay/lib/python3.7/site-packages/setuptools/init.py", line 163, in setup
return distutils.core.setup(**attrs)
File "/home/abhijay/anaconda3/lib/python3.7/distutils/core.py", line 148, in setup
dist.run_commands()
File "/home/abhijay/anaconda3/lib/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/home/abhijay/anaconda3/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-28fmexef/overlay/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 290, in run
self.run_command('build')
File "/home/abhijay/anaconda3/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/abhijay/anaconda3/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/abhijay/anaconda3/lib/python3.7/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/home/abhijay/anaconda3/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/abhijay/anaconda3/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "setup.py", line 1118, in run
self._setup_extensions()
File "setup.py", line 1110, in _setup_extensions
add_pycairo(gi_cairo_ext)
File "setup.py", line 1093, in add_pycairo
ext.include_dirs += [get_pycairo_include_dir()]
File "setup.py", line 915, in get_pycairo_include_dir
include_dir = find_path(find_new_api())
File "setup.py", line 860, in find_new_api
import cairo
File "/tmp/pip-build-env-28fmexef/overlay/lib/python3.7/site-packages/cairo/init.py", line 1, in
from ._cairo import * # noqa: F401,F403
ImportError: /tmp/pip-build-env-28fmexef/overlay/lib/python3.7/site-packages/cairo/_cairo.cpython-37m-x86_64-linux-gnu.so: undefined symbol: cairo_svg_surface_set_document_unit

ERROR: Failed building wheel for PyGObject
Successfully built cm-rgb
Failed to build PyGObject
ERROR: Could not build wheels for PyGObject which use PEP 517 and cannot be installed directly

leds still on

I went through the steps to turn off the led light on the fan. everything went great except the lights are still on. what went wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.