Uncategorized

button notes

Asked 
Active yesterday
Viewed 48 times
2

I’m currently having trouble with my project. I’m using a Raspberry Pi 3B+ with an InnoMaker Hifi Amp Hat and some push buttons.

import time
import signal
import os
import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BCM)

debounceTime = 300

btn1 = 24
btn2 = 25
btn3 = 13
btn4 = 12
btn5 = 16

def cb_btn1(channel):
    print('Button 1 pressed')

def cb_btn2(channel):
    print('Button 2 pressed')

def cb_btn3(channel):
    print('Button 3 pressed')

def cb_btn4(channel):
    print('Button 4 pressed')

def cb_btn5(channel):
    print('Button 5 pressed')

class GracefulExit:
    kill_now = False
    def __init__(self):
        signal.signal(signal.SIGINT, self.exit_gracefully)
        signal.signal(signal.SIGTERM, self.exit_gracefully)

    def exit_gracefully(self,signum, frame):
        self.kill_now = True

GPIO.setup(btn1, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(btn2, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(btn3, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(btn4, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(btn5, GPIO.IN, pull_up_down=GPIO.PUD_UP)

GPIO.add_event_detect(btn1, GPIO.FALLING, callback=cb_btn1, bouncetime=debounceTime)
GPIO.add_event_detect(btn2, GPIO.FALLING, callback=cb_btn2, bouncetime=debounceTime)
GPIO.add_event_detect(btn3, GPIO.FALLING, callback=cb_btn3, bouncetime=debounceTime)
GPIO.add_event_detect(btn4, GPIO.FALLING, callback=cb_btn4, bouncetime=debounceTime)
GPIO.add_event_detect(btn5, GPIO.FALLING, callback=cb_btn5, bouncetime=debounceTime)

def main():
    app_killer = GracefulExit()
    while not app_killer.kill_now:
        try:
            time.sleep(0.5)
        except BaseException:
            GPIO.cleanup()
            print "Encountered an axeption."
            break
    print "End of the program."
    GPIO.cleanup()

if __name__ == '__main__':
    main()

I’ve tried with external pull-up/down and also adding a 0.1uF cap between 3.3V / GND and the GPIO.

I’m not using any pins that the Hat is supposed to use (GPIOs 18 to 21) according to the manual

My setup us currently on a breadboard, maybe I’m getting EMI with the jumpers wires…

I’m using a good quality power supply so I hope the problem isn’t coming from here… For reference it’s a Mean Well GSM40A12-P1J

I’ve discovered that touching the metal Ethernet/USB port with the metal tip of an USB flash drive or the tips of my multimeter probe trigger almost all my GPIO each times.

Is there something that I’m missing to get reliable input?

Schematics Breadboard pictures


Edit: Ok I’m slowly putting the pieces together. In order to make pigpiod running on a non full raspbian image in addition to sudo apt install pigpiodI had to run sudo apt install python3-pigpio

Now running python3 monitor.py 12 13 16 24 25 show me this

[...]
G=18 l=1 d=30
G=13 l=1 d=5
G=18 l=0 d=5
G=13 l=0 d=10
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=10
G=18 l=1 d=5
G=18 l=0 d=25
G=18 l=1 d=5
G=18 l=0 d=25
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=5
G=18 l=1 d=40
G=18 l=0 d=5
G=18 l=1 d=75
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=10
G=18 l=1 d=25
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=115
G=18 l=0 d=10
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=60
G=18 l=0 d=5
G=18 l=1 d=40
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=70
G=18 l=0 d=5
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=5
G=18 l=1 d=50
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=100
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=10
G=18 l=1 d=25
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=66
G=18 l=0 d=5
G=18 l=1 d=84
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=25
G=18 l=0 d=10
G=18 l=1 d=55
G=18 l=0 d=5
G=18 l=1 d=60
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=40
G=18 l=0 d=5
G=18 l=1 d=35
G=18 l=0 d=5
G=18 l=1 d=45
G=18 l=0 d=5
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=45
G=18 l=0 d=5
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=10
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=50
G=18 l=0 d=10
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=10
G=18 l=1 d=45
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=50
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=35
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=15
G=18 l=1 d=20
G=18 l=0 d=10
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=40
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=10
G=18 l=1 d=25
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=25
G=18 l=0 d=10
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=50
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=55
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=25
G=18 l=0 d=5
G=18 l=1 d=55
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=80
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=25
G=18 l=0 d=10
G=18 l=1 d=50
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=121
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=29
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=25
G=18 l=0 d=10
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=25
G=18 l=0 d=5
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=70
G=18 l=0 d=5
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=75
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=35
G=18 l=0 d=5
G=18 l=1 d=45
G=18 l=0 d=5
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=60
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=60
G=18 l=0 d=10
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=16 l=1 d=9865
G=16 l=0 d=5
G=16 l=1 d=10
G=25 l=1 d=9865
G=16 l=0 d=5
G=25 l=0 d=5
G=16 l=1 d=10
G=25 l=1 d=10
G=16 l=0 d=5
G=25 l=0 d=5
G=16 l=1 d=5
G=18 l=1 d=45
G=18 l=0 d=5
G=25 l=1 d=10
G=25 l=0 d=5
G=25 l=1 d=5
G=18 l=1 d=55
G=18 l=0 d=5
G=18 l=1 d=10
G=18 l=0 d=5
G=24 l=1 d=9855
G=24 l=0 d=5
G=24 l=1 d=10
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=12 l=1 d=9775
G=13 l=1 d=9755
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=10
G=18 l=0 d=10
G=18 l=1 d=5
G=18 l=0 d=10
G=18 l=1 d=10
G=18 l=0 d=10
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=110
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=50
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=50
G=18 l=0 d=10
G=18 l=1 d=20
G=18 l=0 d=25
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=155
G=18 l=0 d=10
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=90
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=50
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=60
G=18 l=0 d=5
G=18 l=1 d=45
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=5
G=18 l=1 d=50
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=60
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=10
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=50
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=35
G=18 l=0 d=5
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=35
G=18 l=0 d=5
G=18 l=1 d=25
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=5
G=18 l=1 d=40
G=18 l=0 d=5
G=18 l=1 d=40
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=50
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=25
G=18 l=0 d=10
G=18 l=1 d=55
G=18 l=0 d=10
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=80
G=18 l=0 d=5
G=18 l=1 d=35
G=18 l=0 d=5
G=18 l=1 d=50
G=18 l=0 d=5
G=18 l=1 d=115
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=45
G=18 l=0 d=5
G=18 l=1 d=105
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=70
G=18 l=0 d=5
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=170
G=18 l=0 d=5
G=18 l=1 d=50
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=50
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=10
G=18 l=1 d=25
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=95
G=18 l=0 d=5
G=18 l=1 d=100
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=115
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=35
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=60
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=110
G=18 l=0 d=10
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=40
G=18 l=0 d=5
G=18 l=1 d=110
G=18 l=0 d=5
G=18 l=1 d=70
G=18 l=0 d=5
G=18 l=1 d=80
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=95
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=125
G=18 l=0 d=5
G=18 l=1 d=25
G=18 l=0 d=5
G=18 l=1 d=190
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=16 l=0 d=10085
G=25 l=0 d=10090
G=16 l=1 d=30
G=25 l=1 d=10
G=16 l=0 d=5
G=25 l=0 d=5
G=16 l=1 d=10
G=25 l=1 d=10
G=16 l=0 d=5
G=25 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=24 l=0 d=10125
G=24 l=1 d=5
G=18 l=1 d=55
G=24 l=0 d=5
G=18 l=0 d=5
G=24 l=1 d=5
G=24 l=0 d=10
G=24 l=1 d=25
G=24 l=0 d=5
G=18 l=1 d=130
G=18 l=0 d=5
G=12 l=0 d=10235
G=13 l=0 d=10220
G=12 l=1 d=15
G=13 l=1 d=15
G=12 l=0 d=5
G=13 l=0 d=5
G=18 l=1 d=50
G=18 l=0 d=5
G=18 l=1 d=100
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=40
G=18 l=0 d=30
G=18 l=1 d=5
G=18 l=0 d=10
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=155
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=55
G=18 l=0 d=5
G=18 l=1 d=60
G=18 l=0 d=5
G=18 l=1 d=55
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=75
G=18 l=0 d=5
G=18 l=1 d=40
G=18 l=0 d=5
G=18 l=1 d=185
G=18 l=0 d=10
G=18 l=1 d=155
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=75
G=18 l=0 d=5
G=18 l=1 d=75
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=35
G=18 l=0 d=5
G=18 l=1 d=60
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=165
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=155
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=105
G=18 l=0 d=5
G=18 l=1 d=80
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=10
G=18 l=1 d=115
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=100
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=140
G=18 l=0 d=5
G=18 l=1 d=45
G=18 l=0 d=5
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=40
G=18 l=0 d=5
G=18 l=1 d=145
G=18 l=0 d=5
G=18 l=1 d=225
G=18 l=0 d=5
G=18 l=1 d=60
G=18 l=0 d=5
G=18 l=1 d=55
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=55
G=18 l=0 d=5
G=18 l=1 d=25
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=155
G=18 l=0 d=5
G=18 l=1 d=25
G=18 l=0 d=10
G=18 l=1 d=155
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=60
G=18 l=0 d=5
G=18 l=1 d=100
G=18 l=0 d=5
G=18 l=1 d=80
G=18 l=0 d=5
G=18 l=1 d=35
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=171
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=4
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=10
G=18 l=1 d=150
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=155
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=5
G=18 l=1 d=50
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=40
G=18 l=0 d=5
G=18 l=1 d=145
G=18 l=0 d=5
G=18 l=1 d=155
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=190
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=25
G=18 l=0 d=5
G=18 l=1 d=35
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=155
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=190
G=18 l=0 d=5
G=18 l=1 d=155
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=5
G=16 l=1 d=9875
G=25 l=1 d=9875
G=25 l=0 d=5
G=25 l=1 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=24 l=1 d=9765
G=24 l=0 d=5
G=24 l=1 d=10
G=24 l=0 d=5
G=18 l=1 d=30
G=24 l=1 d=10
G=18 l=0 d=5
G=24 l=0 d=10
G=24 l=1 d=5
G=12 l=1 d=9745
G=13 l=1 d=9755
G=18 l=1 d=350
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=190
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=10
G=18 l=1 d=40
G=18 l=0 d=5
G=18 l=1 d=40
G=18 l=0 d=10
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=95
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=10
G=18 l=1 d=50
G=18 l=0 d=5
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=155
G=18 l=0 d=5
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=60
G=18 l=0 d=5
G=18 l=1 d=40
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=70
G=18 l=0 d=5
G=18 l=1 d=45
G=18 l=0 d=5
G=18 l=1 d=135
G=18 l=0 d=5
G=18 l=1 d=50
G=18 l=0 d=5
G=18 l=1 d=25
G=18 l=0 d=5
G=18 l=1 d=125
G=18 l=0 d=10
G=18 l=1 d=25
G=18 l=0 d=10
G=18 l=1 d=25
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=190
G=18 l=0 d=5
G=18 l=1 d=25
G=18 l=0 d=5
G=18 l=1 d=125
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=50
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=5
G=18 l=1 d=115
G=18 l=0 d=10
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=155
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=155
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=40
G=18 l=0 d=5
G=18 l=1 d=110
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=35
G=18 l=0 d=5
G=18 l=1 d=80
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=66
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=25
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=64
G=18 l=0 d=5
G=18 l=1 d=90
G=18 l=0 d=5
G=18 l=1 d=25
G=18 l=0 d=5
G=18 l=1 d=180
G=18 l=0 d=5
G=18 l=1 d=40
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=155
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=315
G=18 l=0 d=5
G=18 l=1 d=135
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=190
G=18 l=0 d=5
G=18 l=1 d=190
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=55
G=18 l=0 d=5
G=18 l=1 d=60
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=150
G=18 l=0 d=10
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=145
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=60
G=18 l=0 d=5
G=18 l=1 d=35
G=18 l=0 d=5
G=18 l=1 d=145
G=18 l=0 d=5
G=18 l=1 d=75
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=35
G=18 l=0 d=5
G=18 l=1 d=80
G=18 l=0 d=5
G=18 l=1 d=165
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=191
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=84
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=155
G=18 l=0 d=5
G=18 l=1 d=155
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=100
G=18 l=0 d=5
G=18 l=1 d=190
G=18 l=0 d=5
G=18 l=1 d=140
G=18 l=0 d=5
G=18 l=1 d=45
G=18 l=0 d=5
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=40
G=18 l=0 d=5
G=18 l=1 d=35
G=18 l=0 d=5
G=18 l=1 d=105
G=18 l=0 d=5
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=60
G=18 l=0 d=5
G=18 l=1 d=90
G=18 l=0 d=5
G=18 l=1 d=90
G=18 l=0 d=5
G=18 l=1 d=60
G=18 l=0 d=5
G=18 l=1 d=185
G=18 l=0 d=10
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=40
G=18 l=0 d=5
G=16 l=0 d=10060
G=16 l=1 d=10
G=16 l=0 d=5
G=25 l=0 d=10070
G=16 l=1 d=15
G=25 l=1 d=10
G=16 l=0 d=5
G=25 l=0 d=10
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=24 l=0 d=10145
G=18 l=1 d=45
G=18 l=0 d=5
G=18 l=1 d=70
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=12 l=0 d=10210
G=12 l=1 d=5
G=12 l=0 d=5
G=13 l=0 d=10210
G=13 l=1 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=13 l=0 d=20
G=12 l=1 d=30
G=13 l=1 d=5
G=12 l=0 d=5
G=13 l=0 d=5
G=13 l=1 d=10
G=13 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=135
G=18 l=0 d=5
G=18 l=1 d=15
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=10
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=10
G=18 l=1 d=25
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=155
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=95
G=18 l=0 d=5
G=18 l=1 d=80
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=10
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=85
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=5
G=18 l=1 d=50
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=20
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=10
G=18 l=0 d=10
G=18 l=1 d=170
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
G=18 l=1 d=110
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=5
G=18 l=1 d=50
G=18 l=0 d=5
G=18 l=1 d=105
G=18 l=0 d=5
G=18 l=1 d=80
G=18 l=0 d=10
G=18 l=1 d=185
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=190
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=190
G=18 l=0 d=5
G=18 l=1 d=190
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=155
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=190
G=18 l=0 d=5
G=18 l=1 d=155
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=155
G=18 l=0 d=5
G=18 l=1 d=155
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=155
G=18 l=0 d=5
G=18 l=1 d=155
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=105
G=18 l=0 d=5
G=18 l=1 d=10
G=18 l=0 d=5
G=18 l=1 d=65
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=155
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=120
G=18 l=0 d=5
G=18 l=1 d=30
G=18 l=0 d=5
G=18 l=1 d=145
G=18 l=0 d=5
G=18 l=1 d=5
G=18 l=0 d=5
[...]
 New contributor
  • I wouldn’t expect that problem with the set up as described. Could we have a clear photo showing the connections to the Pi? – joan 2 days ago
  • I’ve removed the GPIO protection resistors since they aren’t mandatory and make the setup clearer on the pictures – Sébastien 2 days ago
  • Sorry I’m not familiar with pigpiod, I’ve installed it via sudo apt install pigpiodand running via sudo pigpiod. Trying to run the script tells me ImportError: No module named pigpio. Is there any additional package to install? I can’t see on PyPl any python module called pigpio only apigpio but I’m assuming that this is totally different? – Sébastien 2 days ago
  • I’m running Raspbian Lite, if I ps -auxI can see root 2400 6.3 0.1 9976 1632 ? SLsl 04:07 0:12 pigpiod but then when I try python monitor.pyI have Traceback (most recent call last): File "monitor.py", line 12, in <module> import pigpio ImportError: No module named pigpio If I try sudo pigpiodagain I have 2019-10-17 05:49:58 initInitialise: Can't lock /var/run/pigpio.pid Can't initialise pigpio library – Sébastien 2 days ago
  • You can say which GPIO to monitor. In this case the switches so run as ./monitor.py 12 13 16 24 25 – joan yesterday
  • Ok I’ve updated the output on my post, should I run monitor.py while my other python script is running? I don’t really understand the output. There is a lot of things going, I don’t know if I was supposed to get outputs only when a button is being pressed ? – Sébastien yesterday
  • Ok the output I was getting was because I run monitor.py without my script in the background. Now I’m waiting for a false trigger. I’ve also added more ground pin on my breadboard – Sébastien yesterday
  • I’ve updated the output with my script running in background and monitor.py is showing me that GPIO18 is set to high quite often… – Sébastien yesterday
  • Yes of course sorry I mistyped 18 instead of 16 on the command line – Sébastien yesterday
  • I’m letting my script running to see if I still have more ghost triggering but meanwhile I’m testing something else: When I tickle the USB port of mi Pi with a piece of wire (not shorting anything just touching the USB / Ethernet housing) and the other end of the wire in my hand, I manage to trigger my event on my script, but monitor.py doesn’t show anything… Any thought? – Sébastien yesterday
  • monitor.py uses pigpio callbacks which use (by default) 5µs sampling. If the triggering event was shorter than 5µs it would not always be detected. RPi.GPIO uses Linux interrupt edge triggering which means it will see an event even if it only lasts a few nanoseconds. Th bouncetime setting doesn’t help as that simply ignores any further events in the bouncetime period. – joan yesterday
  • I’ve left my script running all day and I had 2 false trigger (each time I have a false trigger nearly all button events are triggered at the same time) but nothing was detected by monitor.py. I’m considering changing my python script to use pigpio since apparently it’s more reliable. Is there a straight way and painless way to transition my script to pigpio? – Sébastien yesterday
  • Unless you are planning to do a lot more GPIO work I’d stick to RPi.GPIO. It is better suited to your particular task. – joan yesterday

0

To mitigate against unwanted events I suggest you use code similar to the following. Basically read the level of the GPIO in the callback to verify it is not a short term transient.

#!/usr/bin/env python

import time
import signal
import os
import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BCM)

buttons=[24, 25, 13, 12, 16]

def cb_buttons(channel):
   if GPIO.input(channel) == 0:
      btn = buttons.index(channel) + 1
      print("Button {} pressed".format(btn))

class GracefulExit:
    kill_now = False
    def __init__(self):
        signal.signal(signal.SIGINT, self.exit_gracefully)
        signal.signal(signal.SIGTERM, self.exit_gracefully)

    def exit_gracefully(self,signum, frame):
        self.kill_now = True

for btn in buttons:
   GPIO.setup(btn, GPIO.IN, pull_up_down=GPIO.PUD_UP)
   GPIO.add_event_detect(btn, GPIO.FALLING, callback=cb_buttons)

def main():
    app_killer = GracefulExit()
    while not app_killer.kill_now:
        try:
            time.sleep(0.5)
        except BaseException:
            GPIO.cleanup()
            print "Encountered an axeption."
            break
    print "End of the program."
    GPIO.cleanup()

if __name__ == '__main__':
    main()

  • I’m letting the script running, I can’t manage to get the event to trigger accidentally now when I’m inserting an USB thumb drive, that’s already a win there – Sébastien 14 hours ago
  • @Sébastien, Ah, let me see. Your project is interesting and can be divided into two parts: (A) Amplifier, (B) Push button control. Your problem now is in on the push button part: (1) False triggering when pushing button. Your push button hardware looks OK. To troubleshoot, you may like to try any simple 30 minutes tutorial to compare and contrast what goes wrong. I will recommend newbie friendly tutorials next comment. / to continue, … – tlfong01 21 mins ago   
  • @Sébastien, these are the three newbie friendly tutorials I recommend: (1) Rpi Push Button 30 minutes Quick Project, Beginner Level, Full instructions provided – Hardik Rathod, hackster.io, Published 2017may14, hackster.io/hardikrathod/push-button-with-raspberry-pi-6b6928, (2) Rpi GPIO push button project – Soren 2018feb08, raspberrypihq.com/use-a-push-button-with-raspberry-pi-gpio (3) Rpi DIY DIY Push Button Project – Ian Buckley 2018aug29, makeuseof.com/tag/add-button-raspberry-pi-project – tlfong01 19 mins ago   
  • @Sébastien, This weekend I happen to be testing my Rpi4B buster Thonny python, with push buttons controlling a 20W power amp system. If you would like to try the tutorial of (3) above, I can do pair programming/development with you, and go slowly step by step, sharing newbie experience and troubleshooting techniques. Cheers. – tlfong01 15 mins ago   

Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: