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.
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
- DBC tutorial
- Python 3rd-party module,
cantools
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
Data shall be received as encoded above.
- capture and decode CAN messages per DBC specification
- keep track of data for futher use, if necessary
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