Received: from mr85p00im-zteg06022001.me.com (mr85p00im-zteg06022001.me.com [17.58.23.193]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id 04C1B782F5F for <~alpine/devel@lists.alpinelinux.org>; Sun, 17 Apr 2022 16:46:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; t=1650213969; bh=Qo/BFSj2sfslPx5C/BKYywW9SCtlo91LJ5JN1P/5oNs=; h=Content-Type:From:Mime-Version:Subject:Date:Message-Id:To; b=X2QLh97wWLNKzFIs1FsAaGmPMbmkZIoqWNX4LqqVT8xJAokp9SpAhexepsshaQcWX YqfP1T9CzKr1Be9U0aymfewU8u9OffV01r2O+11UPH/uxBGOzSCQhLiCbxOr0i0LHf KCfeDmI3wM4DCqW7ikOKYbXzQIPXuzAlFP/U5UAQoBSaB3u0A1zBuCbpk3CLckAxr7 1IpPr2dDFYrT1JZzmtn7XH6QmJYzCNmbWlr4PftmtRG/u2rMe8qqPisnNWYvSDIN6O pNUEGxJB+1+aVBM41eMUQUXAitoefZZiM9mrgXnpmFnXGywY2S0ijAKznbvCuUkmAk Z1HPU1X5ISQkg== Received: from smtpclient.apple (mr38p00im-dlb-asmtp-mailmevip.me.com [17.57.152.18]) by mr85p00im-zteg06022001.me.com (Postfix) with ESMTPS id E0FC08001EF; Sun, 17 Apr 2022 16:46:08 +0000 (UTC) Content-Type: multipart/alternative; boundary=Apple-Mail-259316DE-BE17-475A-83A6-FC16DAC1BA54 Content-Transfer-Encoding: 7bit From: Duncan Bellamy Mime-Version: 1.0 (1.0) Subject: Re: Enable GPIO for RPi 4 Date: Sun, 17 Apr 2022 17:46:07 +0100 Message-Id: <8FF912BF-7CB4-478E-88D0-CF29DF411EA0@icloud.com> References: <2db66cb8-eb3d-e7cc-03ff-e3538b794c77@disroot.org> Cc: ~alpine/devel@lists.alpinelinux.org In-Reply-To: <2db66cb8-eb3d-e7cc-03ff-e3538b794c77@disroot.org> To: Thomas Schneider X-Mailer: iPad Mail (19E258) X-Proofpoint-Virus-Version: =?UTF-8?Q?vendor=3Dfsecure_engine=3D1.1.170-22c6f66c430a71ce266a39bfe25bc?= =?UTF-8?Q?2903e8d5c8f:6.0.425,18.0.816,17.0.605.474.0000000_definitions?= =?UTF-8?Q?=3D2022-01-18=5F01:2022-01-14=5F01,2022-01-18=5F01,2020-01-23?= =?UTF-8?Q?=5F02_signatures=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 mlxscore=0 adultscore=0 clxscore=1011 spamscore=0 phishscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2204170115 --Apple-Mail-259316DE-BE17-475A-83A6-FC16DAC1BA54 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Can you see gpio in /sys/class/gpio ? Or an overlay might help: https://github.com/raspberrypi/firmware/blob/4fe2e= 4af02058f88f991469349a335a25a2c719d/boot/overlays/README#L1166 > On 17 Apr 2022, at 15:55, Thomas Schneider wrote= : >=20 > =EF=BB=BFHello, >=20 > I want to use a RPi power button > > and this requires GPIO . >=20 > However, it looks like GPIO is disabled in RPi 4. > When I start a relevant Python program I get this error: > $ sudo /usr/bin/python3 /opt/fanshim-python/examples/poweroff.py > traceback (most recent call last): > File "/opt/fanshim-python/examples/poweroff.py", line 12, in > GPIO.wait_for_edge(button_pin, GPIO.FALLING) > RuntimeError: Error waiting for edge >=20 > Can you please advise how to fix this issue? >=20 > This isssue is not reproducible with Raspbian OS (based on Debian). >=20 > THX > Thomas >=20 --Apple-Mail-259316DE-BE17-475A-83A6-FC16DAC1BA54 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Can you see gpio in /sys/class/gpio ?
<= br>
Or an overlay might help: https://github.com/raspberrypi/firmware/blob/4fe2e4af02058= f88f991469349a335a25a2c719d/boot/overlays/README#L1166

On 17 Apr 2022, at 15:55, Thomas Schneider &= lt;t.schneider@disroot.org> wrote:

=EF=BB=BFHello,
<= br>I want to use a RPi power button
<https://howcho= o.com/g/mwnlytk3zmm/how-to-add-a-power-button-to-your-raspberry-pi>
and this requires GPIO <https://pimylifeup.com/raspberry-pi-gp= io/>.

However, it looks like GPIO is dis= abled in RPi 4.
When I start a relevant Python program I get= this error:
$ sudo /usr/bin/python3 /opt/fanshim-python/exa= mples/poweroff.py
traceback (most recent call last):<= br>  File "/opt/fanshim-python/examples/poweroff.py", line 12, in= <module>
    GPIO.wait_for_edge(button= _pin, GPIO.FALLING)
RuntimeError: Error waiting for edge

Can you please advise how to fix this issue?

This isssue is not reproducible with Raspbia= n OS (based on Debian).

THX
Thomas


= --Apple-Mail-259316DE-BE17-475A-83A6-FC16DAC1BA54--