Raspberry Pi Carputer 2 – XBMC Skin & Scripts

BY IN Raspberry Pi, Uncategorized 4 COMMENTS

This post has been a long time coming. In fact, so long that I no longer have the Zafira that I installed the carputer in. But I still have all the code and workings out burning a hole in my hard drive, and questions keep coming in asking how it was all done. So I’ll try to explain a little more and put some code up.

If you want to skip my explanations and go straight to the code, I’ve put various bits on Github:

Getting data into XBMC

One of the biggest challenges with using XBMC as a display is getting the data from GPIO and from your OBD bluetooth chip onto XBMC’s display. For this I wrote a couple of services, based on an album info-finding script, to set and get properties on a particular window of the skin. In my application, the service starts on load of the ‘Home’ window. This is the window that I adapted to show various data. I kept the music and volume data so that this Home window is what you’ll nearly always be looking at.

Running the script is as simple as:

<onload>Runscript(script.OBD, backend=true))</onload>

for the OBD script.

<onload>Runscript(script.GPIO, backend=true, ins=0, ins=1)</onload>

for the GPIO script – notice the ‘ins’ passed to it; this tells the script to set these particular GPIO pins to IN and keep the skin property up-to-date.

I chose to use the ‘gpio’ command and run it with os.system call from python for compatibility – this command can be run as a normal user once it’s set up, if I remember correctly. And while it doesn’t monitor the IN pins as an interrupt, the service checks every 1/2 a second so for the purpose of illuminating lights on the screen (making bits visible) it’s fine.

Toggling GPIO

<code><onfocus>SetProperty(GPIOon, 17)</onfocus>
<onunfocus>SetProperty(GPIOoff, 17)</onunfocus>

should do it. Notice this sets a property on the skin. The GPIO script has this little bit of code in its loop that checks those properties:

if xbmc.getCondVisibility("!IsEmpty(Window(home).Property(GPIOon))"):

Displaying data

For simple on/off values, as you’ll get from the GPIO script, you’ll probably want to make an image or a control group visible or not:

<visible>SubString(Window(home).Property(GPIO0), "0")</visible>

For other values, here’s an example of what I used for the OBD info:

<!-- OBD Stuff -->
<control type="group" id="77">
<visible>SubString(Window(home).Property(OBD-Conn), "OK")</visible>



<label>ACC ped</label>


<control type="fadelabel" id="95">
<label>Trip: 0 mi</label>
<info>Window(home).Property(OBD-AvMPG),Av:, mpg</info>
<info>Window(home).Property(OBD-TripL),T: , L</info>
<info>Window(home).Property(OBD-TripP),T: ,p</info>
<info>Window(home).Property(OBD-TripMi),T: , Mi</info>
<control id="671">


There are a few good examples there.

  • Firstly, the whole group doesn’t function if OBD is not connected.
  • Second, notice the formatting on the <info> tags – <info>[value],PREFIX,SUFFIX</info>
  • And notice the TL-AvMPG section: It cycles through a few properties, changing every 5s.
  • Then the ThrottleProgressbar is a progress bar with distinct texture .png images. I just used the ‘mid’ texture and the reveal tag, to make it more natural.

I regret not having taken more videos of this but this video shows how the progress bars work.

The skin

The  XBMC-Skin.seventft skin was originally made by a German guy named djtoll. It’s an awesome skin and some serious work has gone into it. When I found it, it wasn’t compatible with XBMC / Kodi version 12 and up, since they changed the way things work. My github version is one that I’ve made work with XBMC 12+, but only for my particular needs. It will only work at PAL16x9 resolution, because that’s what I used. And the progress bar images, etc. that I added are only in that resolution.

Pull requests welcome!

I’ve seen this said many times about open source projects, and I’m trying to learn what it means. Yes, I’m new to github and all that but it would be great if this project got better and compatible with more cars now the source it out there.

If you use the seventft skin in another resolution, and add compatibility, please try to merge your changes in. It would be great to see my work our work benefit other people.


  1. Uwe Fischer |

    hello I like very much .
    I would like to have it also . Would it put together for me ? Have a Subaru Legacy wagon 2005
    Best Regards Uwe

  2. ian mattless |

    Hi i have a 2005 mk5 astra i would like to try this on! i was just wondering if you had any instructions on how to actually load this code on to the RPi, i already have one installed in the car (Running OSMC )and I have the ELM 327 OBD2II interface adapter. any instructions on how to install and run this code would be great

  3. Martin |

    Hi, did you get the Boost Pressure sensor working and displaying data ?

  4. Antony Nikrooz |

    Hi yes, you can see it in action in this incredibly shaky video https://youtu.be/MPohQJgiQ0s – the horizontal bar at the bottom corresponds to the reading
    Looking at my python code (See on Github) the boost pressure is byte 22 of the 2101 request
    I used the following line to get a percentage for the bar:
    boostPerc = int(int(self.window.getProperty(“OBD-BoostPress”))-int(self.window.getProperty(“OBD-BoostPress”))/20)

So, what do you think ?