View unanswered posts | View active topics It is currently Thu Aug 22, 2019 1:14 am



Reply to topic  [ 9 posts ] 
 Disable All Leds 
Author Message

Joined: Thu Nov 13, 2014 9:29 am
Posts: 18
Post Disable All Leds
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:
 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


Wed Jul 18, 2018 5:07 pm
Profile
Site Admin

Joined: Mon Dec 25, 2017 4:21 pm
Posts: 316
Post Re: Disable All Leds
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


Tue Jul 24, 2018 12:20 pm
Profile

Joined: Thu Nov 13, 2014 9:29 am
Posts: 18
Post Re: Disable All Leds
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:
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:
echo 0 > /sys/class/gpio/gpio435/value


Any idea?


Thu Jan 31, 2019 3:51 pm
Profile

Joined: Sun Aug 19, 2018 9:53 am
Posts: 41
Location: North of Sweden
Post Re: Disable All Leds
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:
#! /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:
#! /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:
#! /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.


Fri Feb 01, 2019 5:01 pm
Profile

Joined: Thu Nov 13, 2014 9:29 am
Posts: 18
Post Re: Disable All Leds
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?


Sun Feb 03, 2019 9:27 pm
Profile

Joined: Sun Aug 19, 2018 9:53 am
Posts: 41
Location: North of Sweden
Post Re: Disable All Leds
Quote:
on the power button


1. Is there an GPIO # for it?

2. Why?


Mon Feb 04, 2019 6:28 am
Profile

Joined: Thu Nov 13, 2014 9:29 am
Posts: 18
Post Re: Disable All Leds
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


Mon Feb 04, 2019 7:47 am
Profile

Joined: Sun Aug 19, 2018 9:53 am
Posts: 41
Location: North of Sweden
Post Re: Disable All Leds
1. I don't think there is any.
http://fit-pc.com/wiki/index.php?title=Application_note_-_fitlet2_controlling_front_LEDs_on_Linux

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


Mon Feb 04, 2019 8:34 am
Profile

Joined: Thu Nov 13, 2014 9:29 am
Posts: 18
Post Re: Disable All Leds
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 :)


Mon Feb 04, 2019 11:36 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 9 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.