title: Failed to add edge detection - Raspberry Pi 3 GPIO
body: <p>I am using a Raspberry Pi 3 model B.</p>
  
  <p>I tried different approaches using both <code>gpiozero</code> and <code>RPi.GPIO</code>. The problem occurs regardless of the library used.</p>
  
  <p>Here is an example of code that fails with <code>gpiozero</code>.</p>
  
  <pre><code>from gpiozero import Button
  from signal import pause
  
  def handle():
      print("Pressed!")
  
  button = None
  while not button:
      try:
          button = Button(4, pull_up=True)
          button.when_pressed = handle
      except RuntimeError as e:
          print(e)
          pass
  
  pause()
  </code></pre>
  
  <p>The line <code>button = Button(4, pull_up=True)</code> always raises a <code>RuntimeError</code> and the output of the program (running <code>python3</code>) is:</p>
  
  <pre><code>Failed to add edge detection
  Failed to add edge detection
  Failed to add edge detection
  Failed to add edge detection
  # ... it goes on for ages
  </code></pre>
  
  <p>I already tried to reinstall <code>RPi.GPIO</code> and <code>gpiozero</code> but it did not help.</p>
  
  <p>Here is the full traceback of the exception</p>
  
  <pre><code>Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/gpiozero/input_devices.py", line 84, in __init__
      self.pin.when_changed = self._fire_events
    File "/usr/lib/python3/dist-packages/gpiozero/pins/__init__.py", line 240, in &lt;lambda&gt;
      lambda self, value: self._set_when_changed(value),
    File "/usr/lib/python3/dist-packages/gpiozero/pins/rpigpio.py", line 233, in _set_when_changed
      bouncetime=self._bounce)
  RuntimeError: Failed to add edge detection
  </code></pre>