Disable All Leds

Moderator: Andrey.Mazlin

Post Reply
belette
Posts: 19
Joined: Thu Nov 13, 2014 9:29 am

Disable All Leds

Post 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

tamir
Site Admin
Posts: 419
Joined: Mon Dec 25, 2017 4:21 pm

Re: Disable All Leds

Post 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

belette
Posts: 19
Joined: Thu Nov 13, 2014 9:29 am

Re: Disable All Leds

Post 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?

Mikael63
Posts: 74
Joined: Sun Aug 19, 2018 9:53 am

Re: Disable All Leds

Post 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.
Linux Mint Vera 21.1 Cinnamon @ MBM2 Pro

belette
Posts: 19
Joined: Thu Nov 13, 2014 9:29 am

Re: Disable All Leds

Post 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?

Mikael63
Posts: 74
Joined: Sun Aug 19, 2018 9:53 am

Re: Disable All Leds

Post by Mikael63 »

on the power button
1. Is there an GPIO # for it?

2. Why?
Linux Mint Vera 21.1 Cinnamon @ MBM2 Pro

belette
Posts: 19
Joined: Thu Nov 13, 2014 9:29 am

Re: Disable All Leds

Post 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

Mikael63
Posts: 74
Joined: Sun Aug 19, 2018 9:53 am

Re: Disable All Leds

Post 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:
Linux Mint Vera 21.1 Cinnamon @ MBM2 Pro

belette
Posts: 19
Joined: Thu Nov 13, 2014 9:29 am

Re: Disable All Leds

Post 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 :)

Post Reply

Return to “General fitlet2 questions”