Comments (6)
Unfortunately, OpenRGB has no idea how many ARGB LEDs are connected to the header (that's why there is a resize option at all), so there will never be any error for you catch. The error you are running into is probably caused by repeatedly calling resize
and set_color
without any delay. This warning from the docs actually applies to any operation that interacts with SDK server. I'll update the docs to reflect that.
Does resizing to 10 LEDs cause the error even when done outside of a loop? If so, does resizing to 10 LEDs cause the error if you do it with the resize button on OpenRGB itself?
from openrgb-python.
Resizing to 10 with delay or from openrgb GUI does not cause this error. It just happened to happen when doing resizing in loop :) So I can forget trying to find correct LED size. Why I was asking this is that it seems that resize() does not seem to change zone.leds list at the first run.
If I turn on openrgb server and do this for every ZoneType.Linear device (ARGB_LEDS = 9, the amount of leds in my fans):
loop:
print('zone %s type %s' % (zone.name, zone.type))
if len(zone.leds) != ARGB_LEDS:
print('resize to %s' % ARGB_LEDS)
zone.resize(ARGB_LEDS)
time.sleep(0.1)
print('led count: %s' % len(zone.leds))
I get prints:
zone D_LED1 Bottom type ZoneType.LINEAR
resize to 9
led count: 10
zone D_LED2 Top type ZoneType.LINEAR
resize to 9
led count: 0
zone D_LED1 Bottom type ZoneType.LINEAR
resize to 9
led count: 0
zone D_LED2 Top type ZoneType.LINEAR
resize to 9
led count: 0
If I do the same with 3 second delay I get same result (run openrgb server and run script). I don't close openrgb between runs, then led count is correct at second run. If I run resize(), when it is expected to zone.leds list be populated?
Here is both runs with prints from my rgb script 3second delay after resize (script generates random colors and sets them to all devices):
subterfugium@pc:~$ rgb
B550 AORUS ELITE
zone D_LED1 Bottom type ZoneType.LINEAR
resize to 9
led count: 10
- Set D_LED1 Bottom ARGB 10 leds to rosybrown greenyellow (gradient=False)
zone D_LED2 Top type ZoneType.LINEAR
resize to 9
led count: 0
- Set D_LED2 Top ARGB 0 leds to rosybrown greenyellow (gradient=False)
zone Motherboard type ZoneType.SINGLE
- Set Back I/O one of ['rosybrown', 'greenyellow'] colors
- Set CPU Header one of ['rosybrown', 'greenyellow'] colors
- Set PCIe one of ['rosybrown', 'greenyellow'] colors
- Set LED C1/C2 one of ['rosybrown', 'greenyellow'] colors
B550 AORUS ELITE
zone D_LED1 Bottom type ZoneType.LINEAR
resize to 9
led count: 0
- Set D_LED1 Bottom ARGB 0 leds to rosybrown greenyellow (gradient=False)
zone D_LED2 Top type ZoneType.LINEAR
resize to 9
led count: 0
- Set D_LED2 Top ARGB 0 leds to rosybrown greenyellow (gradient=False)
zone Motherboard type ZoneType.SINGLE
- Set Back I/O one of ['rosybrown', 'greenyellow'] colors
- Set CPU Header one of ['rosybrown', 'greenyellow'] colors
- Set PCIe one of ['rosybrown', 'greenyellow'] colors
- Set LED C1/C2 one of ['rosybrown', 'greenyellow'] colors
ASUS Aura DRAM
- Set ASUS Aura DRAM RAM 8 leds to rosybrown greenyellow (gradient=False)
ASUS Aura DRAM
- Set ASUS Aura DRAM RAM 8 leds to rosybrown greenyellow (gradient=False)
subterfugium@pc:~$ rgb
B550 AORUS ELITE
zone D_LED1 Bottom type ZoneType.LINEAR
- Set D_LED1 Bottom ARGB 9 leds to magenta yellow (gradient=True)
zone D_LED2 Top type ZoneType.LINEAR
- Set D_LED2 Top ARGB 9 leds to magenta yellow (gradient=True)
zone Motherboard type ZoneType.SINGLE
- Set Back I/O one of ['magenta', 'yellow'] colors
- Set CPU Header one of ['magenta', 'yellow'] colors
- Set PCIe one of ['magenta', 'yellow'] colors
- Set LED C1/C2 one of ['magenta', 'yellow'] colors
B550 AORUS ELITE
zone D_LED1 Bottom type ZoneType.LINEAR
- Set D_LED1 Bottom ARGB 9 leds to magenta yellow (gradient=True)
zone D_LED2 Top type ZoneType.LINEAR
- Set D_LED2 Top ARGB 9 leds to magenta yellow (gradient=True)
zone Motherboard type ZoneType.SINGLE
- Set Back I/O one of ['magenta', 'yellow'] colors
- Set CPU Header one of ['magenta', 'yellow'] colors
- Set PCIe one of ['magenta', 'yellow'] colors
- Set LED C1/C2 one of ['magenta', 'yellow'] colors
ASUS Aura DRAM
- Set ASUS Aura DRAM RAM 8 leds to magenta yellow (gradient=True)
ASUS Aura DRAM
- Set ASUS Aura DRAM RAM 8 leds to magenta yellow (gradient=True)
from openrgb-python.
Ah, I see the problem. When openrgb-python gets the new information from the server (new LEDs), it isn't updating zones stored in separate variables. For you right now, a workaround is to not store zones in separate variables from the device. Like using device.zones[i]
instead of assigning zone = device.zones[i]
and using zone
. I should get a fix for this in the next few days, but I'm not sure when the fix will make it into a pypi release.
from openrgb-python.
Oh okay. I can can pull and do local pip install, just let me know!
from openrgb-python.
Can you test how it works on the latest commit and reopen the issue if there are any problems?
from openrgb-python.
Yes, now leds count is updated after using resize
B550 AORUS ELITE
+ zone D_LED1 Bottom type ZoneType.LINEAR
resize to 9
led count: 9
- Set D_LED1 Bottom ARGB 9 leds to lightsalmon orchid darkred (gradient=False)
+ zone D_LED2 Top type ZoneType.LINEAR
resize to 9
led count: 9
- Set D_LED2 Top ARGB 9 leds to lightsalmon orchid darkred (gradient=False)
+ zone Motherboard type ZoneType.SINGLE
- Set Back I/O one of ['lightsalmon', 'orchid', 'darkred'] colors
- Set CPU Header one of ['lightsalmon', 'orchid', 'darkred'] colors
- Set PCIe one of ['lightsalmon', 'orchid', 'darkred'] colors
- Set LED C1/C2 one of ['lightsalmon', 'orchid', 'darkred'] colors
B550 AORUS ELITE
+ zone D_LED1 Bottom type ZoneType.LINEAR
resize to 9
led count: 9
- Set D_LED1 Bottom ARGB 9 leds to lightsalmon orchid darkred (gradient=False)
+ zone D_LED2 Top type ZoneType.LINEAR
resize to 9
led count: 9
- Set D_LED2 Top ARGB 9 leds to lightsalmon orchid darkred (gradient=False)
+ zone Motherboard type ZoneType.SINGLE
- Set Back I/O one of ['lightsalmon', 'orchid', 'darkred'] colors
- Set CPU Header one of ['lightsalmon', 'orchid', 'darkred'] colors
- Set PCIe one of ['lightsalmon', 'orchid', 'darkred'] colors
- Set LED C1/C2 one of ['lightsalmon', 'orchid', 'darkred'] colors
ASUS Aura DRAM
- Set ASUS Aura DRAM RAM 8 leds to lightsalmon orchid darkred (gradient=False)
ASUS Aura DRAM
- Set ASUS Aura DRAM RAM 8 leds to lightsalmon orchid darkred (gradient=False)
I run script second time then resize is not needed as leds count is already there. Perfect.
Just for some reason it's skipping 2nd ARGB header on my mobo. Probably something to to do with openrgb itself as it detects my mobo twice. Need to investigate more.
2: B550 AORUS ELITE
Type: Motherboard
Description: IT5702-GIGABYTE V2.0.8.0
Version: 0x00080002
Location: HID: /dev/hidraw1
Serial: 0x57020100
Modes: [Direct] Static Breathing Blinking 'Color Cycle' Flashing
Zones: 'D_LED1 Bottom' 'D_LED2 Top' Motherboard
LEDs: 'D_LED1 Bottom LED 0' 'D_LED1 Bottom LED 1' 'D_LED1 Bottom LED 2' 'D_LED1 Bottom LED 3' 'D_LED1 Bottom LED 4' 'D_LED1 Bottom LED 5' 'D_LED1 Bottom LED 6' 'D_LED1 Bottom LED 7' 'D_LED1 Bottom LED 8' 'D_LED1 Bottom LED 9' 'Back I/O' 'CPU Header' PCIe 'LED C1/C2'
3: B550 AORUS ELITE
Type: Motherboard
Description: IT5702-GIGABYTE V2.0.8.0
Version: 0x00080002
Location: HID: /dev/hidraw1
Serial: 0x57020100
Modes: [Direct] Static Breathing Blinking 'Color Cycle' Flashing
Zones: 'D_LED1 Bottom' 'D_LED2 Top' Motherboard
LEDs: 'Back I/O' 'CPU Header' PCIe 'LED C1/C2'
from openrgb-python.
Related Issues (20)
- Issue with brigtness with protocol < 3 ? HOT 1
- set_color of LED Class doesn't take into account zones HOT 2
- TypeError: set_colors() got multiple values for argument 'fast' HOT 1
- OpenRGBDisconnected When Setting Color for Zone HOT 5
- "fast" is no-op in Device.set_color and Device.set_colors HOT 1
- Last LED in addressable strip getting wrong color HOT 1
- Execution error occurs when trying ot connect to openRGB server through specific platform HOT 8
- Newbie question/error: ImportError: cannot import name 'OpenRGBClient' from partially initialized module 'openrgb' (most likely due to a circular import) HOT 2
- IndexError on connection HOT 2
- Error when enabling Razer Blade 15 keyboard HOT 4
- Can't connect when Corsair K95 RGB Platinum is enabled HOT 3
- Is there a function to "Rescan Devices" via the API? HOT 2
- Connection drops when doing set color and fast is disabled HOT 3
- Autostart server HOT 1
- openrgb-python and OpenRGB 0.8: not setting all leds HOT 1
- error when calling OpenRGBClient() HOT 6
- TCP_NODELAY HOT 7
- Can't initialize
- "3072 is not a valid ModeColors" HOT 3
- Timeout ? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openrgb-python.