FedeDP / Clightd

A linux bus interface that lets you change screen brightness, compute captured webcam frames brightness and change screen temperature.
GNU General Public License v3.0
82 stars 10 forks source link

ALS not working #88

Closed guillaumeboehm closed 10 months ago

guillaumeboehm commented 2 years ago

I'm using a Delta 15 A5EFK laptop under Arch-5.19.1-zen1-1-zen with clight 4.8-fc3df9c and clightd 5.6-77b1953.

Here is my clight.log busctl call org.clightd.clightd /org/clightd/clightd/Sensor/Als org.clightd.clightd.Sensor IsAvailable "s" "" returns sb "/dev/iio:device0" true The https://github.com/FedeDP/Clight/issues/111#issuecomment-573604758 fix results in AE_NOT_FOUND

I'm starting to run out of options and don't know where to look anymore.

FedeDP commented 2 years ago

Hi! Thanks for opening this issue! What does clightd Capture method say (instead of the IsAvailable one)?

guillaumeboehm commented 2 years ago

Hi, not exactly sure what you want me to test but running something like busctl call org.clightd.clightd /org/clightd/clightd/Sensor/Als org.clightd.clightd.Sensor Capture "sis" "" 5 "" returns sad "/dev/iio:device0" 5 0 0 0 0 0

FedeDP commented 2 years ago

Hi! Exactly that, thank you! That's really weird (of course it is!); I will give it a proper look once I am back home with a proper laptop :) (on vacation rn!)

guillaumeboehm commented 2 years ago

Sure thing, thanks a lot. Here is my clight.conf in case it helps. Have a great rest of your vacation.

FedeDP commented 2 years ago

Thank you! :)

FedeDP commented 2 years ago

The clight conf is fine indeed! It seems like the issue is that the Clightd ALS module is not able to capture through the als device, even if it finds it. As you can see, the ALS capture method is pretty simple: https://github.com/FedeDP/Clightd/blob/master/src/modules/sensors/als.c#L60.

To debug your issue, you can try this (very simple) patch:

diff --git a/src/modules/sensors/als.c b/src/modules/sensors/als.c
index 016ad1c..f94f3ba 100644
--- a/src/modules/sensors/als.c
+++ b/src/modules/sensors/als.c
@@ -72,6 +72,8 @@ static int capture(void *dev, double *pct, const int num_captures, char *setting
             scale = atof(val);
         }
     }
+    
+    printf("Scale: %lf\n", scale);

     for (int i = 0; i < num_captures; i++) {
         struct udev_device *non_cached_dev = udev_device_new_from_syspath(udev, udev_device_get_syspath(dev));
@@ -79,6 +81,7 @@ static int capture(void *dev, double *pct, const int num_captures, char *setting
         for (int j = 0; j < SIZE(ill_names) && illuminance == -1; j++) {
             val = udev_device_get_sysattr_value(non_cached_dev, ill_names[j]);
             if (val) {
+                printf("Val: %s\n", val);
                 illuminance = atof(val) * scale;
                 ctr++;
                 pct[i] = compute_value(illuminance);

and then, manually run Clightd; the quicker way is:

hedmo commented 1 year ago

hi . i jump in this issue as well because of the the title. i have many systems and all have the same problems. the ALS is always reports 0%. when i check on sensor-monitor (iio-sensor-proxy) i can see changes when i use a lamp to the sensor but not in clight . camera (video0) works. i will add the patch to my ebuild and report back.

FedeDP commented 1 year ago

Hi @hedmo ! Any news on this? Thanks for reporting btw!

hedmo commented 1 year ago

@FedeDP

i have added the patch. ATM i have the sensor at 49%. will report in a day or two...

FedeDP commented 1 year ago

Thank you very much!

hedmo commented 1 year ago

after a day or two . i have to report it still sty at 0% . and does not change ...

FedeDP commented 1 year ago

Can you share clightd output with the patch?

FedeDP commented 1 year ago

Moreover, can you share output of

udevadm info --all /dev/iio:device0

?

hedmo commented 1 year ago

Can you share clightd output with the patch?

are you talking about the output when starting clight?

hedmo commented 1 year ago

Moreover, can you share output of

udevadm info --all /dev/iio:device0

?

hedmo@my300 ~ $ sudo udevadm info /dev/iio:device0 P: /devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0008:00/iio:device0 M: iio:device0 R: 0 U: iio T: iio_device D: c 238:0 N: iio:device0 L: 0 E: DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0008:00/iio:device0 E: DEVNAME=/dev/iio:device0 E: DEVTYPE=iio_device E: MAJOR=238 E: MINOR=0 E: SUBSYSTEM=iio E: USEC_INITIALIZED=6196915 E: IIO_SENSOR_PROXY_TYPE=iio-poll-als iio-poll-als E: SYSTEMD_WANTS=iio-sensor-proxy.service E: TAGS=:systemd: E: CURRENT_TAGS=:systemd:

FedeDP commented 1 year ago

Can you add the "--all" flag to the udevadm command? Thanks!

hedmo commented 1 year ago

i did : hedmo@my300 ~ $ sudo udevadm info --all /dev/iio:device0 info: unrecognized option '--all'

hedmo commented 1 year ago

can this be the on you want ?

hedmo@my300 ~ $ sudo udevadm info -a /dev/iio:device0

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0008:00/iio:device0':
    KERNEL=="iio:device0"
    SUBSYSTEM=="iio"
    DRIVER==""
    ATTR{buffer/data_available}=="0"
    ATTR{buffer/direction}=="in"
    ATTR{buffer/enable}=="0"
    ATTR{buffer/length}=="2"
    ATTR{buffer/watermark}=="1"
    ATTR{buffer0/data_available}=="0"
    ATTR{buffer0/direction}=="in"
    ATTR{buffer0/enable}=="0"
    ATTR{buffer0/in_illuminance_en}=="0"
    ATTR{buffer0/in_illuminance_index}=="0"
    ATTR{buffer0/in_illuminance_type}=="le:s32/32>>0"
    ATTR{buffer0/in_timestamp_en}=="0"
    ATTR{buffer0/in_timestamp_index}=="1"
    ATTR{buffer0/in_timestamp_type}=="le:s64/64>>0"
    ATTR{buffer0/length}=="2"
    ATTR{buffer0/watermark}=="1"
    ATTR{current_timestamp_clock}=="realtime"
    ATTR{in_illuminance_input}=="0"
    ATTR{in_illuminance_raw}=="0"
    ATTR{name}=="acpi-als"

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0008:00/iio:device0':
    KERNEL=="iio:device0"
    SUBSYSTEM=="iio"
    DRIVER==""
    ATTR{buffer/data_available}=="0"
    ATTR{buffer/direction}=="in"
    ATTR{buffer/enable}=="0"
    ATTR{buffer/length}=="2"
    ATTR{buffer/watermark}=="1"
    ATTR{buffer0/data_available}=="0"
    ATTR{buffer0/direction}=="in"
    ATTR{buffer0/enable}=="0"
    ATTR{buffer0/in_illuminance_en}=="0"
    ATTR{buffer0/in_illuminance_index}=="0"
    ATTR{buffer0/in_illuminance_type}=="le:s32/32>>0"
    ATTR{buffer0/in_timestamp_en}=="0"
    ATTR{buffer0/in_timestamp_index}=="1"
    ATTR{buffer0/in_timestamp_type}=="le:s64/64>>0"
    ATTR{buffer0/length}=="2"
    ATTR{buffer0/watermark}=="1"
    ATTR{current_timestamp_clock}=="realtime"
    ATTR{in_illuminance_input}=="0"
    ATTR{in_illuminance_raw}=="0"
    ATTR{name}=="acpi-als"
    ATTR{power/control}=="auto"
    ATTR{power/runtime_active_time}=="0"
    ATTR{power/runtime_status}=="unsupported"
    ATTR{power/runtime_suspended_time}=="0"
    ATTR{scan_elements/in_illuminance_en}=="0"
    ATTR{scan_elements/in_illuminance_index}=="0"
    ATTR{scan_elements/in_illuminance_type}=="le:s32/32>>0"
    ATTR{scan_elements/in_timestamp_en}=="0"
    ATTR{scan_elements/in_timestamp_index}=="1"
    ATTR{scan_elements/in_timestamp_type}=="le:s64/64>>0"
    ATTR{trigger/current_trigger}=="acpi-als-dev0"

  looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0008:00':
    KERNELS=="ACPI0008:00"
    SUBSYSTEMS=="acpi"
    DRIVERS=="acpi_als"
    ATTRS{hid}=="ACPI0008"
    ATTRS{path}=="\_SB_.ALS_"
    ATTRS{power/control}=="auto"
    ATTRS{power/runtime_active_time}=="0"
    ATTRS{power/runtime_status}=="unsupported"
    ATTRS{power/runtime_suspended_time}=="0"
    ATTRS{status}=="11"

  looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00':
    KERNELS=="LNXSYBUS:00"
    SUBSYSTEMS=="acpi"
    DRIVERS==""
    ATTRS{hid}=="LNXSYBUS"
    ATTRS{path}=="\_SB_"
    ATTRS{power/control}=="auto"
    ATTRS{power/runtime_active_time}=="0"
    ATTRS{power/runtime_status}=="unsupported"
    ATTRS{power/runtime_suspended_time}=="0"

  looking at parent device '/devices/LNXSYSTM:00':
    KERNELS=="LNXSYSTM:00"
    SUBSYSTEMS=="acpi"
    DRIVERS==""
    ATTRS{hid}=="LNXSYSTM"
    ATTRS{path}=="\"
    ATTRS{power/control}=="auto"
    ATTRS{power/runtime_active_time}=="0"
    ATTRS{power/runtime_status}=="unsupported"
    ATTRS{power/runtime_suspended_time}=="0"
FedeDP commented 1 year ago

can this be the on you want ?

Exactly, thanks!

ATTR{in_illuminance_input}=="0" ATTR{in_illuminance_raw}=="0"

These ones are the 2 udev ATTRibutes that Clightd uses; they are both 0 :/ That's why it reads 0.

Fact is, i don't see any attribute with a possible value. I will check out iio-sensor-proxy source code to understand what they use ;)

FedeDP commented 1 year ago

Well, it seems like iio-sensor-proxy actually uses similar logic as Clightd:

I don't get how it is working while Clightd is not. Perhaps updates are not exposed through udev? I will further investigate!

FedeDP commented 1 year ago

Oh it seems like iio-sensor-proxy gives higher priority to iio-buffer-als devices than iio-poll-devices. Given that your als device exposes both, it surely uses iio-buffer-als and that is not supported by Clightd! I will work on it asap :) but i will surely need your feedback on the PR! Will ping you once I've got something that should work! Thank you!

EDIT: nope I am wrong your als devices only supports iio-poll-als :/

hedmo commented 1 year ago

more info .now when it is day here i do have a working clight with als. i will continue to check on it under the day and reboot some times to confirm it does work ..

FedeDP commented 1 year ago

Ehy everyone, in https://github.com/FedeDP/Clightd/pull/102 i implemented support for iio buffer ALS sensor read. Can you test it? I unfortunately haven't got any ALS device :/

guillaumeboehm commented 1 year ago

Hey, I'm testing the build from #102 and it doesn't seem to fix it... I'm not exactly sure what's the best way to test it, but rn I'm simply trying to block the sensor physically and see if with the ambiant gamma activated it changes something but it doesn't seem so. I can produce some dumps if you point me the direction.

FedeDP commented 1 year ago

Hi! Thank you very much for testing! Yes, can you share clightd log and output of Sensor.Capture dbus method call?

guillaumeboehm commented 1 year ago

Okay so busctl call org.clightd.clightd /org/clightd/clightd/Sensor/Als org.clightd.clightd.Sensor IsAvailable "s" "" returned sb "/dev/iio:device2" true.

Here is what clightd logs after starting

Registered 'Sysfs' bl plugin.
Registered 'Als' sensor plugin.
Registered 'Camera' sensor plugin.
Registered 'Custom' sensor plugin.
Registered 'Drm' gamma plugin.
Registered 'Wl' gamma plugin.
Registered 'Xorg' gamma plugin.
Registered 'Drm' dpms plugin.
Registered 'KWin_wl' dpms plugin.
Registered 'Wl' dpms plugin.
Registered 'Xorg' dpms plugin.
Registered 'Fb' screen plugin.
Registered 'Wl' screen plugin.
Registered 'Xorg' screen plugin.
[default]|GAMMA|: Current gamma value: 3728.
[default]|IDLE|: Creating client 0
[default]|IDLE|: Creating client 1
[default]|IDLE|: Adding inotify watch as first client was started.
[default]|IDLE|: Starting Client 1
[default]|GAMMA|: Current gamma value: 3728.
[default]|IDLE|: Creating client 2
[default]|IDLE|: Creating client 3
[default]|IDLE|: Starting Client 3
[default]|BACKLIGHT2|: Target pct: 0.15
[default]|GAMMA|: Temperature target value set: 3954.
[default]|GAMMA|: Reached target temp: 3954.
[default]|BACKLIGHT2|: amdgpu_bl1 reached target backlight: 0.15.
[default]|BACKLIGHT2|: Target pct: 0.16
[default]|BACKLIGHT2|: amdgpu_bl1 reached target backlight: 0.16.
[default]|GAMMA|: Temperature target value set: 3982.
[default]|GAMMA|: Reached target temp: 3982.

And how can I get the output of the sensor ?

I also saw you used the output of udevadm so here it is:

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/0020:1022:0001.000E/HID-SENSOR-200041.5.auto/iio:device2':
    KERNEL=="iio:device2"
    SUBSYSTEM=="iio"
    DRIVER==""
    ATTR{buffer/data_available}=="0"
    ATTR{buffer/direction}=="in"
    ATTR{buffer/enable}=="0"
    ATTR{buffer/length}=="4"
    ATTR{buffer/watermark}=="1"
    ATTR{buffer0/data_available}=="0"
    ATTR{buffer0/direction}=="in"
    ATTR{buffer0/enable}=="0"
    ATTR{buffer0/in_illuminance_en}=="0"
    ATTR{buffer0/in_illuminance_index}=="1"
    ATTR{buffer0/in_illuminance_type}=="le:s32/32>>0"
    ATTR{buffer0/in_intensity_both_en}=="0"
    ATTR{buffer0/in_intensity_both_index}=="0"
    ATTR{buffer0/in_intensity_both_type}=="le:s32/32>>0"
    ATTR{buffer0/in_timestamp_en}=="0"
    ATTR{buffer0/in_timestamp_index}=="2"
    ATTR{buffer0/in_timestamp_type}=="le:s64/64>>0"
    ATTR{buffer0/length}=="4"
    ATTR{buffer0/watermark}=="1"
    ATTR{current_timestamp_clock}=="realtime"
    ATTR{in_illuminance_hysteresis_relative}=="0.000000"
    ATTR{in_illuminance_offset}=="0"
    ATTR{in_illuminance_raw}=="5244241"
    ATTR{in_illuminance_sampling_frequency}=="0.000000"
    ATTR{in_illuminance_scale}=="0.100000000"
    ATTR{in_intensity_both_raw}=="5244241"
    ATTR{in_intensity_hysteresis_relative}=="0.000000"
    ATTR{in_intensity_offset}=="0"
    ATTR{in_intensity_sampling_frequency}=="0.000000"
    ATTR{in_intensity_scale}=="0.100000000"
    ATTR{name}=="als"
    ATTR{power/control}=="auto"
    ATTR{power/runtime_active_time}=="0"
    ATTR{power/runtime_status}=="unsupported"
    ATTR{power/runtime_suspended_time}=="0"
    ATTR{scan_elements/in_illuminance_en}=="0"
    ATTR{scan_elements/in_illuminance_index}=="1"
    ATTR{scan_elements/in_illuminance_type}=="le:s32/32>>0"
    ATTR{scan_elements/in_intensity_both_en}=="0"
    ATTR{scan_elements/in_intensity_both_index}=="0"
    ATTR{scan_elements/in_intensity_both_type}=="le:s32/32>>0"
    ATTR{scan_elements/in_timestamp_en}=="0"
    ATTR{scan_elements/in_timestamp_index}=="2"
    ATTR{scan_elements/in_timestamp_type}=="le:s64/64>>0"
    ATTR{trigger/current_trigger}=="als-dev2"

  looking at parent device '/devices/0020:1022:0001.000E/HID-SENSOR-200041.5.auto':
    KERNELS=="HID-SENSOR-200041.5.auto"
    SUBSYSTEMS=="platform"
    DRIVERS=="hid_sensor_als"
    ATTRS{driver_override}=="(null)"
    ATTRS{power/autosuspend_delay_ms}=="3000"
    ATTRS{power/control}=="auto"
    ATTRS{power/runtime_active_time}=="3161354"
    ATTRS{power/runtime_status}=="active"
    ATTRS{power/runtime_suspended_time}=="168086918"

  looking at parent device '/devices/0020:1022:0001.000E':
    KERNELS=="0020:1022:0001.000E"
    SUBSYSTEMS=="hid"
    DRIVERS=="hid-sensor-hub"
    ATTRS{power/control}=="auto"
    ATTRS{power/runtime_active_time}=="0"
    ATTRS{power/runtime_status}=="unsupported"
    ATTRS{power/runtime_suspended_time}=="0"
FedeDP commented 1 year ago

What about:

busctl call org.clightd.clightd /org/clightd/clightd/Sensor/Als org.clightd.clightd.Sensor Capture "sis" "" 5 ""

?

guillaumeboehm commented 1 year ago

busctl call org.clightd.clightd /org/clightd/clightd/Sensor/Als org.clightd.clightd.Sensor Capture "sis" "" 5 ""

it returns this sad "/dev/iio:device2" 5 0 0 0 0 0

FedeDP commented 1 year ago

Ok! I will add some debug prints to the PR so that we can better understand what's going on :) I will ping you back once I pushed the changes! Thank you very much btw, we will fix this, i promise you!

guillaumeboehm commented 1 year ago

I should thank you for being so proactive about it !

FedeDP commented 1 year ago

Hey i just pushed a commit whichadds debug prints! eae2ad917a108c98439a4348553f21efb5841c0b

guillaumeboehm commented 1 year ago

Here you go, I rebooted so the device name changed

Registered 'Sysfs' bl plugin.
Registered 'Als' sensor plugin.
Registered 'Camera' sensor plugin.
Registered 'Custom' sensor plugin.
Registered 'Drm' gamma plugin.
Registered 'Wl' gamma plugin.
Registered 'Xorg' gamma plugin.
Registered 'Drm' dpms plugin.
Registered 'KWin_wl' dpms plugin.
Registered 'Wl' dpms plugin.
Registered 'Xorg' dpms plugin.
Registered 'Fb' screen plugin.
Registered 'Wl' screen plugin.
Registered 'Xorg' screen plugin.
[default]|GAMMA|: Current gamma value: 3942.
[default]|IDLE|: Creating client 0
[default]|IDLE|: Creating client 1
[default]|IDLE|: Adding inotify watch as first client was started.
[default]|IDLE|: Starting Client 1
Buffer available, using 'scan_elements/in_illuminance_en' sysattr
Poll available, using 'in_illuminance_raw' sysattr
Buffer available, using 'scan_elements/in_illuminance_en' sysattr
Poll available, using 'in_illuminance_raw' sysattr
[IIO-BUF] Start capture: 'iio:device4' sysname.
[IIO-BUF] Found device.
[IIO-BUF] Channel name: 'illuminance'.
[IIO-BUF] Creating buffer.
WARNING: High-speed mode not enabled
[IIO-BUF] Data fmt: bits: 32 | signed: 1 | len: 32 | rep: 1 | scale: 0.100000 | has_scale: 1 | shift: 0.
[IIO-BUF] Refill ret: 4/4
[IIO-BUF] Read 0
[IIO-BUF] Pct[0] = 0.000000
[IIO-BUF] Refill ret: 4/4
[IIO-BUF] Read 0
[IIO-BUF] Pct[1] = 0.000000
[IIO-BUF] Refill ret: 4/4
[IIO-BUF] Read 0
[IIO-BUF] Pct[2] = 0.000000
[IIO-BUF] Refill ret: 4/4
[IIO-BUF] Read 0
[IIO-BUF] Pct[3] = 0.000000
[IIO-BUF] Refill ret: 4/4
[IIO-BUF] Read 0
[IIO-BUF] Pct[4] = 0.000000
[default]|BACKLIGHT2|: Target pct: 0.15
[default]|BACKLIGHT2|: amdgpu_bl1 reached target backlight: 0.15.
[default]|GAMMA|: Temperature target value set: 3935.
[default]|GAMMA|: Reached target temp: 3935.
[default]|GAMMA|: Current gamma value: 3942.
[default]|IDLE|: Creating client 2
[default]|IDLE|: Creating client 3
[default]|IDLE|: Starting Client 3
Buffer available, using 'scan_elements/in_illuminance_en' sysattr
Poll available, using 'in_illuminance_raw' sysattr
Buffer available, using 'scan_elements/in_illuminance_en' sysattr
Poll available, using 'in_illuminance_raw' sysattr
[IIO-BUF] Start capture: 'iio:device4' sysname.
[IIO-BUF] Found device.
[IIO-BUF] Channel name: 'illuminance'.
[IIO-BUF] Creating buffer.
WARNING: High-speed mode not enabled
[IIO-BUF] Data fmt: bits: 32 | signed: 1 | len: 32 | rep: 1 | scale: 0.100000 | has_scale: 1 | shift: 0.
[IIO-BUF] Refill ret: 4/4
[IIO-BUF] Read 0
[IIO-BUF] Pct[0] = 0.000000
[IIO-BUF] Refill ret: 4/4
[IIO-BUF] Read 0
[IIO-BUF] Pct[1] = 0.000000
[IIO-BUF] Refill ret: 4/4
[IIO-BUF] Read 0
[IIO-BUF] Pct[2] = 0.000000
[IIO-BUF] Refill ret: 4/4
[IIO-BUF] Read 0
[IIO-BUF] Pct[3] = 0.000000
[IIO-BUF] Refill ret: 4/4
[IIO-BUF] Read 0
[IIO-BUF] Pct[4] = 0.000000
[default]|BACKLIGHT2|: Target pct: 0.15
[default]|GAMMA|: Temperature target value set: 3935.
[default]|GAMMA|: Reached target temp: 3935.
[default]|BACKLIGHT2|: amdgpu_bl1 reached target backlight: 0.15.

Hopefully my sensor is actually working correctly, I'll look for a way to confirm that it's working correctly.

FedeDP commented 1 year ago

[IIO-BUF] Refill ret: 4/4 [IIO-BUF] Read 0 [IIO-BUF] Pct[0] = 0.000000

It seems like we are correctly reading data, but data is always 0 :/ Can you share ls /sys/bus/iio/devices/*/ output? It seems like your kernel is generating multiple iio:device nodes, and i'd like to know if you really got multiple iio sensors :)

Thank you!

I'll look for a way to confirm that it's working correctly.

Best way IMHO is to use https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/ that is Gnome/freedesktop implementation of a dbus API around iio devices. It should be already packaged in your distro repos (at least it is, on arch!). Note however that Clightd with the patch should exactly match its behavior!

guillaumeboehm commented 1 year ago

Here's my devices

/sys/bus/iio/devices/iio:device0/:
 buffer    dev                  in_magn_offset               in_magn_scale   in_magn_y_raw   name    scan_elements   trigger
 buffer0   in_magn_hysteresis   in_magn_sampling_frequency   in_magn_x_raw   in_magn_z_raw   power   subsystem       uevent

/sys/bus/iio/devices/iio:device1/:
 buffer    current_timestamp_clock   in_accel_hysteresis   in_accel_sampling_frequency   in_accel_x_raw   in_accel_z_raw   power           subsystem   uevent
 buffer0   dev                       in_accel_offset       in_accel_scale                in_accel_y_raw   name             scan_elements   trigger    

/sys/bus/iio/devices/iio:device2/:
 buffer    current_timestamp_clock   in_anglvel_hysteresis   in_anglvel_sampling_frequency   in_anglvel_x_raw   in_anglvel_z_raw   power           subsystem   uevent
 buffer0   dev                       in_anglvel_offset       in_anglvel_scale                in_anglvel_y_raw   name               scan_elements   trigger    

/sys/bus/iio/devices/iio:device3/:
 buffer    dev                       in_proximity_offset   in_proximity_sampling_frequency   name    scan_elements   trigger
 buffer0   in_proximity_hysteresis   in_proximity_raw      in_proximity_scale                power   subsystem       uevent

/sys/bus/iio/devices/iio:device4/:
 buffer                    in_illuminance_hysteresis            in_illuminance_sampling_frequency   in_intensity_hysteresis_relative   name            trigger
 buffer0                   in_illuminance_hysteresis_relative   in_illuminance_scale                in_intensity_offset                power           uevent
 current_timestamp_clock   in_illuminance_offset                in_intensity_both_raw               in_intensity_sampling_frequency    scan_elements  
 dev                       in_illuminance_raw                   in_intensity_hysteresis             in_intensity_scale                 subsystem      

/sys/bus/iio/devices/trigger0/:
 name   power   subsystem   uevent

/sys/bus/iio/devices/trigger1/:
 name   power   subsystem   uevent

/sys/bus/iio/devices/trigger2/:
 name   power   subsystem   uevent

/sys/bus/iio/devices/trigger3/:
 name   power   subsystem   uevent

/sys/bus/iio/devices/trigger4/:
 name   power   subsystem   uevent

I tested stuff a bit with udevadm, and it's weird my illuminance, if I'm looking in the right place, seems to never change... ATTR{in_illuminance_raw}=="5244241" sometimes it's 0 and jumps back to that value. Maybe I actually have a problem with my sensor ?

FedeDP commented 1 year ago

Thanks for the output! So you got multiple sensors, nice! Well, if your sensor only sees 0 or a weird value, perhaps it has some issues? I am not sure though...again, if iio-sensor-proxy does output the same as clightd, then chances are that the sensor is broken/its support is broken...https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/