A little help please. I'm sure this is basic electronics but nevertheless I need your help!
I fitted an OFF button on the Pi. I could not fit a "wake" as my GPO3 is being used.
I also have a two relays connected to GPO 20 and 21 (BCM).
I have selected GPI 27 for my shutdown routine. It works. However, as soon as I complete the wiring on my relay board, the shutdown routine is initiated. Vice versa, if I have the relay board connected first, as soon as I connect my button to GND and GPI27, the shutdown routine initiates.
The button is NO. I have measured with a meter and it reads infinite. I tried a different GPI, same result.
I am puzzled. Can you please help me?
Here is the code I'm using
Code: Select all
#!/usr/bin/env python
import RPi.GPIO as GPIO
import subprocess
GPIO.setmode(GPIO.BCM)
GPIO.setup(27, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.wait_for_edge(27, GPIO.FALLING)
subprocess.call(['shutdown', '-h', 'now'], shell=False)
Tony