Return to Home Page

BMW E39-RPi Homebrew Navigation System

e39-rpi running in my car

The PCB I designed

Motivation

I wanted to:

Some day I’d like to:

Timeline

I started working on this project in September 2020.

The initial Kotlin/Jetpack Compose work was done in early 2021. By spring 2021 I had the UI responding to knob turn events. In June 2021, I wrote the map view. By August 2021, I finished the keyboard. Much of the Jetpack Compose UI was wrapped up by the end of 2021.

In February 2022, I focused on getting the RPi to output the right kind of video to the BMW display. I spent over 100 hours in February 2022 getting the VGA timing just right.

At the end of 2022 I expanded the scope of the project to add a Pi Pico to the design to learn some C++ and to provide a reliable way to turn the device on/off in the car.

By the end of 2023, I had the Pico firmware mostly done.

In 2023-2024 I designed a bunch of test boards and the main-board. By mid-2024 I had finished up a working prototype of the mainboard.

In November 2024 - January 2025, I wrote a Matrix Chat Client for the car.

In Spring-Fall 2025, I documented the project.

Architecture

The e39-rpi project is made of several components.

It is a Rasberry Pi embedded Linux device running a Jetpack Compose for Desktop GUI on an X-server. The RPi is attached via GPIO, Power, and USB to a HAT that I designed.

It is designed to be wired into the e39 and make use of the existing displays and buttons.

Car Hardware

The diagram below shows how the e39-rpi board and some of its components work together.

E39-Rpi on a BMW IBus network

Software Architecture

High level

The Raspberry Pi runs an embedded linux distro that runs my HMI.

The Pi Pico runs a bare-metal firmware that I wrote called “Linster OS for Automotive”

Jetpack Compose HMI

The Jetpack Compose HMI is a desktop Linux app I wrote that runs on my development laptop as well as the RPi Raspbian image.

It interfaces with the hardware by:

The HMI uses the Compose MPP WindowManager hints to maximize itself without a titlebar on the RPI. On the dev laptop, it is convenient to work with alongside IntelliJ.

The HMI Window has screens managed by the navigator. When I started in 2021, there weren’t that many off-the-shelf screen navigation libraries to choose from, so I wrote my own.

I made my own widget design system that allows all the Compose UI to be controlled by the rotary knob on the BMW display.

Linster OS For Automotive (Pi Pico firmware)

The Raspberry Pi Pico firmware acts as a hardware controller for the Raspberry Pi in the car.

Functions:

Pico-Pi Private Message Protocol

The Pi and Pico send each other special messages over the same IBUS link, allowing the Pi to control the PICO hardware directly and set configured behaviour. The Pico can send messages to the Pi as well, to respond to configuration queries, warn the Pi of impending shutdowns, and send log messages.

Raspbian Firmware (RPi)

This is a prototype setup that needs some initial setup work to setup the HMI environment.

System Builder

Matthias Stone helped me out with this prototype image builder in late 2021.

What it does:

Development environment

The e39-Rpi HMI is very easy to develop. On the dev laptop, you can iterate quickly. When you want to deploy to the RPI, run piDeploy.sh which will:

I set up the Java Debug Wire Protocol flags on the RPi so that I could do remote JVM debugging on my laptop to the instance running on the RPi. This helped me chase after a couple of Pi-only timing bugs in the Matrix chat client.

Future Considerations

I’d like to someday:

Hardware Design

I designed a custom-board (e39-rpi-mainboard) that incorporates a series of building blocks that I all tested separately.

My hardware prototyping setup consists of:

  1. Development Laptop
  2. Development Laptop attached to car
  3. Test bench
  4. Development Laptop attached to test bench
  5. Test “sled”
  6. Test “sled” attached to my car
  7. e39-rpi-mainboard boards attached to the test bench
  8. e39-rpi-mainboard board attached to my car (production environment)

The software protoyping setup works by writing code on a PopOS laptop, which has a similar BlueZ/DBUS environment, allowing rapid local development.

Overview

Development Laptop (& attached to car)

This is where I started the project in September 2020.

Test bench

The test bench is where I started building the hardware for the project. It consists of an IKE instrument cluster, steering wheel buttons, BMBT screen, and wiring via terminal blocks for easy prototyping. I built this so that I didn’t have to sit in the car for extended periods of time writing code.

Wiring

I spent most of 2021-2022 fiddling with the test bench while the pandemic was going on. I made it L-shaped so that I could watch TV with it on my coffee table.

Test sled

I started building the sled after I realized I needed to miniaturize the design.

I needed a way for the RPi power to be turned off and on with the car, and I wanted to reduce the dependency on the European TV Tuner Module.

I build the sled as a precursor to the main-board. The sled contains all the test-boards that make up the main-board. I was able to test the sled in the car

Mainboard

I installed the main-board pictured at the top in a modified MK4 navigation case. The in-car installation is rather tidy.

e39-Rpi as installed in the trunk

GitHub Links

ToC

Sitemap (Table of Contents)

Return to Top