4Can - Opened Upward Beginning Safety Tool To Honor Safety Vulnerabilities Inwards Modern Cars


Open Source Security Tool to Find Security Vulnerabilities inwards Modern Cars.

hardware
Tested on the next raspbian images using a pi3b+
4can should too piece of occupation amongst a pi0w, but it's recommended to piece of occupation at to the lowest degree a pi3b. Also recommend using a heatsink on the pi, because the pi tin flaming become a piddling toasty running four tin flaming interfaces.

install
run the install.sh script (requires sudo) to automatically install everything, in addition to and thus reboot.
The install script volition exercise the following:
  1. Copy the four mcp2515-canx.dtbo files to /boot/overlays
sudo mkdir /boot/overlays/bak sudo cp /boot/overlays/mcp2515* /boot/overlays/bak sudo cp ./dtbo/*.dtbo /boot/overlays
  1. copy config.txt to /boot/config.txt (make a backup of original /boot/config.txt simply incase)
sudo cp /boot/config.txt /boot/config.txt.bak sudo cp config.txt /boot/config.txt

usage
Before using 4can, brand certain that the socketcan kernel module is loaded amongst sudo modprobe can_dev. This shouldn't live on necessary since the pi volition charge the right center module based on the device tree, but it doesn't wound to check.
Once installed, run the 4can.sh to convey upward CAN interfaces ./4can.sh
wire upward the tin flaming interfaces in addition to exercise candump -acc any to banking concern check they are working. note: requires can-utils to install sudo apt install can-utils
Note: Sometimes interfaces come upward up out of order, reboot the pi in addition to that should cook it. If not, y'all mightiness pick out to alteration /boot/config.txt.

GPIO
The 4can uses a pose out of GPIO on the raspberry pi. The GPIO pins available for piece of occupation are 3, 5, 8, 10, 27, 28, 32, 36 (physical pivot numbering)
All the set down pins are tied together in addition to tin flaming should live on used every bit set down connections. The 3.3v, in addition to 5v pins tin flaming live on used to render voltage every bit well.
Consult the schematic for to a greater extent than details.

Recommended Wiring
Remember to connect the external CAN set down to the 4can set down (the "C" connexion on the screw terminal). This volition ensure expert set down integrity in addition to minimize tx/rx errors.



For fifty-fifty to a greater extent than aesthetics, the resistor color code tin flaming live on used to assign colors to signals. For example, inwards the icon above:When using the 4can amongst the HyenaPlate, the CAN wires tin flaming live on routed underneath the pi in addition to connected to the breadboard. This is mainly for aesthetics, but other benefits include non having to constantly screw/unscrew the screw terminals to brand novel connections, easier troubleshooting, in addition to to a greater extent than stable connections.
interface CAN-L CAN-H
CAN0 brown red
CAN1 orange yellow
CAN2 blue violet
CAN3 green white
dark tin flaming live on used for ground.

Credit in addition to License

IndustrialBerry
The 4can was inspired yesteryear in addition to is loosely based on the IndustrialBerry QUAD CAN BUS adapter for Raspberry CanBerry. Although nosotros modified the pattern to suit our needs, nosotros must attain credit to the fantastic piece of occupation done yesteryear IndustrialBerry. The 4CAN, every bit good every bit the IndustrialBerry are licensed nether a Creative Commons Attribution Share-Alike license.

George Tarnovsky
Credit must too live on given to George Tarnovsky, for schematic, layout, assembly, in addition to verification!