# \[Solved\]Help with GPIO not working!

**URL:** <https://dietpi.com/forum/t/solved-help-with-gpio-not-working/25008>\
**Category:** General Discussion\
**Created:** [28 February 2026 10:46 UTC](https://dietpi.com/forum/t/solved-help-with-gpio-not-working/25008 "2026-02-28T10:46:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wgt1963](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/w/ea666f/32.png) [@Wgt1963](https://dietpi.com/forum/u/Wgt1963)\
**Post date:** [28 February 2026 10:46 UTC](https://dietpi.com/forum/t/solved-help-with-gpio-not-working/25008/1 "2026-02-28T10:46:01Z")

</div>

Good morning, everyone.

I am new to DietPi and I have a problem that I cannot solve.

Furthermore, as I do not know English, I am forced to ask for help here, as there is no forum in Italian, using an online translator!

So please excuse me if something is not understandable!!! :(((

I have an old Raspberry Pi 1B+ that I have set up as a print server.

With Raspbian Bullseye Lite, everything works fine, but it is very slow.

So I wanted to try DietPi, which is actually much faster both at start-up/shutdown and when sending documents to print.

However, I am having problems running the script.py that I created to turn on an LED from the GPIO to see when the system is ready. Furthermore, the command to listen to GPIO 3 and invoke poweroff, which works perfectly in Bullseye, does not work either.

When I try to run the script from /Home/DietPi/, I get this error:

```auto
Traceback (most recent call last):

File ‘/home/dietpi/led.py’, line 1, in <module>

import RPi.GPIO as GPIO

File ‘/usr/lib/python3/dist-packages/RPi/GPIO/ __init__.py’, line 927, in <module>

RPI_INFO = _get_rpi_info()

^^^^^^^^^^^^^^^

File ‘/usr/lib/python3/dist-packages/RPi/GPIO/ __init__.py’, line 428, in _get_rpi_info

raise NotImplementedError(

NotImplementedError: This module does not understand old-style revision codes

```

The script I am using is this:

```auto
import RPi.GPIO as GPIO
import time

#Disabilita i Warnings
GPIO.setwarnings(False)

# Usa la numerazione BCM (GPIO17, GPIO18, ecc.)
GPIO.setmode(GPIO.BCM)
# Imposta il pin 17 come output
GPIO.setup(17, GPIO.OUT)

#time.sleep(0.5)
# Aspetta 0.5 secondi

# Accendi (HIGH = 3.3V)
GPIO.output(17, GPIO.HIGH)
#time.sleep(1)
# Spegni (LOW = 0V)
#GPIO.output(17, GPIO.LOW)
# Pulisci le configurazioni alla fine
#GPIO.cleanup()

```

Of course, I’ve searched the web, but I can’t figure out how to solve it!

Even the command:

```auto
dtoverlay=gpio-shutdown,active_low=1

```

that I entered in:

```auto
/boot/config.txt

```

no longer has any effect!

Can you help me?

Thank you all for your help.

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [28 February 2026 11:10 UTC](https://dietpi.com/forum/t/solved-help-with-gpio-not-working/25008/2 "2026-02-28T11:10:05Z")

</div>

> [@Wgt1963](#):
>
> Furthermore, as I do not know English, I am forced to ask for help here, as there is no forum in Italian, using an online translator!

That’s absolutely fine and no problem at all. I can recommend DeepL here. It actually does a pretty good job.

> **[DeepL AI Platform: Translation, Voice & Agentic Workflows](https://www.deepl.com/en)**
>
> Explore our complete AI suite: Translate speech and text, integrate our API, or automate tasks with the new DeepL Agent.

I’m no expert when it comes to GPIO, but have you checked `dietpi-config`? I think you can activate it there.

You may also need to install RPi.GPIO (ID 69) or similar from `dietpi-software`.

> **[RPi.GPIO - DietPi.com Docs - Hardware Projects Software Options](https://dietpi.com/docs/software/hardware_projects/#rpigpio)**
>
> To install any of the DietPi optimised software items listed below run from the command line: | Description of DietPi software options related to hardware

---

<div class="post-metadata">

**Author:** ![Wgt1963](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/w/ea666f/32.png) [@Wgt1963](https://dietpi.com/forum/u/Wgt1963)\
**Post date:** [28 February 2026 12:26 UTC](https://dietpi.com/forum/t/solved-help-with-gpio-not-working/25008/3 "2026-02-28T12:26:03Z")

</div>

Yes, thank you, I already use Deepl!

In diet-config, ic2 is already enabled, and I can’t remember what else.

So they are enabled.

RPi GPIO installed, it seems that this library does not work starting from Bookworm!

Searching the web, I tried several solutions, but none of them work!

I installed and then modified the script to install gpiozero, and then the errors multiplied because, for example, the LED used to directly manage the output calls RPi.GPIO I don’t know how many times!

If I could find the image of DietPi RP1 ARMv6 Bullseye, I would use that and be fine, but it no longer exists and I don’t know where to find it…

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [28 February 2026 12:40 UTC](https://dietpi.com/forum/t/solved-help-with-gpio-not-working/25008/4 "2026-02-28T12:40:22Z")

</div>

> [@Wgt1963](#):
>
> If I could find the image of DietPi RP1 ARMv6 Bullseye

We dropped support for Bullseye beginning of this year [DietPi v10.0 - DietPi.com Docs](https://dietpi.com/docs/releases/v10_0/#breaking) This includes removing of these images from our server.

Maybe @MichaIng has an idea regarding GPIO.

---

<div class="post-metadata">

**Author:** ![Wgt1963](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/w/ea666f/32.png) [@Wgt1963](https://dietpi.com/forum/u/Wgt1963)\
**Post date:** [28 February 2026 13:36 UTC](https://dietpi.com/forum/t/solved-help-with-gpio-not-working/25008/5 "2026-02-28T13:36:43Z")

</div>

Yes, of course.  
But… I’d like it to work!  
I’m not interested in updates for what it needs to do, especially if I have to get involved again!  
The only real problem, at that point, would be installing the Splix drivers.  
But if I’ve understood all the steps correctly, I could download the new Splix directly from GitHub and compile them directly on the Raspberry, thanks to the detailed instructions provided by the Openprint developer ValdikSS , who created a filter and related .ppd for my Samsung ml1860!  
And it works great!

We hope Michalng reads my post and helps me sort this out!

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [28 February 2026 22:46 UTC](https://dietpi.com/forum/t/solved-help-with-gpio-not-working/25008/6 "2026-02-28T22:46:32Z")

</div>

> [@Wgt1963](#):
>
> RPi GPIO installed

This a legacy API not supported anymore by the RPi kernel. There is a replacement package `python3-rpi-lgpio` which provides the API on top of the modern lgpio. But I remember one case where this did not work, guess it depends on the software and exact function used, probably no perfect drop-in replacement.

gpiozero as well uses lgpio if available, with highest priority. So yeah, that script requires an update to use a modern low-level or high-level library, or at least `python3-rpi-lgpio`.

---

<div class="post-metadata">

**Author:** ![Wgt1963](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/w/ea666f/32.png) [@Wgt1963](https://dietpi.com/forum/u/Wgt1963)\
**Post date:** [28 February 2026 23:28 UTC](https://dietpi.com/forum/t/solved-help-with-gpio-not-working/25008/7 "2026-02-28T23:28:26Z")

</div>

Okay, tanks, so what should I install, rpi.lgpio?

But do I have to uninstall rpi.gpio?

Won’t they conflict with each other?

I could use the script I put together for gpiozero, but that caused problems!

It’s true that I tried it on dietpi Trixie…

I’m no Debian wizard, so I think you’ll have to guide me like a child!!!🤣🤣🤣🤣

---

<div class="post-metadata">

**Author:** ![Wgt1963](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/w/ea666f/32.png) [@Wgt1963](https://dietpi.com/forum/u/Wgt1963)\
**Post date:** [2 March 2026 22:00 UTC](https://dietpi.com/forum/t/solved-help-with-gpio-not-working/25008/8 "2026-03-02T22:00:21Z")

</div>

After much research and trial and error, I solved the problems!

I am leaving this description here in case anyone else needs it in the future.

I started again with a clean installation, in which the only software installed was CUPS and python3, leaving i2c and spi disabled.

Before the first start-up, I modified dietpi.txt on the boot partition, unmasking the logind service by setting the option to 1:

```auto
AUTO_UNMASK_LOGIND=1

```

Since I was already there, I also set the host name and static IP.

Once I had completed the initial start-up by setting passwords, region, time and language, I moved on to testing that logind was actually working:

```auto
root@DietPi:~# systemctl status systemd-logind
● systemd-logind.service - User Login Management
     Loaded: loaded (/lib/systemd/system/systemd-logind.service; static)
     Active: active (running) since Wed 2023-04-19 16:29:25 BST; 1min 54s ago
       Docs: man:sd-login(3)
             man:systemd-logind.service(8)
             man:logind.conf(5)
             man:org.freedesktop.login1(5)
   Main PID: 422 (systemd-logind)
     Status: "Processing requests..."
      Tasks: 1 (limit: 9203)
     Memory: 1.3M
        CPU: 61ms
     CGroup: /system.slice/systemd-logind.service
             └─422 /lib/systemd/systemd-logind

```

So I added the following lines to /boot/firmware/config.txt:

```auto
#-------poweroff button------

dtoverlay=gpio-shutdown,gpio_pin3,active_low=1,gpio_pull=up

```

I rebooted and found that finally, by closing gpio3 to GND, the Raspberry shut down.

I then moved on to installing:

```auto
sudo apt install python3-gpiozero python3-lgpio

```

Then I created a led.py file on /home/dietpi/:

```auto
import sys

from gpiozero import LED

red = LED(17)

while True:

red.on()

sys.exit()

```

I launched dietpi-autostart, which creates a bash file

```auto
/var/lib/dietpi/dietpi-autostart/custom.sh

```

and inserted the following line of code:

```auto
/usr/bin/python3 /home/dietpi/led.py &

```

Then I moved on to installing the drivers for the printer, etc.

So I have a print server that I can turn on and off as I please, without compromising the SD card, and which lights up an LED at the end of the start-up process to show that it is operational!

Thanks to everyone who helped me…

See you next time.

Valter 😀 👋

---

<div class="post-metadata">

**Author:** ![system](https://dietpi.com/forum/uploads/default/original/1X/7e1021de2213860bce185915ce2c1786e56490ec.png) [@system](https://dietpi.com/forum/u/system)\
**Post date:** [31 May 2026 22:00 UTC](https://dietpi.com/forum/t/solved-help-with-gpio-not-working/25008/9 "2026-05-31T22:00:22Z")

</div>

Closed on 31 May 2026 22:00 UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
