Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My laptop has a different file for the illuminance sensor (/sys/bus/iio/devices/iio\:device1/in_illuminance_input) #13

Open
ChocolateLoverRaj opened this issue Mar 6, 2024 · 10 comments

Comments

@ChocolateLoverRaj
Copy link

The section "How to test befor install"

Run from a terminal sudo watch cat /sys/bus/acpi/devices/ACPI0008:00/iio:device0/in_illuminance_raw and check that number is changing (try close the sensor or add more light). If the number is still the same it means the sensor driver doesn't work. If you see file not found error try to find correct path for in_illuminance_raw inside /sys/bus/acpi/devices/.
For ZBook 15 G6, and may be others, sensor path is /sys/bus/iio/devices/iio:device0/in_illuminance_raw. So try sudo watch cat /sys/bus/iio/devices/iio:device0/in_illuminance_raw and change the config if it works for you.

doesn't work for my laptop (HP Elite Dragonfly Chromebook, code name redrix), even though it does have an ambient light sensor which I can read with cat /sys/bus/iio/devices/iio\:device1/in_illuminance_input

Should the README be updated?

@mikhail-m1
Copy link
Owner

thanks for update, I will change the README. My last laptop with illuminance sensor is 10 years old now, and I don't have access to anything modern. What range of values do you see in this file?

@ChocolateLoverRaj
Copy link
Author

Btw, after rebooting it's no longer device1, it's now device2. So I think /sys/bus/iio/devices/iio\:device*/in_illuminance_input should be checked.

Here are some tests

Condition Value
Dark room 0
Room with some light from window 21
Well-lit room 55
Right next to a lightbulb 4000+

I can add a value for being outside when the brightness usually needs to be set to max.

@mikhail-m1
Copy link
Owner

I checked my laptop and I have the light sensor device in iio bus too, are you sure what you don't have it in acpi bus directory? I think acpi bus names are more stable than iio.

But if you have the sensor only in iio bus it will mean that I need to search for the illuminance sensor on the start. Can you also check which driver is used for it?

@ChocolateLoverRaj
Copy link
Author

I don't think the light sensor is in the acpi bus.

cat: '/sys/bus/acpi/**/*illuminance*': No such file or directory

I'm not sure about which driver is used by it. It might be the cros_ec_light_prox kernel module. How do I check?

@mikhail-m1
Copy link
Owner

mikhail-m1 commented Mar 14, 2024

can you run ls -lR /sys > sys_content.txt and attach sys_content.txt file?

@ChocolateLoverRaj
Copy link
Author

sys_content.txt

@mikhail-m1
Copy link
Owner

I looked at the file and only one alternative path is through /sys/dev/char/511:2 but I am pretty sure it's not stable either. So if you really want to use it and ready to test, I can add file mask support for device filename.

@ChocolateLoverRaj
Copy link
Author

Yes, I would like to try illuminanced on my Chromebook.

@mikhail-m1
Copy link
Owner

I finally have found time to make and test the change, also created a branch for you with your path to the illuminance file.

@ChocolateLoverRaj
Copy link
Author

I'm using NixOS so I can't test it rn. Sometime I'll test it on a normal Linux distro or create a Nix package for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants