You are not logged in.

#1 2024-09-05 11:45:28

archuser_9999
Member
Registered: 2019-08-17
Posts: 90

[SOLVED] Problem with i2c?? Cannot fathom

Firstly - mods, I respect keeping this forum tidy etc. Was really unsure whether to tag this onto my earlier post, which I marked as [SOLVED] because yes, the solution to that exact question was to run OpenRGB as a system service. I have managed to do that. However, subsequent failure to load the exact required config means I decided to treat this as a new issue. Please advise if I need to simply wrap all this into the earlier post.

Issue: following advice and suggestions, I have enabled openRGB as a system unit. I edited the file

/usr/lib/systemd/system/openrgb.service

so that it points to my local configuration file. Despite this, my mouse is still not being correctly set up,

If I

$  openrgb
Attempting to connect to local OpenRGB server.
Connected to server
Network client listener started
Client: Received controller count from server: 2
Client: Requesting controller 0
Client: Requesting controller 1
Client: All controllers received, adding them to master list
Local OpenRGB server connected, running in client mode

the GUI opens. In it, I can see my mouse listed, as well as my mainboard. If I check "settings" I note that it has correctly stored options such as "start server" "load profile" and "set profile on exit" etc.

But... until I actually click inside the GUI firstly on the button for "<name_of_profile>" followed by "load profile", my mouse is not correctly illuminated.

What confuses me about the whole issue - hence why I'm posting here and not on their Discord, is that I've tried to follow all the steps to ensure that I have everything correctly configured in Arch. I have added

/etc/modules-load.d/i2c.conf
    i2c-dev
    i2c-i801

following their instructions, despite I read the Arch Wiki which suggests this step may no longer be necessary.

So, for example  if I

$  openrgb -l
Attempting to connect to local OpenRGB server.
Connected to server
Network client listener started
Client: Received controller count from server: 2
Client: Requesting controller 0
Client: Requesting controller 1
Client: All controllers received, adding them to master list
Local OpenRGB server connected, running in client mode
0: SteelSeries Rival 3
  Type:           Mouse
  Description:    SteelSeries Mouse Device
  Version:        39
  Location:       HID: /dev/hidraw3
  Modes: [Direct] Breathing 'Spectrum Cycle' 'Rainbow Breathing'
  Zones: Front Middle Rear Logo
  LEDs: Front Middle Rear Logo

1: MSI B365M PRO-VDH(MS-7C39)
  Type:           Motherboard
  Description:    MSI-RGB Device
  Modes: [Direct]
  Zones: 'MSI Zone'
  LEDs: 'MSI LED'

seems to indicate that all is well. But, if I

$  systemctl status openrgb
● openrgb.service - Run OpenRGB server
     Loaded: loaded (/usr/lib/systemd/system/openrgb.service; enabled; preset: disabled)
     Active: active (running) since Thu 2024-09-05 13:14:20 CEST; 16min ago
 Invocation: 7f4a6c9f9e6c4913a5783eb10f6fde45
   Main PID: 497 (openrgb)
      Tasks: 10 (limit: 28652)
     Memory: 24M (peak: 25.9M)
        CPU: 24.457s
     CGroup: /system.slice/openrgb.service
             └─497 /usr/bin/openrgb --server --config /home/alan/.config/OpenRGB

Sep 05 13:14:20 Snazz systemd[1]: Started Run OpenRGB server.
Sep 05 13:14:21 Snazz openrgb[497]: Attempting to connect to local OpenRGB server.
Sep 05 13:14:21 Snazz openrgb[497]: Connection attempt failed
Sep 05 13:14:21 Snazz openrgb[497]: Local OpenRGB server unavailable.
Sep 05 13:14:21 Snazz openrgb[497]: Running standalone.
Sep 05 13:14:21 Snazz openrgb[497]: Network connection thread started on port 6742
Sep 05 13:14:21 Snazz openrgb[497]: [i2c_smbus_linux] Failed to read i2c device PCI device ID

I seem to have an error. However,

$  i2cdetect -l
i2c-0	i2c       	i915 gmbus dpc                  	I2C adapter
i2c-1	i2c       	i915 gmbus dpb                  	I2C adapter
i2c-2	i2c       	i915 gmbus dpd                  	I2C adapter
i2c-3	i2c       	AUX D/DDI D/PHY D               	I2C adapter
i2c-4	smbus     	SMBus I801 adapter at f040      	SMBus adapter

and, I am in the i2c group.

I must be missing something fairly simple no doubt, but cannot figure out which additonal step or config I need to add? To recap: despite having tried to set everything necessary, when the openrgb.service starts, my configuration is not applied unless I do it manually from within the GUI.

Last edited by archuser_9999 (2024-09-07 07:23:08)

Offline

#2 2024-09-05 14:28:51

seth
Member
Registered: 2012-09-03
Posts: 60,378

Re: [SOLVED] Problem with i2c?? Cannot fathom

If you disable the service, boot and then manually start it, does it work as expected?

Offline

#3 2024-09-05 14:48:02

archuser_9999
Member
Registered: 2019-08-17
Posts: 90

Re: [SOLVED] Problem with i2c?? Cannot fathom

aah, well this is interesting, even if I'm still in the dark. Point to note: it would seem that there's a degree of "retention" in the mouse/mainboard, so in testing between reboots I have to leave everything unplugged for a minute so as to be sure the mouse isn't picking up on some held setting.

I note that this time, when booting without the service enabled, instead of my mouse being the wrong colour, and the wrong zones applied, it was not illuminated at all. I started the service, got no messages or errors from the terminal. So I checked the journal

$  journalctl -b -u openrgb
Sep 05 16:37:41 Snazz systemd[1]: Started Run OpenRGB server.
Sep 05 16:37:43 Snazz openrgb[1076]: Attempting to connect to local OpenRGB server.
Sep 05 16:37:43 Snazz openrgb[1076]: Connection attempt failed
Sep 05 16:37:43 Snazz openrgb[1076]: Local OpenRGB server unavailable.
Sep 05 16:37:43 Snazz openrgb[1076]: Running standalone.
Sep 05 16:37:43 Snazz openrgb[1076]: Network connection thread started on port 6742
Sep 05 16:37:43 Snazz openrgb[1076]: [i2c_smbus_linux] Failed to read i2c device PCI device ID

This at least tells me that whatever the issue was, at some point there was some part of openrgb running. In this above, I see that there's no pick up on the settings, because it's not even running the server etc.

I then ran it directly in the terminal

$ openrgb
Attempting to connect to local OpenRGB server.
Connected to server
Network client listener started
Client: Received controller count from server: 2
Client: Requesting controller 0
Client: Requesting controller 1
Client: All controllers received, adding them to master list
Local OpenRGB server connected, running in client mode

which was successful, but... it was still necessary for me to click on the profile name in the GUI, click "load profile" for it to apply.

Offline

#4 2024-09-05 15:25:32

seth
Member
Registered: 2012-09-03
Posts: 60,378

Re: [SOLVED] Problem with i2c?? Cannot fathom

The client is running but no server, the plan was to delay the invocation of "/usr/bin/openrgb --server --config /home/alan/.config/OpenRGB"
You can also edit the service and add "ExecStartPre=sleep 10"

Stoupid question, is that even proper usage?
A system-wide daemon to load a user specific config seems weird, I'd assume you've to launch "openrgb --server" as system service and at some point "openrgb --config ~/.config/OpenRGB" as your regular user.

Since it doesn't provide a manpage or non-adhs documentation on their homepage, does "openrgb --help" give you some instructions?

Offline

#5 2024-09-05 15:48:36

archuser_9999
Member
Registered: 2019-08-17
Posts: 90

Re: [SOLVED] Problem with i2c?? Cannot fathom

aha! Although I had indeed looked at the help (yes, it has one), I'm only now twigging onto the idea that... instead of trying to do some "automatic" as in out-of-the-box installation, perhaps I can forget the GUI entirely (since it's only a simple config I'm after) and just add all the options into the service file?

So, whereas (I only now notice!!) I have

[Unit]
Description=Run OpenRGB server
After=network.target lm_sensors.service

[Service]
ExecStart=/usr/bin/openrgb --client --config path /home/alan/.config/OpenRGB
Restart=on-failure

[Install]
WantedBy=multi-user.target

I'm being a bit dim,... because there is a --client option, as well as options for directly settings colours and zones via cmd.

So, I'm going to try firstly setting it into client mode (doh!!), and then just specifying the zone numbers and hex codes direct in the above service file... see if that works smile

Offline

#6 2024-09-05 16:16:27

seth
Member
Registered: 2012-09-03
Posts: 60,378

Re: [SOLVED] Problem with i2c?? Cannot fathom

"--config path /home/alan/.config/OpenRGB" looks wrong and I'd maybe try w/o specifying client or server

Offline

#7 2024-09-05 17:01:28

archuser_9999
Member
Registered: 2019-08-17
Posts: 90

Re: [SOLVED] Problem with i2c?? Cannot fathom

Well... buried in some docs, turns out somebody has very helpfully created a service file to run under systemd. I'll put it here because it may help others - despite one might argue I should have seen this ages ago!

 /usr/lib/systemd/system/openrgb.service                                          

[Unit]
Description=OpenRGB control

[Service]
Type=oneshot
ExecStart=/usr/bin/openrgb -c 0000ff -m Direct
User=nobody
Group=i2c

[Install]
WantedBy=multi-user.target

however, it's still a mess because while the colour was passed on (directly) to the mouse, I have this in journalctl

[?] /usr/lib/systemd/system/openrgb.service:7: Special user nobody configured, this is not safe!
Sep 05 18:49:07 Snazz systemd[1]: Starting OpenRGB control...
Sep 05 18:49:08 Snazz openrgb[4872]: Attempting to connect to local OpenRGB server.
Sep 05 18:49:08 Snazz openrgb[4872]: Connection attempt failed
Sep 05 18:49:08 Snazz openrgb[4872]: Local OpenRGB server unavailable.
Sep 05 18:49:08 Snazz openrgb[4872]: Running standalone.
Sep 05 18:49:08 Snazz openrgb[4872]: [i2c_smbus_linux] Failed to read i2c device PCI device ID
Sep 05 18:49:10 Snazz systemd[1]: openrgb.service: Deactivated successfully.
Sep 05 18:49:10 Snazz systemd[1]: Finished OpenRGB control.

I've been messing about trying to add the listed command flags into this unit file... presumably I never need to see the GUI again if this works. But, I still seem to have this issue whereby it cannot read the device ID from the smbus, and this despite (above posts) as fas as I can tell, I have everything set up correctly.

So, since I happen to belong to the i2c group, I'll change the relevant line in the unit.

The GUI lets me set all four zones of the mouse correctly. The cmd instructions offer these options, but I cannot FOR THE LIFE OF ME work out how to correctly set them, and from an hour of searches... it seems the entire world uses the GUI because I haven't been able to find a single explanation of how to thereby set per-zone colour via cmd.

$  openrgb --help
OpenRGB 0.9, for controlling RGB lighting.
Usage: OpenRGB (--device [--mode] [--color])...

Options:
--gui                                    Shows the GUI. GUI also appears when not passing any parameters
--startminimized                         Starts the GUI minimized to tray. Implies --gui, even if not specified
--client [IP]:[Port]                     Starts an SDK client on the given IP:Port (assumes port 6742 if not specified)
--server                                 Starts the SDK's server
--server-port                            Sets the SDK's server port. Default: 6742 (1024-65535)
-l,  --list-devices                      Lists every compatible device with their number
-d,  --device [0-9 | "name"]             Selects device to apply colors and/or effect to, or applies to all devices if omitted
                                           Basic string search is implemented 3 characters or more
                                           Can be specified multiple times with different modes and colors
-z,  --zone [0-9]                        Selects zone to apply colors and/or sizes to, or applies to all zones in device if omitted
                                           Must be specified after specifying a device
-c,  --color [random | FFFFF,00AAFF ...] Sets colors on each device directly if no effect is specified, and sets the effect color if an effect is specified
                                           If there are more LEDs than colors given, the last color will be applied to the remaining LEDs
-m,  --mode [breathing | static | ...]   Sets the mode to be applied, check --list-devices to see which modes are supported on your device
-b,  --brightness [0-100]                Sets the brightness as a percentage if the mode supports brightness
-s,  --size [0-N]                        Sets the new size of the specified device zone.
                                           Must be specified after specifying a zone.
                                           If the specified size is out of range, or the zone does not offer resizing capability, the size will not be changed
-V,  --version                           Display version and software build information
-p,  --profile filename[.orp]            Load the profile from filename/filename.orp
-sp, --save-profile filename.orp         Save the given settings to profile filename.orp
--i2c-tools                              Shows the I2C/SMBus Tools page in the GUI. Implies --gui, even if not specified.
                                           USE I2C TOOLS AT YOUR OWN RISK! Don't use this option if you don't know what you're doing!
                                           There is a risk of bricking your motherboard, RGB controller, and RAM if you send invalid SMBus/I2C transactions.
--localconfig                            Use the current working directory instead of the global configuration directory.
--config path                            Use a custom path instead of the global configuration directory.
--nodetect                               Do not try to detect hardware at startup.
--noautoconnect                          Do not try to autoconnect to a local server at startup.
--loglevel [0-6 | error | warning ...]   Set the log level (0: fatal to 6: trace).
--print-source                           Print the source code file and line number for each log entry.
-v,  --verbose                           Print log messages to stdout.
-vv, --very-verbose                      Print debug messages and log messages to stdout.
--autostart-check                        Check if OpenRGB starting at login is enabled.
--autostart-disable                      Disable OpenRGB starting at login.
--autostart-enable arguments             Enable OpenRGB to start at login. Requires arguments to give to OpenRGB at login.

I get frustrated because I can read the help file, but I'm not a programmer, and the *obvious* use of commands eludes me... do I use comma separated values? I'm close to giving up.

Offline

#8 2024-09-05 19:28:59

seth
Member
Registered: 2012-09-03
Posts: 60,378

Re: [SOLVED] Problem with i2c?? Cannot fathom

-m,  --mode [breathing | static | ...]   Sets the mode to be applied, check --list-devices to see which modes are supported on your device

Stop any openrgb services
=> What's the output of

openrgb --list-devices

What happens if you run (as your regular user)

openrgb -c 0000ff # that's blue

or sudo it?

sudo openrgb -c 0000ff # that's blue

What if you start the server (as root)

sudo openrgb --server

and then try

openrgb -c 0000ff # that's blue

again?

Before messing around w/ any system services you want to figure whether and how you can set  the colors (or whatever is relevant) interactively (but w/o GUI), *then* automatize that.

Offline

#9 2024-09-05 19:36:36

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,603

Re: [SOLVED] Problem with i2c?? Cannot fathom

I suggest you don't set an user at all, let the root ran service handle this and just run it as root.

-c,  --color [random | FFFFF,00AAFF ...] Sets colors on each device directly if no effect is specified, and sets the effect color if an effect is specified
                                           If there are more LEDs than colors given, the last color will be applied to the remaining LEDs

the [ ] definition means optional between random "|" (or) a comma seperated list (...) of values. Use it as many times as you have leds or set a single color to apply to all leds.

Soo if we take the rules for device name into consideration as well. The correct standalone command should be

openrgb -d "SteelSeries Rival 3" -c 0000ff -m Direct

you probably shouldn't worry about the i2c error too much, I get some of these as well but it works correctly with all devices.

F5RefreshPseudoEdit: Run through seth's steps as well so you understand the correlation of things.

Offline

#10 2024-09-05 20:15:11

archuser_9999
Member
Registered: 2019-08-17
Posts: 90

Re: [SOLVED] Problem with i2c?? Cannot fathom

@#8 @seth

good plan! To condense the several steps you suggest into a single reply...

it makes no difference to the messages printed to the terminal whether I run as root or as user - the results appear to be exactly the same.

I ran commands based on your idea... with small variations. 1st option: this didn't obviously change anything. It's the same result as

$ openrgb -l

which I had posted above. I note with interest that while it states that it cannot read i2c, there's a 0: appeared, presumably making this device 0: I also note that unlike the GUI it doesn't pick up or list my MSI mainboard.

$  openrgb --list-devices
Attempting to connect to local OpenRGB server.
Connection attempt failed
Local OpenRGB server unavailable.
Running standalone.
[i2c_smbus_linux] Failed to read i2c device PCI device ID
0: SteelSeries Rival 3
  Type:           Mouse
  Description:    SteelSeries Mouse Device
  Version:        39
  Location:       HID: /dev/hidraw3
  Modes: [Direct] Breathing 'Spectrum Cycle' 'Rainbow Breathing'
  Zones: Front Middle Rear Logo
  LEDs: Front Middle Rear Logo

Next was the below, which gave the same errors but was successful (I use green to see that colour actually changes)

$  openrgb -c green
Attempting to connect to local OpenRGB server.
Connection attempt failed
Local OpenRGB server unavailable.
Running standalone.
[i2c_smbus_linux] Failed to read i2c device PCI device ID

Then this, which didn't finish executing, it just left me hanging in the terminal

$  sudo openrgb --server
Attempting to connect to local OpenRGB server.
Connection attempt failed
Local OpenRGB server unavailable.
Running standalone.
Network connection thread started on port 6742
[i2c_smbus_linux] Failed to read i2c device PCI device ID

Finally this, which worked (!?)

$  openrgb --server -d "SteelSeries Rival 3" -c red -m Breathing
Attempting to connect to local OpenRGB server.
Connection attempt failed
Local OpenRGB server unavailable.
Running standalone.
Network connection thread started on port 6742
[i2c_smbus_linux] Failed to read i2c device PCI device ID

So... while I understand what you're suggesting i.e. find out where it's failing, and then worry about the niceties... I can't say. It works - some of the time, under some conditions. Other times nothing happens.

A couple of things I perhaps ought to mention too... I run a minimal installation using .xinitrc which, apart from loading up a basic permissions manager, also starts xgamma to set brightness, and fehbg to set a wallpaper. I also load picom as compositor in X before I start i3. Can't imagine those are interfering?

Other thing to mention is that while trying to sort this issue for myself I was following some suggestion I found online, and through which I ran

$ sudo ls -la /dev/hidraw*

and which indeed told me that they are in the 'root' group and, following same instructions, then created

/usr/lib/udev/rules.d/60-hidraw.rules << EOF
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0660", GROUP="plugdev"

except that I didn't add the group definition because there is no plugdev group on this installation. There is an i2c group though, of which I am a member. Should I try adding "GROUP="i2c" perhaps?

Offline

#11 2024-09-05 20:22:39

archuser_9999
Member
Registered: 2019-08-17
Posts: 90

Re: [SOLVED] Problem with i2c?? Cannot fathom

@#9 @V1del

Thank you for unpacking the mystery of the command syntax! How hard would that have been for some kind soul to have included in their Wiki?

Anyway, as you'll probably see in my above reply, I have some success. And since you have also encountered messages about i2c well... I may indeed just end up ignoring them. But you can help me further if you feel so inclined.

You'll see from

$ openrgb -l

that it describes the four zones of my mouse. And I do indeed want to set a distinct colour for zone Logo (black, which basically turns off the illumination).

So, the bit I was unable to work out successfully was combining the --zone settings with the --colour settings.

Would I do something like this?

$ openrgb -d 0: -z 1 -c 0000ff, -z 2 -c 0000ff <add further as necessary>

or do how do I set this? I could use the descriptions and not zone numbers, and the GUI will do this, I just don't know how to convert what the GUI does into command line.

If I don't run a server it defaults to client mode. I can see no reason to actually run a server, as all it's for is to colour my mouse. I'm not running a light show with my RAM and cooler etc.

Offline

#12 2024-09-05 20:29:26

seth
Member
Registered: 2012-09-03
Posts: 60,378

Re: [SOLVED] Problem with i2c?? Cannot fathom

If you're not running "--server" it tries to connect to a server - the thing you terminated because "it just left me hanging in the terminal" (ie. --server doesn't fork)
But if it can't connect to it, it runs alone and "openrgb -c green" and "openrgb --server -d "SteelSeries Rival 3" -c red -m Breathing" were succesful (as I supposed V1del's 'openrgb -d "SteelSeries Rival 3" -c 0000ff -m Direct' will be)

=> running such command in your xinitrc or as user service should™ be fine.

Would I do something like this?

Did you try?
(I'll likely get you an error)

-c,  --color [random | FFFFF,00AAFF ...] Sets colors on each device directly if no effect is specified, and sets the effect color if an effect is specified
                                           If there are more LEDs than colors given, the last color will be applied to the remaining LEDs

There're 4 LEDs, equivalent to the 4 Zones

openrgb -d "SteelSeries Rival 3" -c 0000ff,0000ff,0000ff,000000 -m Direct

Offline

#13 2024-09-05 20:34:28

archuser_9999
Member
Registered: 2019-08-17
Posts: 90

Re: [SOLVED] Problem with i2c?? Cannot fathom

and for which I thank you greatly... it works! Blimey.

But, since I can be a picky so-and-so, the reason I took it out of my .xinitrc was because it initially didn't work (that was where I started all of this) and because I actually wanted the mouse colour set during boot rather than during/after login.

However, I think with both you your help, I can at least put together something that will give me what I want, even if it finally lacks the polish I was hoping for big_smile

Offline

#14 2024-09-05 20:39:05

seth
Member
Registered: 2012-09-03
Posts: 60,378

Re: [SOLVED] Problem with i2c?? Cannot fathom

I actually wanted the mouse colour set during boot rather than during/after login.

You could make a systemd (system) service for that - the pitfall is that the service might get triggered before the HW is ready.
=> a udev rule might be the better solution: https://wiki.archlinux.org/title/Udev#About_udev_rules

Offline

#15 2024-09-05 20:44:08

archuser_9999
Member
Registered: 2019-08-17
Posts: 90

Re: [SOLVED] Problem with i2c?? Cannot fathom

oh, right so... not so much a "class" udev rule (for hidraw*) but a udev rule just for this device?

Nice. I had never really understood this concept until now smile

Offline

Board footer

Powered by FluxBB