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:
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:
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:
dtoverlay=gpio-shutdown,active_low=1
that I entered in:
/boot/config.txt
no longer has any effect!
Can you help me?
Thank you all for your help.