Posts by mattadori
-
-
The fan is the one in the picture. A standard one with 5V, GND, TXD pins.
WAKE_ON_GPIO=2 in the bootloader cause the Rpi to be warm even if "switched-off". I don't own a power meter but for sure is consuming more power than the WAKE_ON_GPIO=0 option. In the end it seems one has to play around with the GLOBAL_EN and a slide switch or similar. Not a normally opened button as the one I'm using right now. Anyway it's not really clear to me if it's going to work.
Any ideas are welcome.
-
HarryH Switch-on issue solved. The following helped. Thank you very much.
Edit EEPROM settings:
rpi-eeprom-config --editchanging WAKE_ON_GPIO=0 to WAKE_ON_GPIO=2 solved the issue.
Now I need to understand why the fan keeps spinning after shutdown. Could it be related to the bootloader parameter too ?
-
The behavior is expected, after some policy changes in new kernel version that only one consumer is allowed at the same time. GPIO3 seems to be blocked by your own script that you have started via autostart.sh, by another script/addon or an activated overlay in the config.txt that has been identified as ‘shutdown’. So you must terminate the process to free the resources in forehand. For debugging purposes of your running script you should be able to use the pinctrl command instead of gpioset to circiumstand the restriction.
pinctrl -p set GPIO3 pdThank you very much! The problem was inside the config.txt. Now GPIO3 is free.
About the switch-on issue. The bootloader contains the following
I guess that WAKE_ON_GPIO=0 disables the switch-on.
Moreover, after switching on using GPIO3 stopped working also my PWM fan continued spinning after shutdown.
Above I see POWER_OFF_ON_HALT=1. Could it be related to it ? -
Hello and thanks for all the things I learned from this forum.
Until some days ago I had the following setup working on my Rpi 4B but then it stopped working.
External power button connected to GPIO 3 and pin 9 (according to https://pinout.xyz/) that I was using to switch RPi on using an external button.
I also monitored the GPIO3 to call a shutdown python script (executed inside .config/autostart.sh at startup)Switch on does not work anymore and GPIO3 is reported busy. What should I do ? Is there a way to reset the GPIO3 to low ?
Code
Display MoreLibreELEC:~ # gpioinfo -c 0 gpiochip0 - 58 lines: line 0: "ID_SDA" input line 1: "ID_SCL" input line 2: "GPIO2" input line 3: "GPIO3" input active-low consumer="shutdown" ... ... LibreELEC:~ # gpioset GPIO3=0 gpioset: unable to request lines on chip '/dev/gpiochip0': Device or resource busy
Python
Display More### shutdown_button.py import os os.environ['LG_WD'] = '/tmp' from time import sleep import sys sys.path.append('/storage/.kodi/addons/virtual.rpi-tools/lib') from signal import pause from gpiozero import Button from subprocess import check_call def poweroff(): check_call(['kodi-send','--notification="Shutting down!"']) sleep(1) check_call(['shutdown','now']) shutdown_btn = Button("GPIO3", hold_time=2) shutdown_btn.when_held = poweroff pause()
Code
Display MoreLibreELEC:~ # python scripts/shutdown_button.py Traceback (most recent call last): File "/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/pins/pi.py", line 411, in pin pin = self.pins[info] ~~~~~~~~~^^^^^^ KeyError: PinInfo(number=5, name='GPIO3', names=frozenset({'J8:5', 3, 'GPIO3', 'BCM3', 'WPI9', 'BOARD5', '3'}), pull='up', row=3, col=1, interfaces=frozenset({'', 'spi', 'gpio', 'uart', 'dpi', 'i2c'})) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/storage/scripts/shutdown_button.py", line 22, in <module> shutdown_btn = Button("GPIO3", hold_time=2) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/devices.py", line 108, in __call__ self = super().__call__(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/input_devices.py", line 412, in __init__ super().__init__( File "/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/mixins.py", line 417, in __init__ super().__init__(*args, **kwargs) File "/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/input_devices.py", line 162, in __init__ super().__init__( File "/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/mixins.py", line 243, in __init__ super().__init__(*args, **kwargs) File "/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/input_devices.py", line 79, in __init__ super().__init__(pin, pin_factory=pin_factory) File "/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/devices.py", line 553, in __init__ pin = self.pin_factory.pin(pin) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/pins/pi.py", line 413, in pin pin = self.pin_class(self, info) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/pins/lgpio.py", line 126, in __init__ lgpio.gpio_claim_input( File "/storage/.kodi/addons/virtual.rpi-tools/lib/lgpio.py", line 755, in gpio_claim_input return _u2i(_lgpio._gpio_claim_input(handle&0xffff, lFlags, gpio)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/storage/.kodi/addons/virtual.rpi-tools/lib/lgpio.py", line 458, in _u2i raise error(error_text(v)) lgpio.error: 'GPIO busy'