No GPIO LED with Linux Mint 21.1 [SOLVED]

Moderator: Andrey.Mazlin

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

No GPIO LED with Linux Mint 21.1 [SOLVED]

Post by Mikael63 »

Haven't been using any script for controlling LED in front for a l o o n g time now.
Now when trying as described here http://fit-pc.com/wiki/index.php?title= ... front_LEDs
(or by my script with same contents) I only got errors, unvalid arguments and so on?

Where to start troubleshooting?
Linux Mint Vera 21.1 Cinnamon @ MBM2 Pro

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

Re: No GPIO LED with Linux Mint 21.1

Post by Mikael63 »

Seems to be older kernel than 4.8 to get this to work..

If using gpioinfo - I get a lot of lines. What lines is the LED in front?
Linux Mint Vera 21.1 Cinnamon @ MBM2 Pro

malbers15
Posts: 2
Joined: Thu May 25, 2023 5:48 am

Re: No GPIO LED with Linux Mint 21.1

Post by malbers15 »

I encountered this problem when I upgraded from kernel 5.4 in Ubuntu 20.04 to Linux Kernel 5.15 in Ubuntu 22.04. The answer was to offset the previous values by +512. I obtained this number by diffing the values in the superuser post. Following is the contents of a shell script that will turn all the front LEDs on the fitlet2 off:

Code: Select all

#!/bin/bash
# Make sure the LEDs on the front of the fitlet2 are off after booting up
# Reference:
# http://www.fit-pc.com/wiki/index.php?title=Application_note_-_fitlet2_controlling_front_LEDs
# Note that after upgrade to Linux Kernel 5.15 in Ubuntu 22.04 from kernel 5.4 in Ubuntu 20.04
# all previously known values must be offset by 512 (obtained by diffing the gpio chip values)
# https://superuser.com/questions/1736349/gpio-numbering-changed-after-upgrade-to-ubuntu-22-04
echo 947 > /sys/class/gpio/export
echo 948 > /sys/class/gpio/export
echo 949 > /sys/class/gpio/export
echo 950 > /sys/class/gpio/export
# default state for "out" is off/low
echo out > /sys/class/gpio/gpio947/direction
echo out > /sys/class/gpio/gpio948/direction
echo out > /sys/class/gpio/gpio949/direction
echo out > /sys/class/gpio/gpio950/direction
echo 947 > /sys/class/gpio/unexport
echo 948 > /sys/class/gpio/unexport
echo 949 > /sys/class/gpio/unexport
echo 950 > /sys/class/gpio/unexport

This Enum from my python scripts might help to:

Code: Select all

    class GPIO(Enum):
        led_1_green = "947"
        led_1_orange = "948"
        led_2_green = "949"
        led_2_orange = "950"

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

Re: No GPIO LED with Linux Mint 21.1

Post by Mikael63 »

THANKS!!!

Work just fine to add 512 in my scripts!

:D :D
Linux Mint Vera 21.1 Cinnamon @ MBM2 Pro

malbers15
Posts: 2
Joined: Thu May 25, 2023 5:48 am

Re: No GPIO LED with Linux Mint 21.1

Post by malbers15 »

Great news! Can you put [SOLVED] in the title?

Mikael_63
Posts: 1
Joined: Wed Jul 26, 2023 6:03 am

Re: No GPIO LED with Linux Mint 21.1

Post by Mikael_63 »

malbers15 wrote:
Fri Jul 14, 2023 12:26 am
Great news! Can you put [SOLVED] in the title?
No! My former user name Mikael63 does not work anymore.

Andrey.Mazlin
Posts: 97
Joined: Tue May 05, 2020 7:02 am

Re: No GPIO LED with Linux Mint 21.1

Post by Andrey.Mazlin »

malbers15 wrote:
Fri Jul 14, 2023 12:26 am
Great news! Can you put [SOLVED] in the title?
Did this on behalf of Mikael
Andrey Mazlin, Application Support Engineer
Useful links:
https://fit-iot.com/web/
Support Wiki: http://www.fit-pc.com/wiki/
Support mail: fitpcsupport@compulab.co.il

Post Reply

Return to “General fitlet2 questions”