SUNCAN J1939 Application – OBD Simulator Linux

  1. Introduction
  CAN, originally developed for in-vehicle communications, operates only at the Physical Layer (Layer 1) and Data Link Layer (Layer 2) of the OSI model.
However, much like a telephone system, CAN merely provides the communication infrastructure between ECUs — for the devices to actually understand each other, a higher-level language is required.
SAE J1939, defined by the Society of Automotive Engineers, builds on top of CAN and acts as a protocol above the Network Layer (Layer 3). It is widely used in heavy-duty vehicles.
This article does not explore the details of the J1939 protocol; rather, it focuses on demonstrating how SUNCAN implements J1939-based applications.
 
  1. OBD Simulator
  We will use an OBD simulator to implement a J1939 application. OBD (On-Board Diagnostics) is a vehicle standard diagnostic protocol that is currently mainstream in the automotive market. It specifies Diagnostic Trouble Codes (DTCs) and the OBD-II connector, allowing automotive technicians to access real-time vehicle status and fault information through the CAN bus This OBD simulator enables ECUs to transmit real-time data in the J1939 standard format. We will deploy this configuration on SUNCAN to perform data transmissions conforming to the J1939 standard.
 
 
  1. Wiring
Simulator Pin6 and Pin14 of the OBD-II connector define the CANH and CANL lines of the CAN. SUNCAN Pin7 and Pin2 of the DB9 connector define the CANH and CANL lines of the CAN. The diagram below illustrates the wiring connection between SUNCAN and the OBD simulator.
 
 
 
  1. J1939 PGN and SPN
 
  Since the PGN (Parameter Group Number) is defined in the CAN ID field and its length exceeds 11 bits, J1939 frames are always transmitted using the extended frame format. A PGN is a code that represents a specific message type. In heavy vehicle domain, it is commonly referred to as a ‘functional message’ or a ‘functional group’. For example, according to J1939-71, EEC1 (Electronic Engine Controller 1) is defined as PGN 61444.
  SPN (Suspect Parameter Number) serve as identifiers for actual physical parameters in heavy-duty vehicles. They are grouped under their respective PGNs. For example, within PGN 61444, the Engine Speed is defined as SPN 190 and is represented by two bytes in the payload.
The PGN 61444 and SPN 190 shown in the diagram below are taken from SAE J1939-71.
 
 
  1. Implementation: Parsing J1939 PGN and SPN
 
  • SUNCAN Configuration
Currently, most J1939 devices use bitrates of either 250Kbps or 500Kbps. Only when J1939-FD becomes widespread in the future will data bitrates above 2Mbps be commonly used.
 
  • RAW Data
 
Dumping the simulator’s CAN frames shows raw data before J1939 parsing, which must be decoded into automotive technician readable information
 
 
 
 
 
 
  • Parsing
  • Here, we use the Python can-j1939 module to parse J1939 frames.
 
  • Declaring Constants – PGNs
 
  • Declaring SPN190 resolution - Take Engine Speed as an example
 
  • Subscribe all J1939 message on the bus
 
  • On message callback funcation

 
  • Resolution parser method

  • Execution Results
 

News & Event

SUNCAN J1939 Application – OBD Simulator Linux

  1. Introduction
  CAN, originally developed for in-vehicle communications, operates only at the Physical Layer (Layer 1) and Data Link Layer (Layer 2) of the OSI model.
However, much like a telephone system, CAN merely provides the communication infrastructure between ECUs — for the devices to actually understand each other, a higher-level language is required.
SAE J1939, defined by the Society of Automotive Engineers, builds on top of CAN and acts as a protocol above the Network Layer (Layer 3). It is widely used in heavy-duty vehicles.
This article does not explore the details of the J1939 protocol; rather, it focuses on demonstrating how SUNCAN implements J1939-based applications.
 
  1. OBD Simulator
  We will use an OBD simulator to implement a J1939 application. OBD (On-Board Diagnostics) is a vehicle standard diagnostic protocol that is currently mainstream in the automotive market. It specifies Diagnostic Trouble Codes (DTCs) and the OBD-II connector, allowing automotive technicians to access real-time vehicle status and fault information through the CAN bus This OBD simulator enables ECUs to transmit real-time data in the J1939 standard format. We will deploy this configuration on SUNCAN to perform data transmissions conforming to the J1939 standard.
 
 
  1. Wiring
Simulator Pin6 and Pin14 of the OBD-II connector define the CANH and CANL lines of the CAN. SUNCAN Pin7 and Pin2 of the DB9 connector define the CANH and CANL lines of the CAN. The diagram below illustrates the wiring connection between SUNCAN and the OBD simulator.
 
 
 
  1. J1939 PGN and SPN
 
  Since the PGN (Parameter Group Number) is defined in the CAN ID field and its length exceeds 11 bits, J1939 frames are always transmitted using the extended frame format. A PGN is a code that represents a specific message type. In heavy vehicle domain, it is commonly referred to as a ‘functional message’ or a ‘functional group’. For example, according to J1939-71, EEC1 (Electronic Engine Controller 1) is defined as PGN 61444.
  SPN (Suspect Parameter Number) serve as identifiers for actual physical parameters in heavy-duty vehicles. They are grouped under their respective PGNs. For example, within PGN 61444, the Engine Speed is defined as SPN 190 and is represented by two bytes in the payload.
The PGN 61444 and SPN 190 shown in the diagram below are taken from SAE J1939-71.
 
 
  1. Implementation: Parsing J1939 PGN and SPN
 
  • SUNCAN Configuration
Currently, most J1939 devices use bitrates of either 250Kbps or 500Kbps. Only when J1939-FD becomes widespread in the future will data bitrates above 2Mbps be commonly used.
 
  • RAW Data
 
Dumping the simulator’s CAN frames shows raw data before J1939 parsing, which must be decoded into automotive technician readable information
 
 
 
 
 
 
  • Parsing
  • Here, we use the Python can-j1939 module to parse J1939 frames.
 
  • Declaring Constants – PGNs
 
  • Declaring SPN190 resolution - Take Engine Speed as an example
 
  • Subscribe all J1939 message on the bus
 
  • On message callback funcation

 
  • Resolution parser method

  • Execution Results
 

News & Event

SUNCAN J1939 Application – OBD Simulator Linux

  1. Introduction
  CAN, originally developed for in-vehicle communications, operates only at the Physical Layer (Layer 1) and Data Link Layer (Layer 2) of the OSI model.
However, much like a telephone system, CAN merely provides the communication infrastructure between ECUs — for the devices to actually understand each other, a higher-level language is required.
SAE J1939, defined by the Society of Automotive Engineers, builds on top of CAN and acts as a protocol above the Network Layer (Layer 3). It is widely used in heavy-duty vehicles.
This article does not explore the details of the J1939 protocol; rather, it focuses on demonstrating how SUNCAN implements J1939-based applications.
 
  1. OBD Simulator
  We will use an OBD simulator to implement a J1939 application. OBD (On-Board Diagnostics) is a vehicle standard diagnostic protocol that is currently mainstream in the automotive market. It specifies Diagnostic Trouble Codes (DTCs) and the OBD-II connector, allowing automotive technicians to access real-time vehicle status and fault information through the CAN bus This OBD simulator enables ECUs to transmit real-time data in the J1939 standard format. We will deploy this configuration on SUNCAN to perform data transmissions conforming to the J1939 standard.
 
 
  1. Wiring
Simulator Pin6 and Pin14 of the OBD-II connector define the CANH and CANL lines of the CAN. SUNCAN Pin7 and Pin2 of the DB9 connector define the CANH and CANL lines of the CAN. The diagram below illustrates the wiring connection between SUNCAN and the OBD simulator.
 
 
 
  1. J1939 PGN and SPN
 
  Since the PGN (Parameter Group Number) is defined in the CAN ID field and its length exceeds 11 bits, J1939 frames are always transmitted using the extended frame format. A PGN is a code that represents a specific message type. In heavy vehicle domain, it is commonly referred to as a ‘functional message’ or a ‘functional group’. For example, according to J1939-71, EEC1 (Electronic Engine Controller 1) is defined as PGN 61444.
  SPN (Suspect Parameter Number) serve as identifiers for actual physical parameters in heavy-duty vehicles. They are grouped under their respective PGNs. For example, within PGN 61444, the Engine Speed is defined as SPN 190 and is represented by two bytes in the payload.
The PGN 61444 and SPN 190 shown in the diagram below are taken from SAE J1939-71.
 
 
  1. Implementation: Parsing J1939 PGN and SPN
 
  • SUNCAN Configuration
Currently, most J1939 devices use bitrates of either 250Kbps or 500Kbps. Only when J1939-FD becomes widespread in the future will data bitrates above 2Mbps be commonly used.
 
  • RAW Data
 
Dumping the simulator’s CAN frames shows raw data before J1939 parsing, which must be decoded into automotive technician readable information
 
 
 
 
 
 
  • Parsing
  • Here, we use the Python can-j1939 module to parse J1939 frames.
 
  • Declaring Constants – PGNs
 
  • Declaring SPN190 resolution - Take Engine Speed as an example
 
  • Subscribe all J1939 message on the bus
 
  • On message callback funcation

 
  • Resolution parser method

  • Execution Results
 

News & Event

SUNCAN J1939 Application – OBD Simulator Linux

  1. Introduction
  CAN, originally developed for in-vehicle communications, operates only at the Physical Layer (Layer 1) and Data Link Layer (Layer 2) of the OSI model.
However, much like a telephone system, CAN merely provides the communication infrastructure between ECUs — for the devices to actually understand each other, a higher-level language is required.
SAE J1939, defined by the Society of Automotive Engineers, builds on top of CAN and acts as a protocol above the Network Layer (Layer 3). It is widely used in heavy-duty vehicles.
This article does not explore the details of the J1939 protocol; rather, it focuses on demonstrating how SUNCAN implements J1939-based applications.
 
  1. OBD Simulator
  We will use an OBD simulator to implement a J1939 application. OBD (On-Board Diagnostics) is a vehicle standard diagnostic protocol that is currently mainstream in the automotive market. It specifies Diagnostic Trouble Codes (DTCs) and the OBD-II connector, allowing automotive technicians to access real-time vehicle status and fault information through the CAN bus This OBD simulator enables ECUs to transmit real-time data in the J1939 standard format. We will deploy this configuration on SUNCAN to perform data transmissions conforming to the J1939 standard.
 
 
  1. Wiring
Simulator Pin6 and Pin14 of the OBD-II connector define the CANH and CANL lines of the CAN. SUNCAN Pin7 and Pin2 of the DB9 connector define the CANH and CANL lines of the CAN. The diagram below illustrates the wiring connection between SUNCAN and the OBD simulator.
 
 
 
  1. J1939 PGN and SPN
 
  Since the PGN (Parameter Group Number) is defined in the CAN ID field and its length exceeds 11 bits, J1939 frames are always transmitted using the extended frame format. A PGN is a code that represents a specific message type. In heavy vehicle domain, it is commonly referred to as a ‘functional message’ or a ‘functional group’. For example, according to J1939-71, EEC1 (Electronic Engine Controller 1) is defined as PGN 61444.
  SPN (Suspect Parameter Number) serve as identifiers for actual physical parameters in heavy-duty vehicles. They are grouped under their respective PGNs. For example, within PGN 61444, the Engine Speed is defined as SPN 190 and is represented by two bytes in the payload.
The PGN 61444 and SPN 190 shown in the diagram below are taken from SAE J1939-71.
 
 
  1. Implementation: Parsing J1939 PGN and SPN
 
  • SUNCAN Configuration
Currently, most J1939 devices use bitrates of either 250Kbps or 500Kbps. Only when J1939-FD becomes widespread in the future will data bitrates above 2Mbps be commonly used.
 
  • RAW Data
 
Dumping the simulator’s CAN frames shows raw data before J1939 parsing, which must be decoded into automotive technician readable information
 
 
 
 
 
 
  • Parsing
  • Here, we use the Python can-j1939 module to parse J1939 frames.
 
  • Declaring Constants – PGNs
 
  • Declaring SPN190 resolution - Take Engine Speed as an example
 
  • Subscribe all J1939 message on the bus
 
  • On message callback funcation

 
  • Resolution parser method

  • Execution Results
 

News & Event

Subscribe SUNIX eDM

Subscribe SUNIX eDM

Subscribe SUNIX eDM

Subscribe SUNIX eDM

Back to top
返回頂部
返回頂部