Log J1939 data
J1939 is a protocol that lets you log data from most heavy-duty vehicles.
In this section we outline how to log J1939 data with your CANedge.
Note
We recommend that you read our J1939 intro before proceeding
Table of Contents
Configure your device
J1939 data is generally broadcast, meaning that you do not need to request it. Instead, you can use the default Configuration File with automatic bit-rate detection.
Record J1939 data
To log J1939 data from a heavy-duty vehicle, you need to find a suitable way to connect the CANedge. Below are the most common methods:
- DB9-J1939: This lets you record J1939 data from most trucks, buses, engines, tractors
- DB9/DB9-OBD2: This lets you log both J1939/OBD2 in some trucks/buses
- DB9-CAT: This lets you log J1939 data from some Caterpillar vehicles/engines
- DB9/DB9-J1939: This lets you log 2 x J1939 networks in some vehicles (e.g. tractors)
- CANCrocodile: This lets you log J1939 data directly from the CAN high/low harness
Once you’ve identified which adapter cable to use, you can follow below steps:
- Connect the CANedge to your J1939 application via the adapter cable
- Verify that the device turns on and logs data (see the LED section of the CANedge Docs)
- Disconnect the device and use e.g. an MDF4 converter to view the raw data
- For J1939 data, your converted raw log file will typically look as below:
TimestampEpoch;BusChannel;ID;IDE;DLC;DataLength;Dir;EDL;BRS;DataBytes
1578923892.382550;1;18F0233D;1;8;8;0;0;0;FFFFFFFFFF0CFFFF
1578923892.384300;1;CF00400;1;8;8;0;0;0;087D7D000000F07D
1578923892.391950;1;14F00131;1;8;8;0;0;0;FFFFFFFF00FFFFFF
1578923892.392550;1;CF00A01;1;8;8;0;0;0;00000000FFFFFFFF
1578923892.393150;1;10F01A01;1;8;8;0;0;0;0000FFFFFFFFFFFF
1578923892.393750;1;10FCFD01;1;8;8;0;0;0;FFFFFFFF0000FFFF
1578923892.394300;1;18FD9401;1;8;8;0;0;0;C407FFFF00004B03
1578923892.394900;1;CF00400;1;8;8;0;0;0;087D7D000000F07D
...
Analyze and plot J1939 data
The asammdf GUI intro details how to convert raw data into human-readable form and e.g. perform plots. This process requires a J1939 DBC file. For details, see the process section.
Filter J1939 PGNs
See our section on how to reduce your log file size for guidance on PGN filtering.
Log J1939 on-request data
In some cases, you may wish to log on-request J1939 data. To do so, you’ll need to transmit the relevant J1939 request frame into the CAN bus - see also our J1939 simple intro.
An example is PGN 65253
(FEE5
) which contains the SPN Engine Hours. Below we show what the transmit message could look like for this particular PGN. There are two key things to note:
- The transmit frame CAN ID is
18EAFFFA
, reflecting the J1939 request PGN59904
(EA00
) - Note that we use a ‘global request’ (
0xFF
) and an arbitrary source address (0xFA
) - The data contains the requested PGN
FEE5
(note the byte ordering toE5FE
)
Note that not all vehicles will respond to your request messages. Note also that transmitting data may cause vehicle sensors to “wake up” even if the vehicle is turned off. In most cases the CANedge turns off with the vehicle power supply - and if so, this is not an issue. However, if the CANedge is still on when the vehicle is turned off, you may want to implement a control signal to stop transmitting data in this case - see also our OBD2 section for examples.
{
"can_1": {
"transmit": [
{
"name": "PGN_FEE5",
"state": 1,
"id_format": 1,
"frame_format": 0,
"brs": 0,
"log": 1,
"period": 5000,
"delay": 150,
"id": "18EAFFFA",
"data": "E5FE00"
}
]
}
}