Setting LED light and CPU governor via shell commands

Hello,

I’m trying to toggle the LED light and change the CPU governor via shell commands.
The only thing I found is this here: https://github.com/osmc/osmc/blob/27cd4affa976512a217603cefcf3ab36cc8f50fc/package/mediacenter-osmc/patches/vero3-120-add-standby-support.patch#L58 and following lines.

So I tried writing 255 to /sys/class/leds/led-sys/brightness to turn the LED on and 0 to turn it off.
This works, but as far as I understand C++, that line is writing 0 or 1, not 255, so I wanted to make sure that it is correct and I won’t break anything.

Same thing for the governor, I could write ondemand or powersave to /sys/devices/system/cpu/cpuX/cpufreq/scaling_governor(where X is 0 to 3), but I’m wondering if that would be the right way to do it or I’m missing something.

Thanks.

EDIT: nevermind, the LED actually works as expected: 1 for off, 0 for on!

Hi,

Why are you trying to change the CPU governor?

Sam

I decided to stop the mediacenter service when I’m not using it, so I’d also like to set the governor to powersave and set it back to ondemand when I start the service again.
What I wrote in the OP works, could there be issues with that?

Use 0/1 to control the LED.
They’re inverted in DT so that the red light is off by default.

Got it, everything works!
Thank you