Skip to content

Tompnyx/CANBusMessageEchoer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CAN Bus Message Echoer Project

General Information and Acknowledgements

The following project has been created to 'echo' CAN messages from a saved file. Each CAN message is read from a file loaded from the SD card.

The CAN messages must be saved in the format of HCRL's work on their CAN Dataset for intrusion detection (OTIDS). It is formatted in the following way:

Timestamp:          [Time since initialised in milliseconds]        ID: [Arbitration or CAN ID]    [If it is a remote request frame (Set to the value of '100']    DLC: [Length of the data package sent]    [The data package sent]     

How to run

The code in this project was developed to run on the Arduino Uno Rev3 and the CAN-BUS Shield V2.0 (which runs on the MCP2515 Chip), but any Arduino and CAN-BUS shield that supports the required libraries should work too.

The libraries used in this project include:

To run on your Arduino, make sure you have set the:

  • baud
  • SPI_CS pin
  • CAN_INT pin
  • SD_SPI_CS pin

Note that the filename of the read file needs to replace the value of the variable filename. Also, please note that certain Arduino boards might not work with file extensions with more than three characters.

Development Environment

The IDE CLion was used with the plugins PlatformIO for CLion and Serial Port Monitor.