Kodi Community Forum

Full Version: Start RetroPie from KODI
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi!

This might also belong to the retropie forum, however I made good experiences here, so I try it here again Smile

On my Raspberry Pi 3 I have Raspian, KODI 16 (from pipplware) and RetroPie (manual installation) installed.

With some help from this forum I managed to write a script that launches RetroPie from KODI.

The script looks like this:
Code:
# addon.py

import xbmc
import xbmcgui

System.Exec("/usr/local/bin/startscript.sh")

# ===========

# /usr/local/bin/startscript.sh

#!/bin/bash

# quit kodi
sudo /bin/systemctl stop kodi

# wait (if necessary)
# sleep 3

# start emulationstation
sudo -u retropie /usr/bin/emulationstation

# wait again (if necessary)
# sleep 3

# start kodi again
sudo /bin/systemctl start kodi

As you can see, this script quits KODI and starts emulationstation as user "retropie". When retropie quits, KODI is started again.

The process of starting emulationstation and restarting KODI afterwards works very well so far.

However, there is one big problem left:
I cannot start games from within emulationstation. Whenever I choose a ROM, I would see Raspbians login screen for a moment and afterwards the ROM selection screen again. The logs don't mention any of this.

When I just login as user retropie and start emulationstation, everything works well. So it really seems to be an issue with my start script. Can you help me to fix that?

Thank you!
I'm not good with python so I can't comment on that. But if you start with emulation station and install kodi , its pretty much already set up for you.
Thanks for your reply!

Well, that would be a backup solution. However, apart from that my system is running quite well and I don't want to break it...

Therefore I really would like to solve it like that.
In RetroPie 4.0, Kodi moved from experimental to optional package. It's an alternative if you could install if from scratch. In RetroPie it's also possible to boot into Kodi and go to EmulationStation upon exiting it, but I don't remember how.
hm. maybe I should really try that...

but still I wonder where my mistake is.