Skip to content

Latest commit

 

History

History
240 lines (206 loc) · 14.7 KB

README.md

File metadata and controls

240 lines (206 loc) · 14.7 KB

AVR-IBus
DIY Modul for BMW Cars with I-/K-Bus

Kickstart Description

In case of using the Raspberry in the car, there was a topic about the powersuply and long bootup time. Inspired by other Interfaces like pibus, Intravee, eLight, modLight i decided to develop a specific shield. After some time and some requestes the standalone Modul was born.

Modes

  • AVR Mode
    • Raspberry Shield or standalone Modul with GUI for OEM System
    • Using OSMC or LibreElec with the Addon IBusCommunicator for Kodi
  • IBus Interface Mode
    • you can use this DIY Modul as usual USB IBus-Interface also (e.g. for Android Radio Headunits with I-BUS App)
    • upload the other Firmware to get it working

Features

  • CD-Changer Emulation
  • Welcome Message on E39 IKE High
  • Welcome/Leaving Light depended by Brightness
  • Lightsequenzes for: *
  • Mirror Folding
    • unfold/fold for Welcome/Leaving
    • fold Mirrors by Ingintion Position Off *
    • unfold Mirrors by Ingintion Position On *
    • unfold Mirrors by double press Open on Remote *
    • fold Mirrors by double press Close on Remote *
    • fold Mirrors by hold Close on Remote *
    • unfold/fold by Key insert or remove of Ignition Lock *
    • unfold Mirrors by Door opening *
  • Flash to Pass
  • One Touch direction signal
  • Fog Corner Lights for E39
  • Day Running Light
  • Aux-Heating control by Remote Key
  • Brake Force Display (Coding of IKE requiered) *
  • Convertible Roof Control for E46 by Remote Key
  • Auto-Relock for Central Lock after Unlock and no door was opened
  • Auto-Zoom for Navigation Map by Speed
  • PDC Display at E39 IKE High *
  • OBC-Value Display at E39 IKE High [Coolanttemp, Speed, Oiltemp or Voltage] (under construction)
  • RearCam power control and enable Video input at TV-Modul
  • Configuration Options:
  • Cross platform Configuraton Tool (Windows, Linux, Mac)

*only V2

Versions

  • V1 RaspPi - Shield for Raspberry Pi

  • V2 RaspPi - Shield for Raspberry Pi

  • V2 Basic - Standalone Modul

Next Steps / ToDo

  • finish Android App for Configuration 40%
  • Extension for Bluetooth A2DP Audio Streaming (only for Basic) 30%
  • Request RLS for Welcome/Leaving 0%
  • may modify RCam-Control for other Solutions (e.g. Coolant Thermostat) 50%
  • Features like LinBusBox/IBusBox 20%
  • Feature Requests:
    • Move down Mirror for Parking
    • CAN-Bus Extension

Simple Basic Schematics

  • V1.x

  • V2.x

PCB

  • V1.x

Userinterface in the Car

For opening GUI of OEM BMW Infotaimentsystem:

  • do Double press MENU-Key of Bordscreen

  • do Double press BC-Key of MID

    (check the video)

Serial Communication

Port-Settings

show
AVR Mode IBus Mode
Baud: 38400 9600
DataBits: 8 8
Parity: None Even
StopBits: 1 1
Handshaking: None None

Settings / Serial-Protocol-Commands

show


Terminate the Commands with CR (Carrige Return).

No Setting / Command (Default) Value A Value B Description
TX:IBUSMESSAGE Send IBus Message to the Car. Length and/or Checksum are not requiered (example: TX:68LL18380000CK CD StateRequest)
PING Alive request. The Modul replies PONG
DIAG Request for DIAG Mode. The Modul replies DIAG Mode Level
DIAG:0 1=(partly
20full
Diag Mode for use with Diagsoftware like Inpa, to don't get a collision with diagnostic commands.
AV Request for AV PIN State. The Modul replies AV NTSC PIN state
AV:0 1=enable
0=disable
Sets NTSC Line for PIN 5 of Videomodul. If enabeled, you have to ping (every 10s reach out), otherwise the Modul disables the signal after 30sec timeout.
LIGHT Starts/Stops Welcome Light
CVM:OPEN Starts 30sec process for opening E46 convertible
CVM:CLOSE Starts 30sec process for closing E46 convertible
CVM:STOP Stops the opening or closing process for E46 convertible
SHUTDOWN Initiates Shutdown Process. Shuts down the Rasp/Powersuply (takes 60s for power down) the modul sends every second "SHUTDOWN" so the serial reader should shutdown itself.
GET:STS Request for all Setting Values
SET:RST Resets to Default Settings
01 SET:CDC_EMU:1 0=OFF
1=ON
Enable/Disable CD Changer Emulation
to get Radio Mode CD-Changer
as Input Source
16 SET:WEL:MSG:0 0=OFF
1=ON
Enable/Disable Welcome Message at IKE
Display after unlocking
the Car
40-59 SET:WEL:MSG_T:AVR�~IBus Set Text for Welcome Message. 20 chars
02
03
SET:WEL:LIGHT:45:0 0=OFF
1-255 Seconds
Bits:
0=Start Engine
1=Insert Key
2=Open Door
4=Ignition Acc (Pos 1)
A Welcome Light Duration in Seconds
B Event to Cancel the Welcome Light. Bitmask (76543210) to Integer.
04 SET:LEV:LIGHT:15 0=OFF
1-255 Seconds
Leaving Light Duration in Seconds
05
09
SET:MIR_FOLD:0 Bits for Folding & Event:
0=In Leaving
1=Out Welcome
2=In Ign Off *
3=Out IgnOn *
4=In FFB Double *
5=Out FFB Double *
6=In FFB Hold *
7=Out Open Door *
Bits for Folding & Event:
8=Key remove *
9=Key insert *
10=Engine Start *
Enable/Disable MirrorFolding for Events. Bitmask (109876543210) to Integer.
06 SET:LIGHT:SEN_VAL:40 0-254=Value
255=OFF
Enable/Disable Brightness Sensor for Welcome/Leaving Light.
Value for Comparing the Sensor. Lower Value needs
more darkness to turn on the Lights. Good Value range is 30 - 40.
07 SET:F2P:0 0=OFF
1=Low Beam
2=Fog Front
3=Both
4=Sequenz *
Enable/Disable Flash to Pass. Enabled Lights will turn on the by High Beam
08 SET:LIGHT:PARK:3 Bits:
0=Front
1=Back
2=Back (Inside)
Enable/Disable Park Lights for Welcome/Leaving Light.
Bitmask (76543210) to Integer
10 SET:LIGHT:BEAM:0 Bits:
0=Low
1=High
Enable/Disable Beam Lights for Welcome/Leaving Light.
Bitmask (76543210) to Integer
13 SET:LIGHT:TURN:0 Bits:
0=Front
1=Back
2=Side
Enable/Disable Direction Lights for Welcome/Leaving Light.
Some old build year can't use "Side" alone
Bitmask (76543210) to Integer
11 SET:LIGHT:OTHER:0 Bits:
0=Fog Front
1=Licence
2=Reverse
3=Brake
4=Ambient
5=Fog Back
Enable/Disable further Lights for Welcome/Leaving Light.
Bitmask (76543210) to Integer
17 SET:BLINK:3 0=OFF
2-10=Repeat
Enable/Disable one touch Direction Signal (Comfortblink).
Set repeat interval.
18 SET:LOCK_SPD:0 0=OFF
1-255km/h
Enable/Disable auto lock car by speed.
31 SET:UNLOCK:1 Bits:
0=Door
1=Handbrake
2=Gear Position P
3=Ignition Engine off
If Setting auto lock is enabled, do auto unlock the car by events.
Bitmask (76543210) to Integer
35 SET:RELOCK:0 0=OFF
1-255min
Enable/Disable auto relock the car after unlocking and no door was opened.
Minutes for auto relock (open Trunk restarts the Countdown)
(!! BE CAREFUL IF YOU PLACE YOUR KEY INSIDE THE CAR !!)
20 SET:RXTX:0 0=RX
1=TX
Enable/Disable received and transmitted IBus Messages.
Bitmask (76543210) to Integer
19
21
SET:FOG_TURN:60:3 0-255km/h 0=OFF
1-255s
A Speed Range to trigger the Event.
B Enable/Disable Fog Corner Lights for E39.
Seconds Delaytime for Fog Turn Light.Event is triggerd by Direction signal and park lights must be on.
If you reach the Speed or time is over, corner light will turn off.
22 SET:DRL:0 Bits:
0=Parklight
1=Fog Front
2=Taillight
Enable/Disable Day Running Light at Ignition Pos 2 and Lights Off.
Bitmask (76543210) to Integer
23 SET:NTWC:0 0=E39
1=E52
2=E46
3=R40
4=RR01
5=E83
6=R50
7=R55
8=E65
Define Network Vehicle Type.
Will be set automaticly.
24 SET:NTWM:0 0=ZKE
1=GM/0
2=GM/1
Define Network Mode.
For different Functions of production year.
25 SET:TIME_OFF:3 1-255min Timeout for Shutdown minutes on IBus idle.
26 SET:OBC_DISP:0 0=OFF
1=Coolanttemp.
2=Driving
Speed
3=Oiltemp.
Shows OBC Values on IKE High Display or E46 Radiodisplay in CD Mode.
27 SET:HEAT_FFB:0 0=OFF
1=ON
Enable/Disable Function Aux-Heat Activation by holding Remote Key Lock.
28 SET:CVM_FOLD:0 0=OFF
1=ON
Enable/Disable Function Convertible Roof Open/Close by holding Remote Key Unlock/Lock.
30 SET:BFD:0 0=OFF
1-7=Seconds
Enable Flashing Rear Turnlights for Emergency Brake.
Delaytime for flashing after BFD turned off in Seconds. (IKE Coding requiered)
// IKE & KOM (beginning Manufäcturing Year 2001, better 09/2001) //
BRAKE_FORCE
aktiv
BRAKE_FORCE_2
aktiv
ASC3_AUSWERTUNG
aktiv
BFD_AX_REF_SCHWELLE
wert_01
BFD_AX_REF_SCHWELLE_2
wert_01
32
33
SET:RCAM:0:15 0=OFF
1-255km/h
15s A Enable/Disable RCam Switch. Speedlimit for turning off RCam.
B Timeout for turning off RCam in Seconds.
36 SET:NAVZ:0 0=OFF
1=ON
Enable/Disable AutoZoom for Navigation Map.
37 SET:PDCSCR:0 0=OFF
1=Front+Back
2=Back
Enable/Disable PDC Values to IKE High Display and PDC Type.
38 SET:REQS:255 Bits:
0=GM State
1=LCM Dim
Enable (Bit to 1)/Disable (Bit to 0) Request Messages. In some Cases the IKE will stop showing Indicator LEDs.
Bitmask (76543210) to Integer
Setting / Command Value A Value B Value C Value D Description
SET:A:SEQ:B:C:D WEL=Welcome
LEV=Leaving
FOL=Follow Home
F2P=Flash to pass
Set Light Sequenzes (use Excel Tool to generate the command)
It's not possible to set Light Sequenzes in OEM Gui, only enabling or disabling. For Creating, uploading and simulating of Sequenzes use the Excel Macro helper tool.
A Event
B Sequenz Number
C Lights as Integer
D Duration Time (1 = 0,1s)

IBus MSGs for IBus Interface Mode

show

SRC or Dst FB is config device FA is AVR IBUS device

CMD
08 read setting
09 write setting
0C control (00 reset Settings, 01 set ntsc high or low)
Example:
FB LL FA 08 01 CK - read setting CDC_EMU
FB LL FA 09 01 00 CK - write setting CDC_EMU = off

FB 05 FA 09 05 03 0B Mirror Fold IN+OUT
FB 05 FA 09 05 00 08 Mirror Fold OFF

Setup for Raspberry

show
  • add to config.txt
    • dtoverlay=pi3-miniuart-bt to get GPIO Serialport working
    • dtoverlay=hifiberry-dac to enable I2S for Hifi DAC
  • in some cases you have to set volume to 80%
  • in Raspbian use Serial Device: /dev/ttyAMA0
  • for IBusCommunicator Kodi Addon:
    • in Topic Main set Serial Device to CUSTOM and define custom device for /dev/ttyAMA0

    • in Topic I/O-Boards: Enable Arduino

Development Steps for RaspPi Shield

show
  • Breadboard

  • Prototyp

  • PCB V1.0


  • PCB V1.0 with HifiDAC

3rd Party

used Librarys:

  • Arduino
  • AltSoftSerial
  • SimpleTimer
  • EEPROM

All mentioned brands and trademarks (e.g. product and company names) belong to their respective owners.

Disclaimer

Use of the hardware / software is at your own risk. In the unlikely event that it comes to malfunction, personal injury or property damage, no liability is assumed. Some functions may not be allowed on public roads!

Donation

If you like my project and want to support me, feel free for a donation.