Failed to add edge detection with latest push #71

Closed
opened 2018-10-25 21:34:46 +02:00 by mishi · 18 comments
mishi commented 2018-10-25 21:34:46 +02:00 (Migrated from git.mattzz.de)
pi@dungeon:~/halloween $ ./pumpkin.py 
WARNING: No database found, initializing db
INFO: Good day. This is dungeon coming online.
INFO: Setting up GPIO 1 on pin 12
INFO: Setting up GPIO 2 on pin 16
INFO: Setting up GPIO 3 on pin 18
INFO: Setting up GPIO 4 on pin 22
INFO: Setting up GPIO 5 on pin 13
INFO: Setting up GPIO 6 on pin 15
INFO: Registering callback for rising edge on pin 11
INFO: Done.
INFO: DB: setting name: is_scaring, value: 0
INFO: DB: setting name: automatic_mode, value: 0
INFO: DB: setting name: haunted_house, value: 
INFO: DB: setting name: 1, value: 0
INFO: DB: setting name: 2, value: 0
INFO: DB: setting name: 3, value: 0
INFO: DB: setting name: 4, value: 0
INFO: DB: setting name: 5, value: 0
INFO: DB: setting name: 6, value: 0
 * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
 * Restarting with stat
INFO: Good day. This is dungeon coming online.
INFO: Setting up GPIO 1 on pin 12
INFO: Setting up GPIO 2 on pin 16
INFO: Setting up GPIO 3 on pin 18
INFO: Setting up GPIO 4 on pin 22
INFO: Setting up GPIO 5 on pin 13
INFO: Setting up GPIO 6 on pin 15
INFO: Registering callback for rising edge on pin 11
Traceback (most recent call last):
  File "./pumpkin.py", line 583, in <module>
    init_app()
  File "./pumpkin.py", line 565, in init_app
    GPIO.add_event_detect(cfg.inputs[1] , GPIO.RISING, callback = input_callback_1)
RuntimeError: Failed to add edge detection
``` pi@dungeon:~/halloween $ ./pumpkin.py WARNING: No database found, initializing db INFO: Good day. This is dungeon coming online. INFO: Setting up GPIO 1 on pin 12 INFO: Setting up GPIO 2 on pin 16 INFO: Setting up GPIO 3 on pin 18 INFO: Setting up GPIO 4 on pin 22 INFO: Setting up GPIO 5 on pin 13 INFO: Setting up GPIO 6 on pin 15 INFO: Registering callback for rising edge on pin 11 INFO: Done. INFO: DB: setting name: is_scaring, value: 0 INFO: DB: setting name: automatic_mode, value: 0 INFO: DB: setting name: haunted_house, value: INFO: DB: setting name: 1, value: 0 INFO: DB: setting name: 2, value: 0 INFO: DB: setting name: 3, value: 0 INFO: DB: setting name: 4, value: 0 INFO: DB: setting name: 5, value: 0 INFO: DB: setting name: 6, value: 0 * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit) * Restarting with stat INFO: Good day. This is dungeon coming online. INFO: Setting up GPIO 1 on pin 12 INFO: Setting up GPIO 2 on pin 16 INFO: Setting up GPIO 3 on pin 18 INFO: Setting up GPIO 4 on pin 22 INFO: Setting up GPIO 5 on pin 13 INFO: Setting up GPIO 6 on pin 15 INFO: Registering callback for rising edge on pin 11 Traceback (most recent call last): File "./pumpkin.py", line 583, in <module> init_app() File "./pumpkin.py", line 565, in init_app GPIO.add_event_detect(cfg.inputs[1] , GPIO.RISING, callback = input_callback_1) RuntimeError: Failed to add edge detection ```
mattzz commented 2018-10-25 21:54:50 +02:00 (Migrated from git.mattzz.de)

I just saw this, too.
Should be fixed with latest commit b12797209d

I just saw this, too. Should be fixed with latest commit b12797209d
mattzz commented 2018-10-25 22:04:01 +02:00 (Migrated from git.mattzz.de)

Actually my bug was a bit different:

INFO: Motion detected! (11)
INFO: DB: getting name: auto_mode_hosts, value: {"halloweenpi:5000": "on"}
Traceback (most recent call last):
  File "./pumpkin.py", line 447, in input_callback_1
    if auto_mode_hosts[cfg.hostname] == 'on':
KeyError: 'halloweenpi'

This is fixed in commit b12797209d

Actually my bug was a bit different: ``` INFO: Motion detected! (11) INFO: DB: getting name: auto_mode_hosts, value: {"halloweenpi:5000": "on"} Traceback (most recent call last): File "./pumpkin.py", line 447, in input_callback_1 if auto_mode_hosts[cfg.hostname] == 'on': KeyError: 'halloweenpi' ``` This is fixed in commit b12797209d
mishi commented 2018-10-25 22:17:37 +02:00 (Migrated from git.mattzz.de)

Hmm, I thought this came from dungeon not being in the hosts list - but it was already. Any idea? Still is the same with the recent code. Running in debug mode.

Hmm, I thought this came from dungeon not being in the hosts list - but it was already. Any idea? Still is the same with the recent code. Running in debug mode.
mishi commented 2018-10-25 22:41:23 +02:00 (Migrated from git.mattzz.de)

Might be related to port 11 being assigned to something else? See: https://www.raspberrypi.org/forums/viewtopic.php?t=205327

Might be related to port 11 being assigned to something else? See: https://www.raspberrypi.org/forums/viewtopic.php?t=205327
mishi commented 2018-10-26 21:06:43 +02:00 (Migrated from git.mattzz.de)

This issue does not seem to happen on nginx...

This issue does not seem to happen on nginx...
mattzz commented 2018-10-26 21:23:08 +02:00 (Migrated from git.mattzz.de)

Are you using a RPi 3B+?

Are you using a RPi 3B+?
mishi commented 2018-10-26 23:20:47 +02:00 (Migrated from git.mattzz.de)

Yes: Pi 3 Modell B+

Yes: Pi 3 Modell B+
mattzz commented 2018-10-27 12:39:07 +02:00 (Migrated from git.mattzz.de)

I'm seeing some issues like this in combination with the rpi3b+ on the interwebs.

Check out if it still happens with sudo ./pumpkin.py

If yes, it's related to root rights. (I think the nginx master process is running as root.)

Still odd...

I'm seeing some issues like this in combination with the rpi3b+ on the interwebs. Check out if it still happens with `sudo ./pumpkin.py` If yes, it's related to root rights. (I think the nginx master process is running as root.) Still odd...
mishi commented 2018-10-28 09:06:59 +01:00 (Migrated from git.mattzz.de)

Strange: sudo doesn't make a difference.

pi@demon:~/halloween $ ./pumpkin.py 
INFO: Good day. This is demon coming online.
INFO: Setting up GPIO 1 on pin 12
INFO: Setting up GPIO 2 on pin 16
INFO: Setting up GPIO 3 on pin 18
INFO: Setting up GPIO 4 on pin 22
INFO: Setting up GPIO 5 on pin 13
INFO: Setting up GPIO 6 on pin 15
INFO: Registering callback for rising edge on pin 11
Traceback (most recent call last):
  File "./pumpkin.py", line 603, in <module>
    init_app()
  File "./pumpkin.py", line 585, in init_app
    GPIO.add_event_detect(cfg.inputs[1] , GPIO.RISING, callback = input_callback_1)
RuntimeError: Failed to add edge detection
pi@demon:~/halloween $ sudo ./pumpkin.py 
INFO: Good day. This is demon coming online.
INFO: Setting up GPIO 1 on pin 12
INFO: Setting up GPIO 2 on pin 16
INFO: Setting up GPIO 3 on pin 18
INFO: Setting up GPIO 4 on pin 22
INFO: Setting up GPIO 5 on pin 13
INFO: Setting up GPIO 6 on pin 15
INFO: Registering callback for rising edge on pin 11
Traceback (most recent call last):
  File "./pumpkin.py", line 603, in <module>
    init_app()
  File "./pumpkin.py", line 585, in init_app
    GPIO.add_event_detect(cfg.inputs[1] , GPIO.RISING, callback = input_callback_1)
RuntimeError: Failed to add edge detection
Strange: `sudo` doesn't make a difference. ``` pi@demon:~/halloween $ ./pumpkin.py INFO: Good day. This is demon coming online. INFO: Setting up GPIO 1 on pin 12 INFO: Setting up GPIO 2 on pin 16 INFO: Setting up GPIO 3 on pin 18 INFO: Setting up GPIO 4 on pin 22 INFO: Setting up GPIO 5 on pin 13 INFO: Setting up GPIO 6 on pin 15 INFO: Registering callback for rising edge on pin 11 Traceback (most recent call last): File "./pumpkin.py", line 603, in <module> init_app() File "./pumpkin.py", line 585, in init_app GPIO.add_event_detect(cfg.inputs[1] , GPIO.RISING, callback = input_callback_1) RuntimeError: Failed to add edge detection pi@demon:~/halloween $ sudo ./pumpkin.py INFO: Good day. This is demon coming online. INFO: Setting up GPIO 1 on pin 12 INFO: Setting up GPIO 2 on pin 16 INFO: Setting up GPIO 3 on pin 18 INFO: Setting up GPIO 4 on pin 22 INFO: Setting up GPIO 5 on pin 13 INFO: Setting up GPIO 6 on pin 15 INFO: Registering callback for rising edge on pin 11 Traceback (most recent call last): File "./pumpkin.py", line 603, in <module> init_app() File "./pumpkin.py", line 585, in init_app GPIO.add_event_detect(cfg.inputs[1] , GPIO.RISING, callback = input_callback_1) RuntimeError: Failed to add edge detection ```
mishi commented 2018-10-28 09:17:20 +01:00 (Migrated from git.mattzz.de)

On demon it doesn't even run on deployed on nginx:

ct 28 09:12:02 demon uwsgi[2001]: INFO: Good day. This is demon coming online.
Oct 28 09:12:02 demon uwsgi[2001]: INFO: Setting up GPIO 1 on pin 12
Oct 28 09:12:02 demon uwsgi[2001]: INFO: Setting up GPIO 2 on pin 16
Oct 28 09:12:02 demon uwsgi[2001]: INFO: Setting up GPIO 3 on pin 18
Oct 28 09:12:02 demon uwsgi[2001]: INFO: Setting up GPIO 4 on pin 22
Oct 28 09:12:02 demon uwsgi[2001]: INFO: Setting up GPIO 5 on pin 13
Oct 28 09:12:02 demon uwsgi[2001]: INFO: Setting up GPIO 6 on pin 15
Oct 28 09:12:02 demon uwsgi[2001]: INFO: Registering callback for rising edge on pin 11
Oct 28 09:12:02 demon uwsgi[2001]: Traceback (most recent call last):
Oct 28 09:12:02 demon uwsgi[2001]:   File "./wsgi.py", line 1, in <module>
Oct 28 09:12:02 demon uwsgi[2001]:     from pumpkin import app
Oct 28 09:12:02 demon uwsgi[2001]:   File "./pumpkin.py", line 609, in <module>
Oct 28 09:12:02 demon uwsgi[2001]:     init_app()
Oct 28 09:12:02 demon uwsgi[2001]:   File "./pumpkin.py", line 591, in init_app
Oct 28 09:12:02 demon uwsgi[2001]:     GPIO.add_event_detect(cfg.inputs[1] , GPIO.RISING, callback = input_callback_1)
Oct 28 09:12:02 demon uwsgi[2001]: RuntimeError: Failed to add edge detection
Oct 28 09:12:02 demon uwsgi[2001]: unable to load app 0 (mountpoint='') (callable not found or import error)
Oct 28 09:12:02 demon uwsgi[2001]: *** no app loaded. going in full dynamic mode ***
On demon it doesn't even run on deployed on nginx: ``` ct 28 09:12:02 demon uwsgi[2001]: INFO: Good day. This is demon coming online. Oct 28 09:12:02 demon uwsgi[2001]: INFO: Setting up GPIO 1 on pin 12 Oct 28 09:12:02 demon uwsgi[2001]: INFO: Setting up GPIO 2 on pin 16 Oct 28 09:12:02 demon uwsgi[2001]: INFO: Setting up GPIO 3 on pin 18 Oct 28 09:12:02 demon uwsgi[2001]: INFO: Setting up GPIO 4 on pin 22 Oct 28 09:12:02 demon uwsgi[2001]: INFO: Setting up GPIO 5 on pin 13 Oct 28 09:12:02 demon uwsgi[2001]: INFO: Setting up GPIO 6 on pin 15 Oct 28 09:12:02 demon uwsgi[2001]: INFO: Registering callback for rising edge on pin 11 Oct 28 09:12:02 demon uwsgi[2001]: Traceback (most recent call last): Oct 28 09:12:02 demon uwsgi[2001]: File "./wsgi.py", line 1, in <module> Oct 28 09:12:02 demon uwsgi[2001]: from pumpkin import app Oct 28 09:12:02 demon uwsgi[2001]: File "./pumpkin.py", line 609, in <module> Oct 28 09:12:02 demon uwsgi[2001]: init_app() Oct 28 09:12:02 demon uwsgi[2001]: File "./pumpkin.py", line 591, in init_app Oct 28 09:12:02 demon uwsgi[2001]: GPIO.add_event_detect(cfg.inputs[1] , GPIO.RISING, callback = input_callback_1) Oct 28 09:12:02 demon uwsgi[2001]: RuntimeError: Failed to add edge detection Oct 28 09:12:02 demon uwsgi[2001]: unable to load app 0 (mountpoint='') (callable not found or import error) Oct 28 09:12:02 demon uwsgi[2001]: *** no app loaded. going in full dynamic mode *** ```
mishi commented 2018-10-28 09:24:48 +01:00 (Migrated from git.mattzz.de)

It works on nginx on dungeon but not in debug mode (also with sudo):

pi@dungeon:~/halloween $ ./pumpkin.py 
INFO: Good day. This is dungeon coming online.
INFO: Setting up GPIO 1 on pin 12
INFO: Setting up GPIO 2 on pin 16
INFO: Setting up GPIO 3 on pin 18
INFO: Setting up GPIO 4 on pin 22
INFO: Setting up GPIO 5 on pin 13
INFO: Setting up GPIO 6 on pin 15
INFO: Registering callback for rising edge on pin 11
Traceback (most recent call last):
  File "./pumpkin.py", line 609, in <module>
    init_app()
  File "./pumpkin.py", line 591, in init_app
    GPIO.add_event_detect(cfg.inputs[1] , GPIO.RISING, callback = input_callback_1)
RuntimeError: Failed to add edge detection
Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: Good day. This is dungeon coming online.
Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: Setting up GPIO 1 on pin 12
Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: Setting up GPIO 2 on pin 16
Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: Setting up GPIO 3 on pin 18
Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: Setting up GPIO 4 on pin 22
Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: Setting up GPIO 5 on pin 13
Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: Setting up GPIO 6 on pin 15
Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: Registering callback for rising edge on pin 11
Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: Done.
Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: DB: setting name: is_scaring, value: 0
Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: DB: setting name: automatic_mode, value: 0
Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: DB: setting name: haunted_house, value:
Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: DB: setting name: 1, value: 0
Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: DB: setting name: 2, value: 0
Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: DB: setting name: 3, value: 0
Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: DB: setting name: 4, value: 0
Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: DB: setting name: 5, value: 0
Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: DB: setting name: 6, value: 0
Oct 28 09:20:14 dungeon uwsgi[2227]: WSGI app 0 (mountpoint='') ready in 2 seconds on interpreter 0x176ec10 pid: 2231 (defaul
It works on nginx on dungeon but not in debug mode (also with sudo): ``` pi@dungeon:~/halloween $ ./pumpkin.py INFO: Good day. This is dungeon coming online. INFO: Setting up GPIO 1 on pin 12 INFO: Setting up GPIO 2 on pin 16 INFO: Setting up GPIO 3 on pin 18 INFO: Setting up GPIO 4 on pin 22 INFO: Setting up GPIO 5 on pin 13 INFO: Setting up GPIO 6 on pin 15 INFO: Registering callback for rising edge on pin 11 Traceback (most recent call last): File "./pumpkin.py", line 609, in <module> init_app() File "./pumpkin.py", line 591, in init_app GPIO.add_event_detect(cfg.inputs[1] , GPIO.RISING, callback = input_callback_1) RuntimeError: Failed to add edge detection ``` ``` Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: Good day. This is dungeon coming online. Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: Setting up GPIO 1 on pin 12 Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: Setting up GPIO 2 on pin 16 Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: Setting up GPIO 3 on pin 18 Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: Setting up GPIO 4 on pin 22 Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: Setting up GPIO 5 on pin 13 Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: Setting up GPIO 6 on pin 15 Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: Registering callback for rising edge on pin 11 Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: Done. Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: DB: setting name: is_scaring, value: 0 Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: DB: setting name: automatic_mode, value: 0 Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: DB: setting name: haunted_house, value: Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: DB: setting name: 1, value: 0 Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: DB: setting name: 2, value: 0 Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: DB: setting name: 3, value: 0 Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: DB: setting name: 4, value: 0 Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: DB: setting name: 5, value: 0 Oct 28 09:20:14 dungeon uwsgi[2227]: INFO: DB: setting name: 6, value: 0 Oct 28 09:20:14 dungeon uwsgi[2227]: WSGI app 0 (mountpoint='') ready in 2 seconds on interpreter 0x176ec10 pid: 2231 (defaul ```
mishi commented 2018-10-28 09:36:52 +01:00 (Migrated from git.mattzz.de)

After reading this comment, I tried pin 37 on demon and with that change it works in nginx (not on command line still): https://www.raspberrypi.org/forums/viewtopic.php?t=205327#p1273043

After reading this comment, I tried pin 37 on demon and with that change it works in nginx (not on command line still): https://www.raspberrypi.org/forums/viewtopic.php?t=205327#p1273043
mishi commented 2018-10-28 10:05:35 +01:00 (Migrated from git.mattzz.de)

Dungeon and demon are identical RPi. On dungeon it works with pin 11 (at least in nginx) while on demon it doesn't (but works with pin 37).

I found some differences in the apt packages: Demon was older. So I'm performing an apt-get update and upgrade now...

Dungeon and demon are identical RPi. On dungeon it works with pin 11 (at least in nginx) while on demon it doesn't (but works with pin 37). I found some differences in the apt packages: Demon was older. So I'm performing an apt-get update and upgrade now...
mishi commented 2018-10-28 10:17:57 +01:00 (Migrated from git.mattzz.de)

After the update it also runs on demon in nginx with pin 11.

After the update it also runs on demon in nginx with pin 11.
mishi commented 2018-10-28 10:26:40 +01:00 (Migrated from git.mattzz.de)

Changed from bug to "help wanted" because this issue doesn't seem to be related with a bug in the application itself.

Changed from bug to "help wanted" because this issue doesn't seem to be related with a bug in the application itself.
mishi commented 2018-10-28 11:23:01 +01:00 (Migrated from git.mattzz.de)

The fucker is back: On demon in nginx for pin 11 and 37!

The fucker is back: On demon in nginx for pin 11 and 37!
mishi commented 2018-10-28 11:23:44 +01:00 (Migrated from git.mattzz.de)

After reboot it's ok in pin 37..

After reboot it's ok in pin 37..
mishi commented 2018-10-30 00:31:00 +01:00 (Migrated from git.mattzz.de)

sudo reboot does the trick if it appears after a restart.

`sudo reboot` does the trick if it appears after a restart.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mattzz/halloween#71
No description provided.