Hi, I have made it (for NBT), but it's not a simple thing!
You'll have to jump through loops to achieve it and the result it's far from perfect (I'll explain why later).
First, you gotta be tech savy. If you're not, forget it (or find a friend who is).
This is not for the faint of heart, it will take a lot of time and knowledge to accomplish, so be patient
So here goes:
The Hardware...
You'll need:
- an IDrive controller (mind the part number, the one I used was
9286699). I bought mine on ebay, in perfect condition and it was a steal, it cost me 35€;
- a Particle Photon (I used one of these which I had laying around, but you can also use an Arduino of some sort, as long as it has CANBUS and USB interfaces, but I can't help with the arduino code, though I suspect it would work just the same). It will cost around 25€ on ebay;
- a CANBUS transceiver (I used a CJMCU-2551). It will cost around 10€ (or less) on ebay;
- a 120ohm resistor (0.05€ anywhere);
- electrical wire (free if you already have some);
- a four pin connector for the iDrive;
- last, but not least, good soldering skills (youtube is your friend, don't forget your soldering paste).
Once you have all of these, you're more or less 10% of the way.
This is the simplified connection diagram:
Now, the software part.
I can provide the Particle Photon firmware code, but first you need a Particle account, which you must have if you own a Particle device.
You'll have to acess the Particle Web IDE and import the project I'll provide and then flash it to the Photon... PM me if you got this far
Then, you'll need to feed the iDrive controller 12v, you can get it from anywhere you want, I got mine from the lighter on the central console (I own a F20).
The Particle Photon itself will get juice from the USB OTG connected to the head unit (your head unit should have two USB plugs).
Then, you'll need an app that will translate the Particle Photon messages into input keyevents on the android unit. I developed one of these also, so feel free to ask for an apk.
In the end, everything works, but it's not perfect.
Due to my unit being an Android 9.0, I'm extremelly limited, even with a rooted unit (which by the way, you'll also have to root yours).
I had to resort to shell calls from the java code to accomplish key events which introduces some lag.
Opening apps is instant, like, when you press 'Media', 'Tel', 'Nav' and so on.
But, for example, the rotary is laggy (once you rotate, 500ms will pass to get a response on screen).
I'm now implementing profiles depending on the foreground app, meaning that rotary knob, button knob, knob left, right, up and down should perform differently, according to the foreground app.
I'll soon post a video showing how it's working.
Cheers!