ECU

Learn how to program the ECU of the Syrus 4

This section describes how to develop a configuration file for use with the ECU core module. If you're looking for information on how to install the ECU check out the Connect guide.

πŸ“˜

SAE J1939 Documentation

Note that this documentation assumes that the reader has access to the latest official SAE J1939-71 documentation from which they'll find the parameters later defined in order to add them to the parameter file.

Configuration files

The ECU configuration is made up of two files:

  • ecumonitor.conf - which tells the Syrus how to read the data from the vehicle's CAN network as well as the actual parameters to be read
  • ecuparams.conf.json - which contains instructions on how to fire specific signals when a certain threshold is detected

Both files are found in the following path: /data/users/syrus4g/ecumonitor/

The management of the ecumonitor.conf is done via Syrus Cloud ECU profile. While the management of the ecuparams.conf.json is done via the manual upload / download of the file also in Syrus Cloud.

Configuration File - ecumonitor.conf

The configuration file is organized into different sections denoted by the keywords: START_SECTION to start the section, and END_SECTION to end the section.
The sections can be organized in the file in any matter as long as the contents within the start and end sections are not crossed.

The start of the parameter definitions is indicated by the keyword START_SECTION followed by a colon : and either J1939 or ACCESSORIES or CONFIGURATION, then either the list of parameters, each one separated by a line, or the configuration options, and finally an END_SECTION to end that particular section.

Examples:

START_SECTION: CONFIGURATION
PRIMARY_CAN: ...
LISTEN_ONLY_MODE: ...
END_SECTION

START_SECTION: J1939
PARAM_NAME: SPEED...
PARAM_NAME: FUEL...
END_SECTION

START_SECTION: ACCESSORIES
PARAM_NAME: CUSTOM 1...
PARAM_NAME: CUSTOM 2...
END_SECTION

🚧

Important

There must be an empty line after the very last END_SECTION on the ecumonitor.conf file.

πŸ“˜

UPPER_LIMIT configuration file option to allow processing ecu parameters out of the standard

Apex 24.33.1 / syrus-ecu 3.2.0

Example of a parameter that includes the upper limit:

PARAM_NAME: EEC1 - ENGINE SPEED, PGN: f004, TRANSMISSION_RATE: CONTINUOUS, PRIORITY: 3, DLC: 8, LENGTH: 2_BYTES, START_POSITION: 4-5, GROUP: NUMBER_VALUE, MULTIPLIER: 0.125, SOURCE_INTERFACE: PRIMARY, UPPER_LIMIT: FCFF

Configuration SECTION

For a description of this section look at the connect guide.

J1939 SECTION

Each line of the J1939 parameters section must have the following tokens spelled as shown below:

  • PARAM_NAME
  • PGN
  • TRANSMISSION_RATE
  • PRIORITY
  • DLC
  • LENGTH
  • START_POSITION
  • GROUP
  • MULTIPLIER

The following tokens are optional and can be added or omitted to the lines:

  • OFFSET
  • SOURCE_ADDRESS
  • SOURCE_INTERFACE
  • LOCATION_INDEX
  • REVERSED
  • ACCESSORY_TYPE

βœ…

Important Note

  • All of the above tokens are terminated with the : character.
  • All of the above tokens must be spelled exactly the same as shown above.
  • All of the key value pairs for the desired parameter are separated by , character.
  • All of the values must be spelled exactly as shown on the explanation.
  • Make sure to separate different parameters with the ENTER key.
  • Make sure that the last parameter is followed by a new line by pressing the ENTER key.
  • The order of the tokens does not matter, but it's recommended to follow the order as stated above

Token explanation

PARAM_NAME:
This token is simply the full parameter name found in the standard documentation. The valid value for this key is the actual parameter name, it may be useful to put the Acronym in front of the name to easily identify the parameter. The max number of characters is 99.

PGN:
This is the PDU format and specific, which is the parameter group number found in the standard documentation. The valid value for this key is the PGN that the parameter belongs to. Example: FEE7 is a valid value for the PGN token.

TRANSMISSION_RATE:
This token refers to the transmission repetition rate of the PGN defined by the standard. The following values are the only ones valid for TRANSMISSION_RATE:

  • CONTINUOUS - Used when transmission repetition rate does not describe a time in either seconds or milliseconds.
  • ON_REQUEST - Used when the transmission repetition rate states that the PGN is On request.
  • THE ACTUAL NUMERICAL VALUE - Enter the corresponding numerical value that appears. If 1s appears, then enter 1S. If 100ms, then enter 100MS. If 10s, then enter 10S.

PRIORITY:
Very important This token refers to the default priority defined by the standard, a wrong value will cause the parameter to not be read. This information is found in the SAE J1939-71 documentation, if you do not have access to it you can find some resources online that allow you to retrieve this priority using the Extended ID, see Capturing raw CAN data for more info.

The valid values for PRIORITY range from 3 to 7.

DLC:
Also known as PGN Data Length. This token contains the value of the data length defined by the standard for the PGN. The valid values for DLC range from 1 to 8, but in most cases it will be 8.

LENGTH:
This token contains the length of the of the desired parameter; enter exactly the value that appears under the length column, separating the number from the word by an underscore. Example: If it states 2 bytes, then enter 2_BYTES. If it states 2 bits, then enter 2_BITS If it states 1 byte, then enter 1_BYTE.

🚧

Plurality

Pay attention to the plurality 1_BYTE vs 2_BYTES or 1_BIT vs 2_BITS

START_POSITION:
Also known as SPN Position In PGN. This token will be the start position of the desired parameter. Enter exactly the number that appears in the standard for the Start Position field. If Start Position is 4, then simply enter 4. If the Start Position is 4.7, enter 4.7 for the START_POSITION token. If Start Position is 4-5, enter 4-5.
Examples:

  • If the standard states just the start position is the number 4. Then the START_POSITION: 4
  • If the standard states the number 4.7 in the start position column, then the START_POSITION: 4.7
  • If the standard states the number 4-5 in the start position column, then the START_POSITION: 4-5

GROUP:
This token refers to what group of parameters is desired. The only valid values for GROUP are:

  • SIGNAL - Used when desired parameter uses a binary value between 0 and 3.
  • PERCENT - Used when desired parameter states that it uses a percent value.
  • EXTENDED_SIGNAL - Used when desired parameter uses binary values more than 0 to 3.
  • LOCATION_COMPONENT_1 - Used when desired parameter relates to the location of tire or the location of an axle. Typically used when the PGN where this parameter comes from has a location parameter with a LENGTH of 8 bits.
  • NUMBER_VALUE - Used when none of the above groups apply.

MULTIPLIER:
This token refers to the first component of the resolution in the desired parameter definition.
Example: The desired parameter defines resolution as 0.0001/bit, 0 offset, the MULTIPLIER is 0.0001.

When the GROUP token value for the parameter is either SIGNAL or EXTENDED_SIGNAL the MULTIPLIER must be set to 1. Another possibility is the GROUP token value is set to LOCATION_COMPONENT_1 and the resolution includes states, then the MULTIPLIER must be set to 1.

The following key tokens are optional:

OFFSET:
This token refers to the second component of the resolution in the desired parameter definition. Example: The desired parameter defines resolution as 0.03125 deg C/bit, -273 deg C offset. The OFFSET is -273. If no offset is given, then it is assumed to be 0.

SOURCE_ADDRESS:
This token will order the ecumonitor application to only listen to this particular parameter if it is coming from the specified source address. This source address is defined as a hexadecimal value of one byte. If no SOURCE_ADDRESS is given then the application will obtain the parameter from any source.
Example: A particular parameter is sent by various sources, but the user only wants to accept parameter information coming from the engine controller. SOURCE_ADDRESS: 00

SOURCE_INTERFACE:
This token will order the ecumonitor application to only listen to this particular parameter if it is coming from the desired interface. Either PRIMARY, SECONDARY, or BOTH.

  • PRIMARY - Allows this particular parameter to be read from PRIMARY_CAN interface.
  • SECONDARY - Allows this particular parameter to be read from SECONDARY_CAN interface.
  • BOTH - Ecumonitor application will listen to both interfaces for this particular parameter. If this parameter is found in PRIMARY, then it will declare PRIMARY as the prioritized default desired interface even if the parameter also appears in SECONDARY. This is done to avoid data values from the parameter to change constantly if both interfaces report different values for the parameter.

LOCATION_INDEX:
This token will be accompanied with the LOCATION_COMPONENT_1 value for GROUP. This lets ecumonitor application know which byte position the the location will be extracted from. By default this value is 1 to represent that the location will be found in start position 1. The max value is 8.
Example: If Tire Temperature is a desired parameter, then enter the following string.

PARAM_NAME: TIRE TEMPERATURE, PGN: FEF4, TRANSMISSION_RATE: 10S, PRIORITY: 6, DLC: 8, LENGTH: 2_BYTES, START_POSITION: 3-4, GROUP: LOCATION_COMPONENT_1, MULTIPLIER: 0.03125, OFFSET: -273, LOCATION_INDEX: 1

*Note: in the sample configuration file this location index is omitted since the values are 1 and this is the default value in case it's not found.*

REVERSED:
This token will flip the bytes read, effectively changing the endianness of what was read. The flipping happens before any multipliers, masks, or offsets are applied. The only valid values for this key are 0 and 1. If this token is omitted it applies the default of 0, meaning no flipping.

PARAM_NAME: ODOMETER, CAN_ID: 540, TRANSMISSION_RATE: 100MS, DLC: 8, LENGTH: 2_BYTES, START_POSITION: 2-3, GROUP: NUMBER_VALUE, MULTIPLIER: 1, SOURCE_INTERFACE: PRIMARY, ACCESSORY_TYPE: MAXUS, REVERSED: 1

ACCESSORY_TYPE:
The accessory type can be assigned to a J1939 param that's not part of the standard set of params. Most car manufacturers use custom PGNs for specific modules in their vehicle's CAN network. To properly identify these fields we use the name of the car manufacturer as the accessory type. For a list of the supported J1939 extended params you can see our SDKs ECU directory, the files of interest start with the name of the manufacturer followed by .j1939.json, inside the files you'll find the accessory_type assigned.

🚧

Accessory types naming

The names assigned as accessory_types in the SDK are essentially reserved and should not be used to define a new custom param. (example "accessory_type": "FOTON")

Accessory Parameters

ECU monitor is capable of interacting with CAN based accessories. The configuration of any accessory be done on the CONFIGURATION section by specifying the frequency at which the CAN interface will communicate with the accessory with.

The format requires you to set the interface, either PRIMARY_CAN: or SECONDARY_CAN: followed by ACCESSORIES__XXXY_HZ where XXX is the variable speed to set the CAN interface and the Y is either K(kilo) or M(mega).

For example, an accessory that communicates at 100MHz would use the following configuration section:

START_SECTION: CONFIGURATION
SECONDARY_CAN: ACCESSORIES_100MHZ
END_SECTION

After you define the configuration of the accessory you can define the parameters within the accessory section block, from: START_SECTION: ACCESSORIES until END_SECTION.
Each line of the accessory section block must have the following tokens spelled as shown below:

  • PARAM_NAME
  • CAN_ID
  • TRANSMISSION_RATE
  • DLC
  • LENGTH
  • START_POSITION
  • GROUP
  • MULTIPLIER
  • SOURCE_INTERFACE
  • ACCESSORY_TYPE

The following token is optional and can be added or omitted to the lines:

  • REVERSED

Refer to the token explanation for the first 9 tokens and the optional token; the new token introduced for accessories is called ACCESSORY_TYPE.

ACCESSORY_TYPE:
This token refers to the type of accessory connected, the value is either one of the DCT defined ACCESSORY_TYPEs or a custom user defined accessory type.

πŸ“˜

ACCESSORY_TYPE database

The DCT defined ACCESSORY_TYPE can be identified using the SDK's ECU Directory. This directory contains all configuration files for accessories and j1939 params, the accessory files have the format name.json, for example: movon.json

When a parameter with an accessory type is added the unique ID that will be formed for that parameter uses the following format: CAN_ID+'_'+START_POSITION+'_'+ACCESSORY_TYPE

Full example with an existing and custom ACCESSORY_TYPE in the definition of the parameters.

# Configuration section defining 3 separate accessories, 2 custom and 1 existing
# Assuming MARS and NEPTUNE both work on PRIMARY and MOVON works on SECONDARY CAN interface

# MARS accessory will add _mars on the ID
# NEPTUNE accessory will add _neptu on the ID
# MOVON accessory will add _movon on the ID

START_SECTION: CONFIGURATION
PRIMARY_CAN: ACCESSORIES_150KHZ
SECONDARY_CAN: ACCESSORIES_250KHZ
END_SECTION

# Accessory parameter configuration section

START_SECTION: ACCESSORIES
# Right Lane Departure Warning ID: 700_5.3_mars
PARAM_NAME: RIGHT LANE DEPARTURE WARNING, CAN_ID: 700, TRANSMISSION_RATE: 100MS, DLC: 8, LENGTH: 1_BIT, START_POSITION: 5.3, GROUP: SIGNAL, MULTIPLIER: 1, SOURCE_INTERFACE: PRIMARY, ACCESSORY_TYPE: MARS

# Middle Lane Departure Warning ID: 700_5.4_neptu
PARAM_NAME: MIDDLE LANE DEPARTURE WARNING, CAN_ID: 700, TRANSMISSION_RATE: 100MS, DLC: 8, LENGTH: 1_BIT, START_POSITION: 5.4, GROUP: SIGNAL, MULTIPLIER: 1, SOURCE_INTERFACE: SECONDARY, ACCESSORY_TYPE: NEPTUNE

# Left Lane Departure Warning ID: 700_5.5_movon
PARAM_NAME: LEFT LANE DEPARTURE WARNING, CAN_ID: 700, TRANSMISSION_RATE: 100MS, DLC: 8, LENGTH: 1_BIT, START_POSITION: 5.5, GROUP: SIGNAL, MULTIPLIER: 1, SOURCE_INTERFACE: SECONDARY, ACCESSORY_TYPE: MOVON
END_SECTION

Parameters configuration file

The ecuparams.conf.json file can allow you to fire a signal when a particular threshold is met.

This file's structure is as follow

{
  "ECU_PARAM_ID":{
    "warnings": [
      "delta?time=X&value=Y
    ]
  }
}

Where ECU_PARAM_ID is the unique ID that references the ECU parameter, X is the time window in seconds that it's monitoring that parameter, and Y is the value that's going to trigger the signal - can be positive or negative.

For example

# monitors the ecu fuel level value (fefc_2)
# fires a signal if there's an increase of 10 within 60 seconds
# fires a signal if there's a decrease of 10 within 120 seconds
{
    "fee0_5-8": {
        "warnings": [
            "delta?time=5&value=50",
            "delta?time=7&value=-50",
            "delta?time=20&value=100",
            "delta?time=15&value=-100",
            "delta?time=10&value=-103"
        ]
    },
    "f004_4-5": {
        "warnings": [
            "delta?time=10&value=90",
            "delta?time=10&value=-100"
        ]
    },
	"fefc_2": {
        "warnings": [
            "delta?time=420&value=10",
            "delta?time=120&value=-10"
        ]
    }
}

Once these params are defined, you can upload it to the Syrus path: /data/users/syrus4g/ecumonitor/

With this defined you can now create a signal for when these thresholds are met and fire an event using Syruslang.

Message broker interaction

Once ecumonitor application is capturing and processing data, this data will be saved and sent through a message broker in the two following ways:

  • Parameters will be given a unique id which consists of the PGN the parameter comes from and the start position of that parameter. This unique id will be saved in the ecumonitor_parameters hash set with its current value.
  • Finally, once every second, information about all of the parameters that have a TRANSMISSION_RATE of < than 10sec will be published following the format of unique id followed by an equals sign followed by the value and finally followed by an ampersand if there are more parameters after this one. The same is true for parameters that have a transmission rate of 10sec except these are published every 10sec.

Example for publishing Engine Speed along with other parameters:

ecumonitor/parameters

"PUBLISH" "ecumonitor/parameters" "fef1_1.3=0.00&fef1_2-3=86.20&fef1_4.1=1.00&f004_4-5=651.00&fef1_4.3=1.00&fef1_4.7=1.00&fef1_5.1=0.00&fef1_5.5=0.00&fef1_6=17.00&fef1_7.1=1.00&fef1_7.6=4.00&fef1_8.1=1.00"

Parameters that fall under the GROUP of LOCATION_COMPONENT_1 follow a different format for saving and publishing data. This format is broken down into three different values.

  1. Axle position, 2. tire position, and 3. the corresponding value for that location for that particular parameter, followed by a semicolon ; if there are more values with different locations. The parameter is expected to have multiple different values for different locations.

Example with Tire Temperature:

"PUBLISH" "ecumonitor/parameters" "fef4_3-4=0,0,22.41;0,1,23.91;1,0,24.38;1,1,23.24"

In the above example the Tire Temperature is obtained for four different sensors located at; starting from the left,

  • first tire on the left side of the first axle with a value of 22.41Β°C,
  • second tire on the right side on the first axle with a value of 23.91Β°C,
  • third tire on the left side on the second axle with a value of 24.38Β°C,
  • and fourth tire on the right side on the second axle with a value of 23.24Β°C.

Example with tire temperature and other parameters:

"PUBLISH" "ecumonitor/parameters" "fee5_1-4=14316557.65&fee5_5-8=286331153000.00&feea_2-3=4,1,6810.50&fef4_2=5,4,276.00;2,1,80.00;2,3,80.00&fef4_3-4=0,0,22.41;0,1,23.91;1,0,24.38;1,1,23.24"

πŸ“˜

ISO standard note for tire component

Note that the ISO standard indicates that it is recommended to add a value of one to each axle and tire component location so that position number values go from 1 to 15 instead of 0 to 14.

Capturing raw CAN data

You can capture the raw data that's being read from the CAN interface using the following command:

apx-ecu log --log_time=[TIME] --log_interface=[INTERFACE] --file_name=[FILENAME]

# log for 10 seconds in the primary can interface
$ sudo apx-ecu log --log_time=10 --log_interface=PRIMARY_CAN --file_name=candump.log

note that this file is saved to the following directory: /data/users/syrus4g/ecumonitor/ecu_logs/

Once you've captured the data and open the file it'll look like this:

interface = can0, family = 29, type = 3, proto = 1
<0x18febf0b> [8] 00 00 fe 7d fe 7d ff ff
<0x0cf00400> [8] 10 7d 86 ec 12 00 04 86
<0x18ff0421> [8] ff ff ff ff cf ff ff ff
<0x18fec100> [8] 75 33 e5 00 94 35 e5 00
<0x18fc9600> [8] 00 00 ff ff ff ff ff ff
<0x18f00e00> [8] ff ff ff ff c0 9f ff ff
<0x0cf00300> [8] d3 08 17 07 ff ff 62 7d
<0x18f0010b> [8] cf ff f0 ff ff 1c ff ff
<0x18fd9400> [8] ff ff ff ff ff ff ff ff

From the log output you can see what PGNs are being read and the payload, the contents can be separated as follow:

Extended ID (header)payload-length [bytes]payload
<0x0cf00400>[8]10 7d 86 ec 12 00 04 86

The PGN can be found in the middle 4 characters of the Extended ID, after 0x in between the < & >

f004 and its payload:

<0x0cf00400> [8] 10 7d 86 ec 12 00 04 86

This line contains informatoin on f004 which refers to the
pgn61444 - Electronic Engine Controller 1 - EEC1

For example, SPN 190: the Engine Speed can be found in bytes 4-5 (bytes 0, 1, 2, etc.)

<0x0cf00400> [8] 10 7d 86 ec 12 00 04 86

to convert to decimal we use little endian and switch the position of the bytes.

ec 12 => 12ec to dec = 4844

according to SPN: 190, this parameter has a resolution of 0.125 rpm/bit

4844 * 0.125 = 605 rpm

Things to keep in mind:

  • some SPNs may be invalid, you can tell because the payload is full of F's (consult 5.1.5 Tables 1-3 on J1939-71 documentation).
  • at the same time it is useful to organize the candump in alphabetical order to see how the payload changes and confirm which values are indeed being read
  • some parameters may be found in other CAN bus wires of the vehicle's CAN Network
  • make sure to setup the configuration of the CAN interface before doing the capture, failure to do so will render inaccurate log outputs

Guide to create the parameters file (j1939)

Information about the following parameters is desired:

  • Engine Trip Fuel
  • Engine Speed
  • Service Distance
  • Engine Oil Level
  • Clutch Switch

Step 1

Identify the location of the parameter in the PGN description section of the standard.
Here, important information required for the parameter file can be found; such as, parameter name, PGN, transmission repetition rate, priority, data length, start position, and length.
DO NOT confuse data length with length. Data length; which will now be renamed DLC, refers to the length of the PGN message where length is the length of the parameter of interest.
When inputting information, all of the key and value pairs are in capital letters.

Step 2

Input the value for the keys based on the Explanation of key tokens section. Make sure that the keys are terminated with the : (colon) character and that key value pairs are separated by the , (comma) character.

Step 3

Enter the parameter name:

  • For Engine Trip Fuel β†’ PARAMETER_NAME: ENGINE TRIP FUEL
  • For Engine Speed β†’ PARAMETER_NAME: ENGINE SPEED
  • For Service Distance β†’ PARAMETER_NAME: SERVICE DISTANCE
  • For Engine Oil Level β†’ PARAMETER_NAME: ENGINE OIL LEVEL
  • For Clutch Switch β†’ PARAMETER_NAME: CLUTCH SWITCH

Step 4

Enter the PGN:

Note: This is the hexadecimal representation of the PGN ignoring the leading 0x00.

  • For Engine Trip Fuel β†’ PGN: FEE9
  • For Engine Speed β†’ PGN: F004
  • For Service Distance β†’ PGN: FEC0
  • For Engine Oil Level β†’ PGN: FEEF
  • For Clutch Switch β†’ PGN: FEF1

Step 5

Enter the transmission repetition rate:

Note: Some cases state a number followed by a unit of time, other cases state 'On request', and finally some cases state neither. When neither, a number, or the words β€œOn request” appear, then enter the transmission repetition rate as CONTINUOUS.

  • For Engine Trip Fuel β†’ TRANSMISSION_RATE: ON_REQUEST
  • For Engine Speed β†’ TRANSMISSION_RATE: CONTINUOUS
  • For Service Distance β†’ TRANSMISSION_RATE: ON_REQUEST
  • For Engine Oil Level β†’ TRANSMISSION_RATE: 0.5S
  • For Clutch Switch β†’ TRANSMISSION_RATE: 100MS

Step 6

Enter the priority:

  • For Engine Trip Fuel β†’ PRIORITY: 6
  • For Engine Speed β†’ PRIORITY: 3
  • For Service Distance β†’ PRIORITY: 6
  • For Engine Oil Level β†’ PRIORITY: 6
  • For Clutch Switch β†’ PRIORITY: 6

Step 7

Enter the data length (DLC):

Note: In some cases the Data Length will state VARIABLE, be sure to enter VARIABLE when it is mentioned.

  • For Engine Trip Fuel β†’ DLC: 8
  • For Engine Speed β†’ DLC: 8
  • For Service Distance β†’ DLC: 8
  • For Engine Oil Level β†’ DLC: 8
  • For Clutch Switch β†’ DLC: 8

Step 8

Enter the start position:

Note: Input exactly the number that appears under the Start Position column.

  • For Engine Trip Fuel β†’ START_POSITION: 1-4
  • For Engine Speed β†’ START_POSITION: 4-5
  • For Service Distance β†’ START_POSITION: 2-3
  • For Engine Oil Level β†’ START_POSITION: 3
  • For Clutch Switch β†’ START_POSITION: 4.7

Step 9

Enter the length:

Note: This is the length of the parameter and the unit is either bits or bytes.

  • For Engine Trip Fuel β†’ LENGTH: 4_BYTES
  • For Engine Speed β†’ LENGTH: 2_BYTES
  • For Service Distance β†’ LENGTH: 2_BYTES
  • For Engine Oil Level β†’ LENGTH: 1_BYTE
  • For Clutch Switch β†’ LENGTH: 2_BITS

Step 10

Find the detailed description of the parameter and this section can be used to fill the group, multiplier, and offset of the parameter.

Step 11

Enter the group:

Note: The group refers to whether the parameter uses states, has a percentage symbol, is part of a PGN that reports tire and axle locations, or is simply a numerical value.

  • For Engine Trip Fuel β†’ GROUP: NUMBER_VALUE
  • For Engine Speed β†’ GROUP: NUMBER_VALUE
  • For Service Distance β†’ GROUP: NUMBER_VALUE
  • For Engine Oil Level β†’ GROUP: PERCENT
  • For Clutch Switch β†’ GROUP: SIGNAL

Step 12

Enter the multiplier:

Note: This value refers to the first number found next to the resolution field. The value for multiplier is required for all parameters. SIGNALS (refers to states), EXTENDED_SIGNALS, and LOCATION_COMPONENT_1S must have a multiplier of 1.

  • For Engine Trip Fuel β†’ MULTIPLIER: 0.5
  • For Engine Speed β†’ MULTIPLIER: 0.125
  • For Service Distance β†’ MULTIPLIER: 5
  • For Engine Oil Level β†’ MULTIPLIER: 0.4
  • For Clutch Switch β†’ MULTIPLIER: 1

Step 13

Enter the offset:

Note
This key is not required and can be left omitted when the value is 0

❗️

IMPORTANT

IF THE OFFSET IS NEGATIVE, MAKE SURE TO PUT A SPACE BETWEEN THE COLON : AND THE NEGATIVE VALUE

For Service Distance β†’ OFFSET: -160635

Step 14

Put all of the key value pairs together.

Note: Be sure to separate each parameter by a singular press of the enter key to create a new line for each.

# Engine Trip Fuel
PARAM_NAME: ENGINE TRIP FUEL, PGN: FEE9, TRANSMISSION_RATE: ON_REQUEST, PRIORITY: 6, DLC: 8, LENGTH: 4_BYTES, START_POSITION: 1-4, GROUP: NUMBER_VALUE, MULTIPLIER: 0.5

# Engine Speed  
PARAM_NAME: ENGINE SPEED, PGN: F004, TRANSMISSION_RATE: CONTINUOUS, PRIORITY: 3, DLC: 8, LENGTH: 2_BYTES, START_POSITION: 4-5, GROUP: NUMBER_VALUE, MULTIPLIER: 0.125

# Service Distance
PARAM_NAME: SERVICE DISTANCE, PGN: FEC0, TRANSMISSION_RATE: ON_REQUEST, PRIORITY: 6, DLC: 8, LENGTH: 2_BYTES, START_POSITION: 2-3, GROUP: NUMBER_VALUE, MULTIPLIER: 5, OFFSET: -160635

# Engine Oil Level
PARAM_NAME: ENGINE OIL LEVEL, PGN: FEEF, TRANSMISSION_RATE: 0.5S, PRIORITY: 6, DLC: 8, LENGTH: 1_BYTE, START_POSITION: 3, GROUP: PERCENT, MULTIPLIER: 0.4

# Clutch Switch
PARAM_NAME: CLUTCH SWITCH, PGN: FEF1, TRANSMISSION_RATE: 100MS, PRIORITY: 6, DLC: 8, LENGTH: 2_BITS, START_POSITION: 4.7, GROUP: SIGNAL, MULTIPLIER: 1

Sample Configuration File

Filename: ecumonitor.conf - Download sample file

START_SECTION: CONFIGURATION
PRIMARY_CAN: J1939_250KHZ
SECONDARY_CAN: DISABLED
LISTEN_ONLY_MODE: NONE
END_SECTION

START_SECTION: J1939
PARAM_NAME: FUEL LEVEL 1, PGN: FEFC, TRANSMISSION_RATE: 1S, PRIORITY: 6, DLC: 8, LENGTH: 1_BYTE, START_POSITION: 2, GROUP: PERCENT, MULTIPLIER: 0.4
PARAM_NAME: ENGINE SPEED, PGN: F004, TRANSMISSION_RATE: CONTINUOUS, PRIORITY: 3, DLC: 8, LENGTH: 2_BYTES, START_POSITION: 4-5, GROUP: NUMBER_VALUE, MULTIPLIER: 0.125
PARAM_NAME: WHEEL-BASED VEHICLE SPEED, PGN: FEF1, TRANSMISSION_RATE: 100MS, PRIORITY: 6, DLC: 8, LENGTH: 2_BYTES, START_POSITION: 2-3, GROUP: NUMBER_VALUE, MULTIPLIER: 0.00390625
PARAM_NAME: COMBINED DM1 MESSAGE - SPN & FMI & CM & OC, PGN: FECA, TRANSMISSION_RATE: 1S, PRIORITY: 6, DLC: 8, LENGTH: 4_BYTES, START_POSITION: 3-6, GROUP: NUMBER_VALUE, MULTIPLIER: 1
PARAM_NAME: CLUTCH SWITCH, PGN: FEF1, TRANSMISSION_RATE: 100MS, PRIORITY: 6, DLC: 8, LENGTH: 2_BITS, START_POSITION: 4.7, GROUP: SIGNAL, MULTIPLIER: 1
PARAM_NAME: PARKING BRAKE SWITCH, PGN: FEF1, TRANSMISSION_RATE: 100MS, PRIORITY: 6, DLC: 8, LENGTH: 2_BITS, START_POSITION: 1.3, GROUP: SIGNAL, MULTIPLIER: 1
PARAM_NAME: BRAKE SWITCH, PGN: FEF1, TRANSMISSION_RATE: 100MS, PRIORITY: 6, DLC: 8, LENGTH: 2_BITS, START_POSITION: 4.5, GROUP: SIGNAL, MULTIPLIER: 1
PARAM_NAME: ENGINE OIL LEVEL, PGN: FEEF, TRANSMISSION_RATE: 0.5S, PRIORITY: 6, DLC: 8, LENGTH: 1_BYTE, START_POSITION: 3, GROUP: PERCENT, MULTIPLIER: 0.4
PARAM_NAME: ENGINE OIL PRESSURE, PGN: FEEF, TRANSMISSION_RATE: 0.5S, PRIORITY: 6, DLC: 8, LENGTH: 1_BYTE, START_POSITION: 4, GROUP: NUMBER_VALUE, MULTIPLIER: 4
PARAM_NAME: ENGINE COOLANT PRESSURE, PGN: FEEF, TRANSMISSION_RATE: 0.5S, PRIORITY: 6, DLC: 8, LENGTH: 1_BYTE, START_POSITION: 7, GROUP: NUMBER_VALUE, MULTIPLIER: 2
PARAM_NAME: ENGINE COOLANT LEVEL, PGN: FEEF, TRANSMISSION_RATE: 0.5S, PRIORITY: 6, DLC: 8, LENGTH: 1_BYTE, START_POSITION: 8, GROUP: PERCENT, MULTIPLIER: 0.4
PARAM_NAME: BRAKE PEDAL POSITION, PGN: F001, TRANSMISSION_RATE: 100MS, PRIORITY: 6, DLC: 8, LENGTH: 1_BYTE, START_POSITION: 2, GROUP: PERCENT, MULTIPLIER: 0.4
PARAM_NAME: RETARDER TORQUE MODE, PGN: F000, TRANSMISSION_RATE: 100MS, PRIORITY: 6, DLC: 8, LENGTH: 4_BITS, START_POSITION: 1.1, GROUP: SIGNAL, MULTIPLIER: 1
PARAM_NAME: RETARDER ENABLE - BRAKE ASSIST SWITCH, PGN: F000, TRANSMISSION_RATE: 100MS, PRIORITY: 6, DLC: 8, LENGTH: 2_BITS, START_POSITION: 1.5, GROUP: SIGNAL, MULTIPLIER: 1
PARAM_NAME: RETARDER ENABLE - SHIFT ASSIST SWITCH, PGN: F000, TRANSMISSION_RATE: 100MS, PRIORITY: 6, DLC: 8, LENGTH: 2_BITS, START_POSITION: 1.7, GROUP: SIGNAL, MULTIPLIER: 1
PARAM_NAME: ENGINE TOTAL HOURS OF OPERATION, PGN: FEE5, TRANSMISSION_RATE: ON_REQUEST, PRIORITY: 6, DLC: 8, LENGTH: 4_BYTES, START_POSITION: 1-4, GROUP: NUMBER_VALUE, MULTIPLIER: 0.05
PARAM_NAME: TRIP DISTACE, PGN: FEE0, TRANSMISSION_RATE: 100MS, PRIORITY: 6, DLC: 8, LENGTH: 4_BYTES, START_POSITION: 1-4, GROUP: NUMBER_VALUE, MULTIPLIER: 0.125
PARAM_NAME: TOTAL VEHICLE DISTANCE, PGN: FEE0, TRANSMISSION_RATE: 100MS, PRIORITY: 6, DLC: 8, LENGTH: 4_BYTES, START_POSITION: 5-8, GROUP: NUMBER_VALUE, MULTIPLIER: 0.125
PARAM_NAME: SERVICE DISTANCE, PGN: FEC0, TRANSMISSION_RATE: ON_REQUEST, PRIORITY: 6, DLC: 8, LENGTH: 2_BYTES, START_POSITION: 2-3, GROUP: NUMBER_VALUE, MULTIPLIER: 5, OFFSET: -160635
PARAM_NAME: ENGINE TOTAL IDLE FUEL USED, PGN: FEDC, TRANSMISSION_RATE: ON_REQUEST, PRIORITY: 6, DLC: 8, LENGTH: 4_BYTES, START_POSITION: 1-4, GROUP: NUMBER_VALUE, MULTIPLIER: 0.5
PARAM_NAME: ENGINE TOTAL IDLE HOURS, PGN: FEDC, TRANSMISSION_RATE: ON_REQUEST, PRIORITY: 6, DLC: 8, LENGTH: 4_BYTES, START_POSITION: 5-8, GROUP: NUMBER_VALUE, MULTIPLIER: 0.05
PARAM_NAME: ENGINE TRIP FUEL, PGN: FEE9, TRANSMISSION_RATE: ON_REQUEST, PRIORITY: 6, DLC: 8, LENGTH: 4_BYTES, START_POSITION: 1-4, GROUP: NUMBER_VALUE, MULTIPLIER: 0.5
PARAM_NAME: ENGINE TOTAL FUEL USED, PGN: FEE9, TRANSMISSION_RATE: ON_REQUEST, PRIORITY: 6, DLC: 8, LENGTH: 4_BYTES, START_POSITION: 5-8, GROUP: NUMBER_VALUE, MULTIPLIER: 0.5
PARAM_NAME: POWERED VEHICLE WEIGHT, PGN: FE70, TRANSMISSION_RATE: ON_REQUEST, PRIORITY: 6, DLC: VARIABLE, LENGTH: 2_BYTES, START_POSITION: 1-2, GROUP: NUMBER_VALUE, MULTIPLIER: 10
PARAM_NAME: GROSS COMBINATION VEHICLE WEIGHT, PGN: FE70, TRANSMISSION_RATE: ON_REQUEST, PRIORITY: 6, DLC: VARIABLE, LENGTH: 2_BYTES, START_POSITION: 3-4, GROUP: NUMBER_VALUE, MULTIPLIER: 10
PARAM_NAME: AFTERTREATMENT 1 DIESEL PARTICULATE FILTER SOOT LOAD REGENERATION THRESHOLD, PGN: FD7B, TRANSMISSION_RATE: ON_REQUEST, PRIORITY: 6, DLC: 8, LENGTH: 2_BYTES, START_POSITION: 7, GROUP: NUMBER_VALUE, MULTIPLIER: 0.0025
PARAM_NAME: DIESEL PARTICULATE FILTER 1 SOOT LOAD PERCENT, PGN: FD7B, TRANSMISSION_RATE: ON_REQUEST, PRIORITY: 6, DLC: 8, LENGTH: 1_BYTE, START_POSITION: 1, GROUP: PERCENT, MULTIPLIER: 1
PARAM_NAME: ENGINE EXHAUST GAS RECIRCULATION 1 VALVE CONTROL, PGN: FDD5, TRANSMISSION_RATE: ON_REQUEST, PRIORITY: 6, DLC: 8, LENGTH: 2_BYTES, START_POSITION: 5-6, GROUP: PERCENT, MULTIPLIER: 0.0025
PARAM_NAME: ENGINE VARIABLE GEOMETRY TURBOCHARGER 1 ACTUATOR POSITION, PGN: FDD5, TRANSMISSION_RATE: ON_REQUEST, PRIORITY: 6, DLC: 8, LENGTH: 1_BYTE, START_POSITION: 8, GROUP: PERCENT, MULTIPLIER: 0.04
PARAM_NAME: ENGINE VARIABLE GEOMETRY TURBOCHARGER 1 CONTROL MODE, PGN: FDD5, TRANSMISSION_RATE: ON_REQUEST, PRIORITY: 6, DLC: 8, LENGTH: 2_BITS, START_POSITION: 7.3, GROUP: SIGNAL, MULTIPLIER: 1
PARAM_NAME: TOTAL ECU RUN TIME, PGN: FEB1, TRANSMISSION_RATE: ON_REQUEST, PRIORITY: 7, DLC: 8, LENGTH: 4_BYTES, START_POSITION: 5-8, GROUP: NUMBER_VALUE, MULTIPLIER: 0.05
PARAM_NAME: AXLE WEIGHT, PGN: FEEA, TRANSMISSION_RATE: ON_REQUEST, PRIORITY: 6, DLC: 8, LENGTH: 2_BYTES, START_POSITION: 2-3, GROUP: LOCATION_COMPONENT_1, MULTIPLIER: 0.5
PARAM_NAME: TRAILER WEIGHT, PGN: FEEA, TRANSMISSION_RATE: ON_REQUEST, PRIORITY: 6, DLC: 8, LENGTH: 2_BYTES, START_POSITION: 4-5, GROUP: NUMBER_VALUE, MULTIPLIER: 2
PARAM_NAME: CARGO WEIGHT, PGN: FEEA, TRANSMISSION_RATE: ON_REQUEST, PRIORITY: 6, DLC: 8, LENGTH: 2_BYTES, START_POSITION: 6-7, GROUP: NUMBER_VALUE, MULTIPLIER: 2
PARAM_NAME: ENGINE FUEL RATE, PGN: FEF2, TRANSMISSION_RATE: 100MS, PRIORITY: 6, DLC: 8, LENGTH: 2_BYTES, START_POSITION: 1-2, GROUP: NUMBER_VALUE, MULTIPLIER: 0.05
PARAM_NAME: ENGINE INSTANTANEOUS FUEL ECONOMY, PGN: FEF2, TRANSMISSION_RATE: 100MS, PRIORITY: 6, DLC: 8, LENGTH: 2_BYTES, START_POSITION: 3-4, GROUP: NUMBER_VALUE, MULTIPLIER: 0.001953125
PARAM_NAME: TIRE PRESSURE, PGN: FEF4, TRANSMISSION_RATE: 10S, PRIORITY: 6, DLC: 8, LENGTH: 1_BYTE, START_POSITION: 2, GROUP: LOCATION_COMPONENT_1, MULTIPLIER: 4
PARAM_NAME: TIRE TEMPERATURE, PGN: FEF4, TRANSMISSION_RATE: 10S, PRIORITY: 6, DLC: 8, LENGTH: 2_BYTES, START_POSITION: 3-4, GROUP: LOCATION_COMPONENT_1, MULTIPLIER: 0.03125, OFFSET:  -273
END_SECTION

ECU Parameters (j1939)

List parameters read by the ECU

$ sudo apx-ecu list_parameters
{"f003_1.1":1,"f003_1.3":0,"f003_1.5":1,"f003_2":0,"f003_3":0,"f003_7":26.4,"f003_8":0,"f004_1.1":14,"f004_1.5":0,"f004_2":0,"f004_3":0,"f004_4-5":0,"f001_3.1":0,"f001_3.3":0,"f001_4.7":0,"f001_6.1":1,"f001_6.5":0,"fcdc_5-6":99.78,"fcdc_7-8":0,"febf_1-2":0,"febf_3":0.81,"febf_4":0.81,"febf_5":0.81,"febf_6":0.81,"fedf_1":0,"fedf_2-3":1300,"fef1_1.3":1,"fef1_2-3":0,"fef1_6":99,"fef1_7.1":0,"fef1_7.6":0,"fef1_8.1":0,"fef1_8.3":0,"fef1_8.5":0,"fcfd_5-6":65,"f00e_5.1":1,"f00e_5.3":1,"f00e_5.5":1,"f00e_6.6":0,"fee0_1-4":289242.12,"fee0_5-8":289241.5,"fef0_4-5":700,"fef2_1-2":0,"fef2_3-4":0,"fef2_5-6":1.8,"fd92_1.1":0,"feca_1.3":0,"feca_1.5":0,"feca_1.7":0,"feca_5.1":0,"feca_6.1":0,"feca_6.8":0,"fec1_1-4":289167795,"fef7_5-6":12.45,"fefc_2":56.4,"fdc6_2.1":4,"fdc6_2.5":0,"fedb_3-4":51.72,"feef_4":0,"fee4_2.7":0,"fee4_5.1":0,"fee4_5.3":0,"fee4_5.5":0,"fee4_5.7":0,"fee4_6.7":1,"fec1_5-8":289242145,"fef6_2":0,"fef6_3":53,"fea4_3-4":31.28,"feee_1":62,"fdd5_7.3":0,"fdd5_7.5":1,"fdd5_8":23.6,"fe56_1":81.6,"fe56_2":16,"fe56_5.6":0,"fe56_7":0,"fedc_1-4":30482,"fedc_5-8":6484.7,"fef5_4-5":9.09,"fee5_1-4":13919.65,"fee5_5-8":109582000,"fee9_1-4":160535,"fee9_5-8":164860,"feb1_5-8":14068.65,"0_1.1":0,"0_2-3":8016.88,"f004_6":0,"f004_7.1":15,"f004_8":0,"e0ff_1":0,"febd_1":0,"fce7_1":3,"fce7_2":7,"fce7_3":4,"fce7_4":5,"fce7_5":5,"fce7_6":8,"fce7_7":8}

This JSON response is composed of the PGN & start position described earlier, and the value. For example: "fe56_1":81.6 corresponds to: AFTERTREATMENT 1 DIESEL EXHAUST FLUID TANK 1 LEVEL value of 81.6%

The following is a list of the most common parameters, also compatible with TAIP protocol, which means they can be sent to Pegasus.
To integrate them with SyrusJS you can define fieldsets and signals using the param_name or id from the ECU directory in the SDK.

SyrusJS

Fieldsets

define fieldset pegasus fields=$ecu
define fieldset id_mqtt fields=accel_pedal:$ecu.f003_2,...
define fieldset param_name_mqtt fields=pedal:$ecu.accel_pedal_position,...
define fieldset mqtt_example_all fields=$ecu

Signals

# using id
define signal pedal_full_press_id $ecu.f003_2 >= 99

# using param_name
define signal pedal_full_press_param_name $ecu.accel_pedal_position >= 99

πŸ“˜

List of standard J1939 params

🌎 SPN & Start Position List