~alpine/devel

1

3.11.2 and RPi.GPIO 0.6.5 on Pi Zero : edge detection no longer working

Details
Message ID
<CA+ryuvCuLS1Lwp=Bc17L1btm7g1u33YGdehNRJqrEexrv5gpCg@mail.gmail.com>
DKIM signature
missing
Download raw message
Hi all,

I just installed Alpine 3.11.2 on a Pi Zero W, and just found RPi.GPIO no
longer works for edge detection.
Package installation :
apk add python3
apk add py3-rpigpio

Test file :
import RPi.GPIO as g
pin=4
g.setmode(g.BCM)
print("pin%d mode is %d\n" % (pin, g.gpio_function(pin)))
g.setup(pin, g.IN, pull_up_down=g.PUD_DOWN)
print("pin%d state=%d\n" % (pin, g.input(pin)))
while True:
   x = g.wait_for_edge(pin, g.BOTH)
   print("pin%d edge %d\n" % (pin, x))

On Alpine 3.10.0, it works as expected, printing a line as you bring pin 4
to ground or 3.3V.
On Alpine 3.11.2, i get :
# python3 testgpio.py
function of pin 4 = 1

pin 4 now is 0
Traceback (most recent call last):
  File "testgpio.py", line 8, in <module>
    x = g.wait_for_edge(pin, g.BOTH)
RuntimeError: Error waiting for edge

Other methods such as add_event_detect also fail with a RuntimeError about
being unable to add edge detection.
Other tests I ran prove reading pins and setting pin state do work.

lsmod shows :
i2c_gpio               16384  0
i2c_algo_bit           16384  1 i2c_gpio

So,
Which do you think is the culprit ? alpine or RPi.GPIO ?
Who would you reach out to to get this fixed ? or at least examined ?

Thanks for any feedback !
David
Details
Message ID
<CA+ryuvBuyUfH-DbQ2jx0mexFBo0jGD0X0UFnSpBPpJBQF8hBZw@mail.gmail.com>
In-Reply-To
<CA+ryuvCuLS1Lwp=Bc17L1btm7g1u33YGdehNRJqrEexrv5gpCg@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
Hi,

Think i know what the problem is: 3.11 dropped support for deprecated sysfs
gpio in kernel, which breaks RPi.GPIO for edge detection.

Was this intentional ? Or is it just that the config from kernel has those
items turned off by default ?

Can't check right now, but i believe raspbian is still supporting sysfs
gpio.
Don't you think alpine had better support it as well for Pi devices ?

David


Le jeu. 26 déc. 2019 à 23:39, David Taillé <david.taille.fr@gmail.com> a
écrit :

> Hi all,
>
> I just installed Alpine 3.11.2 on a Pi Zero W, and just found RPi.GPIO no
> longer works for edge detection.
> Package installation :
> apk add python3
> apk add py3-rpigpio
>
> Test file :
> import RPi.GPIO as g
> pin=4
> g.setmode(g.BCM)
> print("pin%d mode is %d\n" % (pin, g.gpio_function(pin)))
> g.setup(pin, g.IN, pull_up_down=g.PUD_DOWN)
> print("pin%d state=%d\n" % (pin, g.input(pin)))
> while True:
>    x = g.wait_for_edge(pin, g.BOTH)
>    print("pin%d edge %d\n" % (pin, x))
>
> On Alpine 3.10.0, it works as expected, printing a line as you bring pin 4
> to ground or 3.3V.
> On Alpine 3.11.2, i get :
> # python3 testgpio.py
> function of pin 4 = 1
>
> pin 4 now is 0
> Traceback (most recent call last):
>   File "testgpio.py", line 8, in <module>
>     x = g.wait_for_edge(pin, g.BOTH)
> RuntimeError: Error waiting for edge
>
> Other methods such as add_event_detect also fail with a RuntimeError about
> being unable to add edge detection.
> Other tests I ran prove reading pins and setting pin state do work.
>
> lsmod shows :
> i2c_gpio               16384  0
> i2c_algo_bit           16384  1 i2c_gpio
>
> So,
> Which do you think is the culprit ? alpine or RPi.GPIO ?
> Who would you reach out to to get this fixed ? or at least examined ?
>
> Thanks for any feedback !
> David
>
>
>
>
>
>
>
Reply to thread Export thread (mbox)