Current version of the OpenAuto Pro is 12
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Controller service
#1
Information 
Controller service is a service that translates input from various devices (like rotary encoders, MMI 2G panel, GPIO pins, etc.) to the key strokes. One controller service instance can handle one input device at a time. It is possible to run many instances of controller service. First (and the only) argument of controller service is a path to the configuration file.

Example command for controller service execution:
controller_service /home/pi/.openauto/config/openauto_controller_service.ini

Using /etc/xdg/lxsession/LXDE-pi/autostart file you can start instances of controller service automatically after startup of the system. Below please find configuration of the controller service for particular input device:
#2
Rotary encoder:
[Controller]
; Type of the input device
; 1 - Audi MMI 2G panel
; 2 - BMW iDrive Gen 1 controller
; 3 - BMW IBUS
; 4 - Audi RNSE
; 5 - Rotary Encoder
; 6 - GPIO
Type=5

[RotaryEncoder]
; GPIO pin number connected to the SIA/DT pin of the encoder
; For most rotary encoders you can control direction of the rotation by swapping SIA/DT abd SIB/CLK pins.
SiaPinNumber=16

; GPIO pin number connected to the the SIB/CLK pin of the encoder
; For most rotary encoders you can control direction of the rotation by swapping SIB/CLK and SIA/DT pins.
SibPinNumber=20

; GPIO pin number connected to the the SW pin of the encoder
SwPinNumber=21

; Key stroke that will be simulated after left rotation detection
LeftKeyStrokes=V

; Key stroke that will be simulated after right rotation detection
RightKeyStrokes=N

; Key stroke that will be simulated after press detection
SwitchKeyStrokes=B


Example of media knob configuration:
[Controller]
Type=5

[RotaryEncoder]
SiaPinNumber=16
SibPinNumber=20
SwPinNumber=21
LeftKeyStrokes=V
RightKeyStrokes=N
SwitchKeyStrokes=B

Example of volume knob configuration:
[Controller]
Type=5

[RotaryEncoder]
SiaPinNumber=25
SibPinNumber=24
SwPinNumber=12
LeftKeyStrokes=F7
RightKeyStrokes=F8
SwitchKeyStrokes=Ctrl+F11
#3
GPIO:
[Controller]
; Type of the input device
; 1 - Audi MMI 2G panel
; 2 - BMW iDrive Gen 1 controller
; 3 - BMW IBUS
; 4 - Audi RNSE
; 5 - Rotary Encoder
; 6 - GPIO
Type=6

; Transition from LOW to HIGH state simulates key press, transition from HIGH to LOW state simulates key release.
[GpioButtons]
; Number of configured GPIO pins
Count=3

; Number of 1st GPIO pin
Button_0_Pin=22

; Key stroke to simulate for 1st GPIO pin
Button_0_Key=F8

; Number of 2nd GPIO pin
Button_1_Pin=23

; Key stroke to simulate for 2nd GPIO pin
Button_1_Key=F7

; Number of 3rd GPIO pin
Button_2_Pin=16

; Key stroke to simulate for 3rd GPIO pin
Button_2_Key=N
#4
Audi MMI 2G panel:
[Controller]
; Type of the input device
; 1 - Audi MMI 2G panel
; 2 - BMW iDrive Gen 1 controller
; 3 - BMW IBUS
; 4 - Audi RNSE
; 5 - Rotary Encoder
; 6 - GPIO
Type=1

; Path to the descriptor of MAX3232 device connected to the MMI 2G panel and Raspberry PI.
Interface=/dev/ttyS0

; Duration in milliseconds between two presses of the button on the  MMI 2G panel. 0 disables double press feature.
;
; List of buttons on the panel with double press actions:
;
; Right Up button - [Show/Hide OpenAuto Pro Top Bar]
; Right Down button - [Mode - switch between active applications, OpenAuto Pro and active Projection (Android Auto or Mirroring)]
; Left Up button - [Back]
; Left Down button - [Bring OpenAuto Pro to front]
DoublePressSpeed=200
#5
BMW iDrive Gen 1 controller:
[Controller]
; Type of the input device
; 1 - Audi MMI 2G panel
; 2 - BMW iDrive Gen 1 controller
; 3 - BMW IBUS
; 4 - Audi RNSE
; 5 - Rotary Encoder
; 6 - GPIO
Type=2

; CAN interface connected to the iDrive Gen 1 controller (e.g. via MCP2515 device)
Interface=can0

; Duration in milliseconds between two presses of the button on the  MMI 2G panel. 0 disables double press feature.
;
; List of buttons on the panel with double press actions:
;
; Right - [Mode - switch between active applications, OpenAuto Pro and active Projection (Android Auto or Mirroring)]
; Left - [Back]
; Up - [Show/Hide OpenAuto Pro Top Bar]
; Down - [Bring OpenAuto Pro to front]
DoublePressSpeed=200

[IDriveGen1]
; Orientation in degrees of the iDrive Gen 1 controller. Possible values are 0, 90, 180, 270.
Angle=0

; true - Enable standalone mode of the controller; false - listen controller connected to the CIC/CCC BMW head unit.
Polling=true

; Period in milliseconds of querying the iDrive Gen1 controller (standalone mode).
PollTimeout=100

; Timeout in milliseconds for response from the iDrive Gen 1 controller (standalone mode). Exceeding terminates the controller service.
ControllerTimeout=1000
#6
BMW I-BUS:
[Controller]
; Type of the input device
; 1 - Audi MMI 2G panel
; 2 - BMW iDrive Gen 1 controller
; 3 - BMW IBUS
; 4 - Audi RNSE
; 5 - Rotary Encoder
; 6 - GPIO
Type=3

; List of supported steering wheel keys:
;
; Next track
; Previous track
; Volume up
; Volume down
; Answer phone call
; R/T - it will trigger Google Assistant
;
; Path to the "IBUS to UART" device descriptor (e.g. Melexis TH3122).
Interface=/dev/ttyS0

[IBus]
; true - control volume of OpenAuto Pro application using volume buttons of the steering wheel; false - do nothing when volume buttons of the steering wheels were pressed/released.
VolumeControlsEnabled=false
#7
Audi RNSE:
[Controller]
; Type of the input device
; 1 - Audi MMI 2G panel
; 2 - BMW iDrive Gen 1 controller
; 3 - BMW IBUS
; 4 - Audi RNSE
; 5 - Rotary Encoder
; 6 - GPIO
Type=4

; List of supported Audi RNSE buttons:
;
; Setup button - Toggle play
; Return button - Back
; Knob press - Enter
; Knob right - Scroll right
; Knob left - Scroll left
; Previous track button - Previous track
; Next track button - Next track
; Left Up button - Up
; Left Down button - Down
;
; CAN interface connected to the Audi RNSE head unit (e.g. via MCP2515 device)
Interface=can0


Forum Jump:


Users browsing this thread: 1 Guest(s)