joan2937 / lg

Linux C libraries and Python modules for manipulating GPIO
The Unlicense
57 stars 20 forks source link

Control green ACT LED on Raspberry #7

Closed franzboard closed 2 years ago

franzboard commented 3 years ago

Green onboard ACT LED on Raspberry Pi 4 (gpiochip 0 / 42) cannot be controlled from lg. At the moment, this is only possible from /sys/class/leds/led0/brightness or from the deprecated wiringPi library. Will there be an update to make this possible also with lg?

joan2937 commented 3 years ago

I am afraid not. One of the main drivers for lg is to use the new /dev/gpiochip interface so that GPIO are accessed in a properly controlled manner.

gpiochip 0/42 is already in use by the kernel

The following rgs command needs the rgpio daemon to be running.

rgs c 1 go 0
rgs c 1 gil 0 42
42 3 "STATUS_LED_G_CLK" "led0"

3 means the line is in use by the kernel as an output.

There is no mechanism to take over or use an already assigned GPIO in the /dev/gpiochip system.

You will have to use an alternative. By the way pigpio will let you set the LED.