Giter Club home page Giter Club logo

Comments (6)

jath03 avatar jath03 commented on June 11, 2024

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.
image
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.

subterfugium avatar subterfugium commented on June 11, 2024

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.

jath03 avatar jath03 commented on June 11, 2024

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.

subterfugium avatar subterfugium commented on June 11, 2024

Oh okay. I can can pull and do local pip install, just let me know!

from openrgb-python.

jath03 avatar jath03 commented on June 11, 2024

Can you test how it works on the latest commit and reopen the issue if there are any problems?

from openrgb-python.

subterfugium avatar subterfugium commented on June 11, 2024

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)

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.