Skip to content

Principle of operation

Note

Since ADVANTICS controllers use natively the so-called generic interface for communications, the term generic is used throughout this document to designate messages on the Generic Interface side, as opposed to the J1939 side. Please note that the J1939 bridge will only work with Advantics Generic Interface V2.

The J1939 feature available on controllers is a bridge between the Generic Interface used by ADVANTICS controllers and the SAE J1939 protocol. When J1939 is enabled, an independant thread translating Generic Interface messages to J1939 will be started. The translation is bidirectional. This means that the ADVANTICS applications will keep using the generic interface internally - the J1939 bridge will simply act as an adapter between your J1939 implementation and the generic interface used internally.

On EVCC/MEVCC, the CAN communications with the BMS are handled by the pev-controller application. Since you probably do not want to see the generic messages on our physical CAN bus (to prevent potential ID conflicts or simply to limit noise), the recommended approach it to configure the pev-controller to use a virtual CAN bus instead, and let advantics-csm translate your J1939 messages (on the physical CAN bus) to the generic interface (on the virtual one).

flowchart LR
    pev["pev-controller(generic)"] <-->|vcan0| advantics-csm
    advantics-csm <-->|can0| bms["BMS (J1939)"]

Enabling J1939 in your config

On the web interface

In the config tab, go to the J1939 section and click Enable J1939 Bridge. If you are fine with having the generic and j1939 communications both on the physical CAN bus (can0), that's all you have to do. If instead you would like to move the generic interface to a virtual CAN bus, as recommended above, go to the Vehicle tab and set Can If to vcan0.
Don't forget to restart your applications after changing the config.

In the config file (SSH)

If editing the config via SSH directly, you need to do the same changes as stated above by editing the config file directly, look for the following options:

[vehicle]
# ...
can_if=vcan0
# ...
[system]
enable_j1939_bridge=true

Implementing the J1939 interface

CAN Databases

The J1939 adapter does two things:

  • It mirrors the generic interface by mapping the generic messages to vendor-specific PGN of J1939, without any other transformation. In other words, the payload (signal layout and values) of each message is exactly the same. It only converts the generic ID to a J1939 vendor-specific one.
  • It translates some of the generic messages into J1939 standardized PGNs, when applicable. This is still very much a work in progress and should not be considered stable.

In the current state of the J1939 adapter implementation, we recommend to use exclusively the vendor-specific messages. In other words, only the communication/protocol layer of J1939 is used, not the standardized applicative layer. You can find DBC and KCD databases for the vendor-specific messages here:

Device address and priority

Device address

Warning

EVCC/MEVCC do not currently implement the device address claim protocol. Considering J1939 adapter is optional and the source address used by the controller can be defined from the config, users of the J1939 adapter are expected to set the device address in the config so that it does not collide with other components of the system. The controller will start using the device address as soon as the J1939 adapter is enabled.

Without specific configuration, the EVCC/MEVCC will default to device address 0 for the J1939 communications. You can customize the device address in the j1939 config tab, by modifying the Device Address parameter. Note that address should be picked between 0 and 253.

Default priority

Warning

Vendored messages priority can only be configured globally for now, there is no mechanism to specify the priority per message. This might get added in future releases.

Without specific configuration, the EVCC/MEVC will default to priority 0 (lowest) for every vendor-specific message. You can specify the default priority that should be used by these messages in the J1939 config tab, by modifying the Default Priority parameter. Value should be between 0 (high priority) to 7 (low priority).

Solving ID conflicts in vendor space

If the IDs used by the EVCC collide in any way with other vendor-specific IDs on the same bus, you can use the Vendor PGN Offset parameter to add an offset to all vendor IDs. This parameter is available in the J1939 section when enabling expert mode.