After trying seemingly every solution, using this python xbmc json module did the trick! Not quite a key press, but controls xbmc as if it were
https://github.com/jcsaaddupuy/python-xbmc
this is the code I modified to get GPIO input to trigger events in XBMC
import RPi.GPIO as GPIO
from xbmcjson import XBMC
xbmc = XBMC("http://127.0.0.1/jsonrpc")
GPIO.setmode(GPIO.BCM)
GPIO.setup(23, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(24, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
def my_callback2(channel):
global XBMC
xbmc.Input.Select()
GPIO.add_event_detect(23, GPIO.FALLING, callback=my_callback2, bouncetime=300)
if __name__ == "__main__":
try:
print "Waiting for rising edge on port 24"
GPIO.wait_for_edge(24, GPIO.RISING)
print "Rising edge detected on port 24. Here endeth the third lesson."
except KeyboardInterrupt:
GPIO.cleanup() # clean up GPIO on CTRL+C exit
GPIO.cleanup() # clean up GPIO on normal exit try: