Page 1 of 1

Disable All Leds

Posted: Wed Jul 18, 2018 5:07 pm
by belette
Is there a way to disable all the Leds ? (LED 1, LED2 and Power Led on the left)?

I tried some combination from http://fit-pc.com/wiki/index.php/Contro ... 1_and_LED2 but no one is working and I don't have "value"

Code: Select all

 ls /sys/class/gpio/*
/sys/class/gpio/export  /sys/class/gpio/unexport

/sys/class/gpio/gpiochip267:
power  base  device  label  ngpio  subsystem  uevent

/sys/class/gpio/gpiochip310:
power  base  device  label  ngpio  subsystem  uevent

/sys/class/gpio/gpiochip357:
power  base  device  label  ngpio  subsystem  uevent

/sys/class/gpio/gpiochip434:
power  base  device  label  ngpio  subsystem  uevent

Re: Disable All Leds

Posted: Tue Jul 24, 2018 12:20 pm
by tamir
According to the manual, when you echo 0 to the desired gpio, the LED should be off as per the below:

$ echo 0 > /sys/class/gpio/gpio435/value
# LED1 should be OFF now

Make sure you'r logged in as root prior to running the commands.

It is advised to read and follow the manual step by step:
http://fit-pc.com/wiki/index.php/Contro ... 1_and_LED2

Re: Disable All Leds

Posted: Thu Jan 31, 2019 3:51 pm
by belette
Thanks Tamir.

I realized that I was not monitoring this thread so I just see your reply after a couple of months back!

The problem is that I don't have gpio435 in the system.
Here is the directory listing on my fitlet2:

Code: Select all

fitlet in /sys/class/gpio # l
total 0
--w------- 1 root root 4.0K Jan 31 16:49 export
lrwxrwxrwx 1 root root    0 Nov  5 20:23 gpiochip267 -> ../../devices/platform/INT3452:03/gpio/gpiochip267
lrwxrwxrwx 1 root root    0 Nov  5 20:23 gpiochip310 -> ../../devices/platform/INT3452:02/gpio/gpiochip310
lrwxrwxrwx 1 root root    0 Nov  5 20:23 gpiochip357 -> ../../devices/platform/INT3452:01/gpio/gpiochip357
lrwxrwxrwx 1 root root    0 Nov  5 20:23 gpiochip434 -> ../../devices/platform/INT3452:00/gpio/gpiochip434
--w------- 1 root root 4.0K Jan 31 16:49 unexport
So I can't use

Code: Select all

echo 0 > /sys/class/gpio/gpio435/value
Any idea?

Re: Disable All Leds

Posted: Fri Feb 01, 2019 5:01 pm
by Mikael63
Just as a note.
Here is how I turn both LED to off (from green-state) when I shutdown:
I got a starter calling this script:

Code: Select all

#! /bin/bash
echo 'mint' | sudo -kS /home/mint/Skriptfiler/1greenoff.sh
echo 'mint' | sudo -kS /home/mint/Skriptfiler/2greenoff.sh
echo 'mint' | sudo -kS poweroff
As you can see I provided my password so the "sub-scripts" below is running as root.
(I use the password mint just as an example here)

1greenoff.sh contains:

Code: Select all

#! /bin/bash
echo 435 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio435/direction
echo 0 > /sys/class/gpio/gpio435/value
# LED1 should be OFF now
echo 435 > /sys/class/gpio/unexport
and 2greenoff.sh contains:

Code: Select all

#! /bin/bash
echo 437 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio437/direction
echo 0 > /sys/class/gpio/gpio437/value
# LED2 should be OFF now
echo 437 > /sys/class/gpio/unexport
As an extra note - I also disconnects my USB-drive by calling (from "main-script" above) an another script.

Re: Disable All Leds

Posted: Sun Feb 03, 2019 9:27 pm
by belette
thanks Mikael63!

I tried but there is no effect on my side, perhaps because your script is for the led to be off when you turn of your fitlet?

What I am trying to do is to turn off the green led on the power button when the fitlet IS running...so I don't know if it is doable?

Re: Disable All Leds

Posted: Mon Feb 04, 2019 6:28 am
by Mikael63
on the power button
1. Is there an GPIO # for it?

2. Why?

Re: Disable All Leds

Posted: Mon Feb 04, 2019 7:47 am
by belette
1. good question, I don't know how to check this
2. in my room, fitlet always on and I would like to keep it black when I sleep :D

Re: Disable All Leds

Posted: Mon Feb 04, 2019 8:34 am
by Mikael63
1. I don't think there is any.
http://fit-pc.com/wiki/index.php?title= ... s_on_Linux

2. What about a piece of black tape? :roll:

Re: Disable All Leds

Posted: Mon Feb 04, 2019 11:36 am
by belette
1. I saw this one yes, I thought that the led on the power button can also being controlled

2. yes :) I was just trying to find a more elegant way to do it :)