EasyComp Zeeland
Posts: 20
Joined: Thu Jul 05, 2018 1:50 pm
Contact: Website

How to open navit from kodi?

Tue Jul 24, 2018 10:13 am

Hi there,

as I mentioned before in previous posts, I'm building a CarPI on Raspbian using Kodi and Navit;

as theme for kodi I use carpi, which has a navigation button to open navit from kodi, but what code do I need to insert to make it work and overlay kodi in the button it's settings?

It works fine but thats the last step!



Thanks

Rascas
Posts: 697
Joined: Tue Mar 11, 2014 6:18 pm
Location: Porto, Portugal
Contact: Website

Re: How to open navit from kodi?

Tue Jul 24, 2018 2:28 pm

Where did you download that skin? If it has a button to open Navit, I think it is better to ask directly to the respective skin developer.

EasyComp Zeeland
Posts: 20
Joined: Thu Jul 05, 2018 1:50 pm
Contact: Website

Re: How to open navit from kodi?

Tue Jul 24, 2018 4:21 pm

Rascas wrote:
Tue Jul 24, 2018 2:28 pm
Where did you download that skin? If it has a button to open Navit, I think it is better to ask directly to the respective skin developer.
just downloaded it somewhere from the internet. From someone who isn't the developer.

EasyComp Zeeland
Posts: 20
Joined: Thu Jul 05, 2018 1:50 pm
Contact: Website

Re: How to open navit from kodi?

Thu Jul 26, 2018 11:56 am

Still waiting for an answer?

User avatar
topguy
Posts: 6613
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: How to open navit from kodi?

Fri Jul 27, 2018 2:06 pm

but what code do I need to insert to make it work and overlay kodi in the button it's settings?
I'm not even sure how to read this sentence correctly.. can you expand a bit about exactly what setting you are talking about and what you mean with "code"..

Refering us to another (unlinked) thread for background info is not that polite either..

EasyComp Zeeland
Posts: 20
Joined: Thu Jul 05, 2018 1:50 pm
Contact: Website

Re: How to open navit from kodi?

Sun Jul 29, 2018 8:57 am

topguy wrote:
Fri Jul 27, 2018 2:06 pm
but what code do I need to insert to make it work and overlay kodi in the button it's settings?
I'm not even sure how to read this sentence correctly.. can you expand a bit about exactly what setting you are talking about and what you mean with "code"..

Refering us to another (unlinked) thread for background info is not that polite either..
I forgot to paste that url but I meant this post; viewtopic.php?f=73&t=217472&p=1346519#p1346519

here is some more info about the sentence you didn't quite get
What do I need to insert here (video) to make Navit run?!

https://easycompzeeland.nl/site/assets/ ... .53.49.mp4

Thanks!

User avatar
topguy
Posts: 6613
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: How to open navit from kodi?

Mon Jul 30, 2018 12:43 pm

Have you installed "navit" on the Pi ?

EasyComp Zeeland
Posts: 20
Joined: Thu Jul 05, 2018 1:50 pm
Contact: Website

Re: How to open navit from kodi?

Mon Jul 30, 2018 3:59 pm

topguy wrote:
Mon Jul 30, 2018 12:43 pm
Have you installed "navit" on the Pi ?
Yes and it works fine! but just doesn't open from kodi.

User avatar
topguy
Posts: 6613
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: How to open navit from kodi?

Tue Jul 31, 2018 1:48 pm

How would you start "navit" outside of Kodi ?

In a terminal if you write the command "which navit" you will probably get the response "/usr/bin/navit" or something similar which is the full path to the "navit" executable. You might try to enter that full path into the field in Kodi.

EasyComp Zeeland
Posts: 20
Joined: Thu Jul 05, 2018 1:50 pm
Contact: Website

Re: How to open navit from kodi?

Thu Aug 02, 2018 2:49 pm

topguy wrote:
Tue Jul 31, 2018 1:48 pm
How would you start "navit" outside of Kodi ?

In a terminal if you write the command "which navit" you will probably get the response "/usr/bin/navit" or something similar which is the full path to the "navit" executable. You might try to enter that full path into the field in Kodi.
I already tried that method but it doesn't work...

Rascas
Posts: 697
Joined: Tue Mar 11, 2014 6:18 pm
Location: Porto, Portugal
Contact: Website

Re: How to open navit from kodi?

Thu Aug 02, 2018 10:50 pm

EasyComp Zeeland wrote:
Thu Aug 02, 2018 2:49 pm
topguy wrote:
Tue Jul 31, 2018 1:48 pm
How would you start "navit" outside of Kodi ?

In a terminal if you write the command "which navit" you will probably get the response "/usr/bin/navit" or something similar which is the full path to the "navit" executable. You might try to enter that full path into the field in Kodi.
I already tried that method but it doesn't work...
Like I said above, I am not familiar with that skin and navit but I am pretty sure that you cannot run any other graphical program on the RPi while Kodi is running. Well, you can start it, but you will only see it when you exit Kodi.
So the script you are looking for must:
1- Exit Kodi
2- Start Navit
3- Start Kodi again when you exit Navit

If you contact the skin developer, he probably has or knows some script for that.

EasyComp Zeeland
Posts: 20
Joined: Thu Jul 05, 2018 1:50 pm
Contact: Website

Re: How to open navit from kodi?

Sat Aug 04, 2018 2:41 pm

Now I've created;

#######
import os
import xbmc

#activate GPS USB Dongle

os.system("sudo systemctl stop gpsd.socket")
os.system("sudo systemctl disable gpsd.socket")
os.system("sudo gpsd /dev/ttyUSB0 -F /var/run/gpsd.sock")

#open navit
os.system("navit")

#########

It works although how to minimize kodi so navit can be on top of it?

DirkS
Posts: 10389
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: How to open navit from kodi?

Sat Aug 04, 2018 3:46 pm

EasyComp Zeeland wrote:
Sat Aug 04, 2018 2:41 pm
It works although how to minimize kodi so navit can be on top of it?
Well, that's the problem as Rascas already identified.
Video output of Kodi on the Pi uses hardware acceleration and output is sent (more or less) directly to the hardware; it bypasses the framebuffer.
There's nothing to minimize. You would have to quit Kodi or maybe it's possible to 'switch off' Kodi output.

Rascas
Posts: 697
Joined: Tue Mar 11, 2014 6:18 pm
Location: Porto, Portugal
Contact: Website

Re: How to open navit from kodi?

Sat Aug 04, 2018 4:33 pm

EasyComp Zeeland wrote:
Sat Aug 04, 2018 2:41 pm
Now I've created;

#######
import os
import xbmc

#activate GPS USB Dongle

os.system("sudo systemctl stop gpsd.socket")
os.system("sudo systemctl disable gpsd.socket")
os.system("sudo gpsd /dev/ttyUSB0 -F /var/run/gpsd.sock")

#open navit
os.system("navit")

#########

It works although how to minimize kodi so navit can be on top of it?
You can't minimize Kodi, it is rendered in an overlay on the framebuffer. You have to close it and open it again when you exit navit.

EasyComp Zeeland
Posts: 20
Joined: Thu Jul 05, 2018 1:50 pm
Contact: Website

Re: How to open navit from kodi?

Sat Aug 04, 2018 5:34 pm

Rascas wrote:
Sat Aug 04, 2018 4:33 pm
EasyComp Zeeland wrote:
Sat Aug 04, 2018 2:41 pm
Now I've created;

#######
import os
import xbmc

#activate GPS USB Dongle

os.system("sudo systemctl stop gpsd.socket")
os.system("sudo systemctl disable gpsd.socket")
os.system("sudo gpsd /dev/ttyUSB0 -F /var/run/gpsd.sock")

#open navit
os.system("navit")

#########

It works although how to minimize kodi so navit can be on top of it?
You can't minimize Kodi, it is rendered in an overlay on the framebuffer. You have to close it and open it again when you exit navit.


Hmm, wondering if there is a workaround!

Rascas
Posts: 697
Joined: Tue Mar 11, 2014 6:18 pm
Location: Porto, Portugal
Contact: Website

Re: How to open navit from kodi?

Sun Aug 05, 2018 2:33 am

Try this:
-Create a bash script with the following:

Code: Select all

#!/bin/bash
sudo killall -9 kodi.bin
navit
kodi &
-Change the last line of your python script by this:

Code: Select all

os.system("bash /path/to/the/script/scriptname")
Other solution would be to compile Kodi yourself with support for X server and OpenGL, but it will be much slower and without video decoding acceleration.

EasyComp Zeeland
Posts: 20
Joined: Thu Jul 05, 2018 1:50 pm
Contact: Website

Re: How to open navit from kodi?

Sun Aug 05, 2018 6:50 pm

Rascas wrote:
Sun Aug 05, 2018 2:33 am
Try this:
-Create a bash script with the following:

Code: Select all

#!/bin/bash
sudo killall -9 kodi.bin
navit
kodi &
-Change the last line of your python script by this:

Code: Select all

os.system("bash /path/to/the/script/scriptname")
Other solution would be to compile Kodi yourself with support for X server and OpenGL, but it will be much slower and without video decoding acceleration.
I created this now it seems to do something at least, it doesn't kill kodi but It suddenly restarts kodi when I'll exit navit, I can control navit from vnc ;) not from my 7" pi screen which got kodi on it.

Code: Select all

#######
import os 
import xbmc

#activate GPS dongle
os.system("bash /home/pi/.kodi/addons/skin.CarPc-Carbon/scripts/ActiveerGPS.sh")

#run navit
os.system("navit")

#kill kodi and comeback when navit gets killed
os.system("bash /home/pi/.kodi/addons/skin.CarPc-Carbon/scripts/minimizekodi.sh")



#########
Main .py script

Code: Select all

sudo systemctl stop gpsd.socket
sudo systemctl disable gpsd.socket
sudo gpsd /dev/ttyUSB0 -F /var/run/gpsd.sock 
Code to activate GPS dongle - ActiveerGPS.sh

Code: Select all

#!/bin/bash
sudo killall -9 kodi.bin
navit
kodi &
Kill kodi and comeback script - Minimizekodi.sh

Rascas
Posts: 697
Joined: Tue Mar 11, 2014 6:18 pm
Location: Porto, Portugal
Contact: Website

Re: How to open navit from kodi?

Sun Aug 05, 2018 7:53 pm

If it is a RPi 2 or 3, it is:

Code: Select all

sudo killall kodi_v7.bin

EasyComp Zeeland
Posts: 20
Joined: Thu Jul 05, 2018 1:50 pm
Contact: Website

Re: How to open navit from kodi?

Mon Aug 06, 2018 9:52 am

Rascas wrote:
Sun Aug 05, 2018 7:53 pm
If it is a RPi 2 or 3, it is:

Code: Select all

sudo killall kodi_v7.bin
it seems completely ignored, kodi doesn't get killed..

Rascas
Posts: 697
Joined: Tue Mar 11, 2014 6:18 pm
Location: Porto, Portugal
Contact: Website

Re: How to open navit from kodi?

Mon Aug 06, 2018 10:06 am

EasyComp Zeeland wrote:
Mon Aug 06, 2018 9:52 am
Rascas wrote:
Sun Aug 05, 2018 7:53 pm
If it is a RPi 2 or 3, it is:

Code: Select all

sudo killall kodi_v7.bin
it seems completely ignored, kodi doesn't get killed..
Check the processes running with top or something. I can kill Kodi here just fine via ssh with that.

EasyComp Zeeland
Posts: 20
Joined: Thu Jul 05, 2018 1:50 pm
Contact: Website

Re: How to open navit from kodi?

Mon Aug 06, 2018 11:25 am

Rascas wrote:
Mon Aug 06, 2018 10:06 am
EasyComp Zeeland wrote:
Mon Aug 06, 2018 9:52 am
Rascas wrote:
Sun Aug 05, 2018 7:53 pm
If it is a RPi 2 or 3, it is:

Code: Select all

sudo killall kodi_v7.bin
it seems completely ignored, kodi doesn't get killed..
Check the processes running with top or something. I can kill Kodi here just fine via ssh with that.
Well I can kill it with ssh as well but the script doesn't seem to work..

EasyComp Zeeland
Posts: 20
Joined: Thu Jul 05, 2018 1:50 pm
Contact: Website

Re: How to open navit from kodi?

Mon Aug 13, 2018 5:27 pm

EasyComp Zeeland wrote:
Mon Aug 06, 2018 11:25 am
Rascas wrote:
Mon Aug 06, 2018 10:06 am
EasyComp Zeeland wrote:
Mon Aug 06, 2018 9:52 am


it seems completely ignored, kodi doesn't get killed..
Check the processes running with top or something. I can kill Kodi here just fine via ssh with that.
Well I can kill it with ssh as well but the script doesn't seem to work..
Any Response please?

Rascas
Posts: 697
Joined: Tue Mar 11, 2014 6:18 pm
Location: Porto, Portugal
Contact: Website

Re: How to open navit from kodi?

Mon Aug 13, 2018 5:47 pm

Try without -9, try to debug that by yourself, add some echos/printfs to a file, on both python and bash scripts, try to launch navit first and kill kodi after, I don't know... You already know what you have to do, try different approaches to do the same.

Rojit K Johncy
Posts: 1
Joined: Sat Oct 13, 2018 5:52 pm

Re: How to open navit from kodi?

Sat Oct 13, 2018 6:03 pm

EasyComp Zeeland wrote:
Sun Aug 05, 2018 6:50 pm
Rascas wrote:
Sun Aug 05, 2018 2:33 am
Try this:
-Create a bash script with the following:

Code: Select all

#!/bin/bash
sudo killall -9 kodi.bin
navit
kodi &
-Change the last line of your python script by this:

Code: Select all

os.system("bash /path/to/the/script/scriptname")
Other solution would be to compile Kodi yourself with support for X server and OpenGL, but it will be much slower and without video decoding acceleration.
I created this now it seems to do something at least, it doesn't kill kodi but It suddenly restarts kodi when I'll exit navit, I can control navit from vnc ;) not from my 7" pi screen which got kodi on it.

Code: Select all

#######
import os 
import xbmc

#activate GPS dongle
os.system("bash /home/pi/.kodi/addons/skin.CarPc-Carbon/scripts/ActiveerGPS.sh")

#run navit
os.system("navit")

#kill kodi and comeback when navit gets killed
os.system("bash /home/pi/.kodi/addons/skin.CarPc-Carbon/scripts/minimizekodi.sh")



#########
Main .py script

Code: Select all

sudo systemctl stop gpsd.socket
sudo systemctl disable gpsd.socket
sudo gpsd /dev/ttyUSB0 -F /var/run/gpsd.sock 
Code to activate GPS dongle - ActiveerGPS.sh

Code: Select all

#!/bin/bash
sudo killall -9 kodi.bin
navit
kodi &
Kill kodi and comeback script - Minimizekodi.sh
Hi,

I am very new to Raspberry Pi and Kodi. I need your help in getting called Navit from Kodi. Can you please provide step by step procedure how to call Navit from Kodi? The python script works fine from RPi terminal but i dont understand how i should call Navit from Kodi.. Need your help plss..

Return to “Beginners”