Skip to content

Latest commit

 

History

History
42 lines (36 loc) · 2.47 KB

README.md

File metadata and controls

42 lines (36 loc) · 2.47 KB

CAN communication using Python

Note: The intent of this repository is to show easy, accessible methods of CAN communication using Python; Pythonic design choices shall not be of primary concern. Additionally, CAN communication protocol reference is of type J1939, where more details regarding this protocol can be found here. Finally, DBC file syntax differs from appliction to application, but just as with CAN, we will be discussing DBCs descibing J1939.

Python Modules

Goals

Implement DBC File

DBC (CAN database) files use a special syntax in plain (ASCII) text to describe CAN (Controller Area Network) data. Commercially available and open source methods of reading, creating, modifying, and using DBC files are readily available. I'm partial to open source, so here is how you can be too!

  • simple DBC creation using cantools
    • created DBC will be used to encode and decode CAN messages
Resources

Encode CAN data

DBC created above shall serve as the translater allowing us to write data as if sending CAN messages, which is common when simulating VCS commands.

  • determine desired parameters based on previous DBC definition
  • encode data from perspective of BMS or VCS

Decode CAN data

Data shall be received as encoded above.

  • capture and decode CAN messages per DBC specification
  • keep track of data for futher use, if necessary

Simulate BMS/VCS

Send commands to receive desired data from BMS, and to command actions based on response from BMS.

  • determine desired data
  • determine desired commanding actions and resonses
  • define guidance with regard to defined DBC parameters