I have a python system script with various functions. I have multiple buttons hooked up to the Pi and I am using this code:
import RPi.GPIO as GPIO
GPIO.setup(22, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.add_event_detect(22, GPIO.RISING, callback=manual_fill_pool)
What I want to be able to do is trigger this like this (from the command line)
/usr/local/bin/gpio -g write 22 0
But it does not work, I have tried both 0 and 1 and neither seems to trigger the event detection. I have tried RISING, FALLING, BOTH, GPIO.PUD_UP, DOWN...nothing seems to work.
I am basically looking for a way to programmatically trigger the event detection instead of using a switch.
Am I thinking about this the wrong way? Is the only way to trigger an event detection event to use a physical switch?
I should add that this is a RPi3, and that there are no wires connected to the pin at all, and that I am not local to the Pi to connect wires for testing. This is running my pool control system so running back and forth to my pool equipment room is not an easy way to test so I was hoping to be able to do it in software!