0

On my 8.1 oreo android tablet, I have a front RGB led. I'm trying to change the color of it by using ADB commands, however I can't find the led in the system. I searched for everywhere (under sys/class, sys/devices, virtual, platform, software directories but nothing)

There is a suggested method described below as all leds info are stored under '/sys/class/leds/' directory, but this folder is totally empty in my case. Control Android LED from shell

I contacted the manufacturer, but they refused to answer as don't want to disclose internal system structures to anybody.

I'm asking for your experience. Is there any command I can use to find and control it with ADB?

Mixaz
  • 4,068
  • 1
  • 29
  • 55
Giorgio
  • 121
  • 8

1 Answers1

1

Handling LEDs via /sys/class/leds folder is a part of Linux sysfs. Most likely the phone vendor (you didn't provide this info, but it matters in this case) didn't register phone's LEDs with sysfs, see LED registration API.

I have tested on my Xiaomi Redmi Note 8 (Android 10, MIUI 12.0, Linux kernel 4.14) and it does have /sys/class/leds, I even was able to turn on/off flashlight there. But - it needed root access which I got after jailbreaking my phone, and it means that you can't deal with LEDs in stock firmware.

You probably can get that LEDs sysfs functionality on your phone installing a custom Android firmware such as LineageOS, but it's not guaranteed, and with that firmware you may get other problems related to its stability and functionality on your phone.

So you can hardly rely on this solution in general case, may be in some cases only, and probably with rooting the phone.

Mixaz
  • 4,068
  • 1
  • 29
  • 55
  • thanks for the info. My device is a Zipatile2 tablet and it is originally rooted, so I have root access – Giorgio Nov 22 '22 at 23:02
  • Erhm, then you probably can save a lot of money if buy a tablet with working /sys/class/leds, instead of spending efforts to "fix" it in your device. Xiaomi Pad has good chances for it, and Xiaomi OEM unlock and rooting are well-known procedures. – Mixaz Nov 22 '22 at 23:37
  • I see your point and appreciate your feedback but unfortunately it’s not an option that saves me any money. Long story short, I stick to this tablet for now and if i understand well, the possible solution has nothing to do with ADB, rather changing system settings – Giorgio Nov 23 '22 at 09:48
  • "Settings" is not a right word - it can't be changed in Android settings. And most likely in Linux settings. I meant that researching it deeper, with high probability of negative result (that it's not possible to enable /sys/class/leds in your firmware) may take too much efforts. It's area of responsibility of firmware developer (device vendor) to enable that. I do not see other solutions. – Mixaz Nov 23 '22 at 13:14