# Displayotron 3000 Joystick.py "Failed to add edge detection"

**URL:** <https://forums.pimoroni.com/t/displayotron-3000-joystick-py-failed-to-add-edge-detection/270>\
**Category:** Support\
**Created:** [January 13, 2015, 8:26pm UTC](https://forums.pimoroni.com/t/displayotron-3000-joystick-py-failed-to-add-edge-detection/270 "2015-01-13T20:26:57Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rayleask](https://avatars.discourse-cdn.com/v4/letter/r/46a35a/32.png) [@rayleask](https://forums.pimoroni.com/u/rayleask)\
**Post date:** [January 13, 2015, 8:26pm UTC](https://forums.pimoroni.com/t/displayotron-3000-joystick-py-failed-to-add-edge-detection/270/1 "2015-01-13T20:26:57Z")

</div>

Hi. I have just setup my new DOT3000 and although most of the sample scripts work OK the joystick script fails with a “Failed to add edge detection” message. This a pain as I also cannot get the radio script working for the same reason. I have double checked and reinstalled all the necessary “stuff” but to no avail. Can anyone help out?

Thanks, Ray

---

<div class="post-metadata">

**Author:** ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)\
**Post date:** [January 13, 2015, 9:17pm UTC](https://forums.pimoroni.com/t/displayotron-3000-joystick-py-failed-to-add-edge-detection/270/2 "2015-01-13T21:17:50Z")

</div>

Try this:

```
pip install rpi-gpio -I --upgrade --force-reinstall

```

The edge detection happens within RPi.GPIO, so perhaps you have an old version or something else is awry. This is a good first step.

---

<div class="post-metadata">

**Author:** ![rayleask](https://avatars.discourse-cdn.com/v4/letter/r/46a35a/32.png) [@rayleask](https://forums.pimoroni.com/u/rayleask)\
**Post date:** [January 14, 2015, 11:00pm UTC](https://forums.pimoroni.com/t/displayotron-3000-joystick-py-failed-to-add-edge-detection/270/3 "2015-01-14T23:00:30Z")

</div>

Thanks for your reply. I tried your suggestion but nothing changed. I put a fresh install of Raspbian on my SD card and after updating I then fired up a script to install and configure everything automatically. This comes from the [Pimoroni.com](http://Pimoroni.com) website

curl -sS [get.pimoroni.com/dot3k](http://get.pimoroni.com/dot3k) | bash

It still failed but after adjusting line 184 from 10 to 20 in the [radio.py](http://radio.py) plugin, this resulted in sweet music coming from the headphones. It was suggested to me that maybe VLC was slow in responding to Pythons requests so try increasing the connection attempts.

Ray

---

<div class="post-metadata">

**Author:** ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)\
**Post date:** [January 15, 2015, 9:31am UTC](https://forums.pimoroni.com/t/displayotron-3000-joystick-py-failed-to-add-edge-detection/270/4 "2015-01-15T09:31:48Z")

</div>

Are you still seeing this error?

```
GPIO.add_event_detect(button, GPIO.FALLING, callback=handler, bouncetime=bounce)
RuntimeError: Failed to add edge detection
```

---

<div class="post-metadata">

**Author:** ![rayleask](https://avatars.discourse-cdn.com/v4/letter/r/46a35a/32.png) [@rayleask](https://forums.pimoroni.com/u/rayleask)\
**Post date:** [January 15, 2015, 5:25pm UTC](https://forums.pimoroni.com/t/displayotron-3000-joystick-py-failed-to-add-edge-detection/270/5 "2015-01-15T17:25:48Z")

</div>

No. It looks as though my restarting from scratch solved the problem. Looks like I did something wrong to start off with. Thanks for your help.

Ray

---

<div class="post-metadata">

**Author:** ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)\
**Post date:** [January 16, 2015, 10:26am UTC](https://forums.pimoroni.com/t/displayotron-3000-joystick-py-failed-to-add-edge-detection/270/6 "2015-01-16T10:26:42Z")

</div>

I think it’s just a dodgy version of the RPi.GPIO library, or something to that effect. I found a bug report filed with this same error for a specific version. Glad you got it up and running though!

---

<div class="post-metadata">

**Author:** ![keithb](https://avatars.discourse-cdn.com/v4/letter/k/48db29/32.png) [@keithb](https://forums.pimoroni.com/u/keithb)\
**Post date:** [January 17, 2016, 10:54am UTC](https://forums.pimoroni.com/t/displayotron-3000-joystick-py-failed-to-add-edge-detection/270/7 "2016-01-17T10:54:38Z")

</div>

Hi … i get the same issue but can’t rebuild my Pi.  
I have reinstalled the gpio and it is still the same …

anything else i could try?

thanks

---

<div class="post-metadata">

**Author:** ![RogueM](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/roguem/32/311_2.png) [@RogueM](https://forums.pimoroni.com/u/RogueM)\
**Post date:** [January 17, 2016, 12:05pm UTC](https://forums.pimoroni.com/t/displayotron-3000-joystick-py-failed-to-add-edge-detection/270/8 "2016-01-17T12:05:51Z")

</div>

How have you reinstalled RPi.GPIO? it can be rather tricky… from the top of my head you should do something like this:

```
sudo pip uninstall RPi.GPIO
sudo apt-get update
sudo apt-get install python-rpi.gpio

```

For Python 3 this will depend on what Raspbian distribution you have. First try:

```
sudo pip-3.2 uninstall RPi.GPIO
sudo apt-get update
sudo apt-get install python3-rpi.gpio

```

but if that fails:

```
sudo pip3 uninstall RPi.GPIO
sudo apt-get update
sudo apt-get install python3-rpi.gpio
```
