GPIO (leds) default values

Moderator: Andrey.Mazlin

Vidar.Hauglien
Posts: 4
Joined: Tue Apr 05, 2022 6:55 am

Re: GPIO (leds) default values

Post by Vidar.Hauglien »

Hi.

I'm seeing the same issue with the leds are on by default, even after bios upgrade. Bios is currently FLT2.0.46.02.01. Am i missing something?
Attachments
bios.png
bios.png (426.27 KiB) Viewed 39533 times

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

Re: GPIO (leds) default values

Post by Mikael63 »

The LEDs are ON (green) by default when OS i started and OFF when OS is shut down.

To switch them to OFF when OS is started - just do this by a script, and run that script when OS starts.
Running Linux?
Linux Mint Vera 21.1 Cinnamon @ MBM2 Pro

Vidar.Hauglien
Posts: 4
Joined: Tue Apr 05, 2022 6:55 am

Re: GPIO (leds) default values

Post by Vidar.Hauglien »

Yes, running linux. I can control them just fine from linux. The issue is that the LED's are green before booting the OS. I want the LED's to be off until i turn them on, eg. when everything is up and running successfully. After reading this thread i got the impression that the latest Bios update disabled LED during boot until manually enabled, but in my case they turn green as soon as i apply power.

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

Re: GPIO (leds) default values

Post by Mikael63 »

Vidar.Hauglien wrote:
Mon Apr 25, 2022 11:15 am
in my case they turn green as soon as i apply power.
Confirmed!
When connecting to power supply - all three LEDs are On/Green.
As soon as OS is started the script switches (two of) them off.
Linux Mint Vera 21.1 Cinnamon @ MBM2 Pro

Vidar.Hauglien
Posts: 4
Joined: Tue Apr 05, 2022 6:55 am

Re: GPIO (leds) default values

Post by Vidar.Hauglien »

Thanks for the reply. That's too bad. Would have made more sense that the leds were OFF default, and turn the leds green when the system is operating successfully, not turning them off when the system is running successfully.

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

Re: GPIO (leds) default values

Post by Mikael63 »

Vidar.Hauglien wrote:
Wed Apr 27, 2022 9:06 am
Thanks for the reply. That's too bad. Would have made more sense that the leds were OFF default, and turn the leds green when the system is operating successfully, not turning them off when the system is running successfully.
Agree!
I switch them to OFF at startup just so they remain OFF when shutting down.
The script is running by auto at startup since I don't know how to run a script by auto when shutting down. (By the regular way) Beside the opposite way - executing a script that set LED to OFF and then shutdown.
Linux Mint Vera 21.1 Cinnamon @ MBM2 Pro

Vidar.Hauglien
Posts: 4
Joined: Tue Apr 05, 2022 6:55 am

Re: GPIO (leds) default values

Post by Vidar.Hauglien »

Mikael63 wrote:
Thu Apr 28, 2022 5:09 pm
Agree!
I switch them to OFF at startup just so they remain OFF when shutting down.
The script is running by auto at startup since I don't know how to run a script by auto when shutting down. (By the regular way) Beside the opposite way - executing a script that set LED to OFF and then shutdown.
If you're using systemd it's pretty easy to turn them off at shutdown using ExecStop. This is how my systemd service looks like:

Code: Select all

[Unit]
Description=Configure Fitlet2 LED
DefaultDependencies=false

[Service]
Type=simple
ExecStart=/bin/bash /usr/local/bin/setled.sh -configure
ExecStartPost=/bin/bash /usr/local/bin/setled.sh -1 off
ExecStartPost=/bin/bash /usr/local/bin/setled.sh -2 off
ExecStop=/bin/bash /usr/local/bin/setled.sh -1 off
ExecStop=/bin/bash /usr/local/bin/setled.sh -2 off
[Install]
WantedBy=sysinit.target

Post Reply

Return to “fitlet2 hardware”