Kodi Community Forum

Full Version: GPIO Monitor (Raspberry Pi)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

  • Monitor multiple GPIO buttons on your Raspberry Pi
  • Run KODI function(s) when that button is pressed, released or held
  • Supports LibreELEC / OSMC / Xbian on all Raspberry Pi boards

Install Instructions
You are producing a lot of stuff lately Matt. Kudos.
Have just updated this add-on to now allow multiple buttons and functions (separate with | pipe)
It also now can handle Pressed, Released & Held as it uses GPIO Zero behind the scenes.

thank you for this wonderful addon!
Thus i have two questions.

1.I have assigned  GPIO pin 26, when pressed, it should play video from specific folder and after video is finished playing it should show specific image in specified folder.

I tried like this : PlayMedia(path)|ShowPicture(path)

When i press the GPIO 26, the video does not play, instead it directly goes to Show picture. Where am i going wrong?

2. On GPIO pin 13  when I assign SlideShow(path) when pressed and then when i press GPIO 26  (for playing video) the video does not start. It stays on SlideShow..

Can you give me some directions what am i doing wrong? 

Try editing this file / line on your install:

Change that line to xbmc.executebuiltin(function.strip(), True)
Then restart kodi and try again

Have just pushed v0.1.6 which does the above.
So update to this and try. 

If that doesnt work, you want to check if PlayMedia in Kodi and actually blocks until the video is finished.
If it doesn't block, then ShowPicture will be getting called straight after the video starts

Youll need to look into the kodi built-in commands more
GPIO Monitor simple calls what you have put - doesnt do anything more fancy than that

Or, failing that - write your own script to do what you need and then make GPIO monitor call that script on button press