Originally created by: danielpe...@gmail.com
Originally owned by: btcros...@googlemail.com
There seems to be a limit to how many wait_for_edge-events can be processed.
I use a circuit that switches the input on and off around 60 times per second. Everything is working until I hit a reproducable limit of 1017 events.
The used code:
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
channel = 7
avg = 0
i = 0
starttime = time.time()
print "starttime: " + str(starttime)
GPIO.setup(channel, GPIO.IN, pull_up_down=GPIO.PUD_UP)
while True:
try:
GPIO.wait_for_edge(channel, GPIO.RISING)
print GPIO.input(channel)
t = time.time()
starttime = t - starttime
avg = (avg + starttime) / 2
print "elapsed: " + str(starttime)
print "avg: " + str(int(avg*1000))
print i
i += 1
starttime = t
except KeyboardInterrupt:
GPIO.cleanup()
After holding the button on my circuit for a while the process exits with this errormessage:
...
elapsed: 0.0232310295105
avg: 23
1016
1
elapsed: 0.0233290195465
avg: 23
1017
Traceback (most recent call last):
File "input.py", line 17, in <module>
RuntimeError: Error #3 waiting for edge
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: btcros...@googlemail.com
Might already be fixed in source code library - a possible fix was in place before any issue was identified.
Mergedinto: 38
Owner: btcros...@googlemail.com
Status: Duplicate
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: lpc...@gmail.com
I am having the same issue with 0.5.2a. I tried to run cleanup() every time an edge is detected, but still the same result. Is there a work around?
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: sau...@embedded-projects.net
I have the same problem. After 1016 rounds or interrupts:
T 1014
T 1015
T 1016
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 505, in run
File "/var/www/server.py", line 25, in DoTheDew
RuntimeError: Error #3 waiting for edge