LIN - SuBerPL/v-link GitHub Wiki

The V-Link app can be controlled using steering wheel controls. Depending on your car, the buttons communicate on the CAN- or LIN-bus.

To setup LIN-based steering wheel controls, stay on this page. Otherwise, check out the Controls section of the CAN BUS integration page.

To use LIN you will need to connect the LIN Bus pin on the "ICM Connector A" behind the waterfall on P1 Volvos to the according pin on the HAT or through a LIN driver like the MCP 2004.

ICM_CONNECTOR_IMAGE

JSON File Configuration

You can configure the LIN-bus integration in V-Link using the file /v-link/backend/lin.json.

The configuration file follows a structured JSON format. Below is an example:

{
    "type": "interface",
    "name": "lin",
    "swm_id": "0x20",
    "sync_id": "0x55",
    "zero_code": "0xFF",
    "ign_on": ["0x50", "0x0E", "0x00", "0xF1"],
    "long_press_duration": 1500,
    "click_timeout": 300,

    "commands": {
        "button": {
            "BTN_NEXT":  ["0x20", "0x00", "0x10", "0x00", "0x00"],
            "BTN_PREV":  ["0x20", "0x00", "0x02", "0x00", "0x00"],
            "BTN_VOL_UP":  ["0x20", "0x00", "0x00", "0x01", "0x00"],
            "BTN_VOL_DOWN":  ["0x20", "0x00", "0x80", "0x00", "0x00"],
            "BTN_BACK":  ["0x20", "0x00", "0x01", "0x00", "0x00"],
            "BTN_ENTER":  ["0x20", "0x00", "0x08", "0x00", "0x00"]
        },
        "joystick": {
            "BTN_UP": ["0x20", "0x01", "0x00", "0x00", "0x00"],
            "BTN_DOWN": ["0x20", "0x02", "0x00", "0x00", "0x00"],
            "BTN_LEFT": ["0x20", "0x04", "0x00", "0x00", "0x00"],
            "BTN_RIGHT": ["0x20", "0x08", "0x00", "0x00", "0x00"] 
        }
    }
}

swm_id

  • The ID of the Steering wheel module. Filter for LIN frames from the steering wheel

sync_id

  • ID indicating an incoming LIN frame

zero_code

  • ID indicating the end of a LIN frame was reached

ign_on

  • Not used

click_timeout

  • The amount of time (in milliseconds) before a click is registered

long_press_duration

  • The amount of time (in milliseconds) before a second action is performed

commands

  • Key-value pairs of button names and associated LIN frames. Only supports single LIN frames (unlike the CAN integration)