Skip to content

USB-CAN(SocketCAN) sketch for Arduino CAN-BUS shield

Notifications You must be signed in to change notification settings

l4m3rx/slcanuino

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Slcanuino

This is an Arduino sketch which makes a CAN-BUS shield into a CAN-USB adapter for Linux SocketCAN(can-utils). Library files under Canbus folder originaly comes from 'CAN-BUS ECU Reader demo sketch v4' on skpang and were modified. The files should be copied under ~/Arduino/libraries/ to compile the sketch file:'slcan.ino'.

http://skpang.co.uk/catalog/arduino-canbus-shield-with-usd-card-holder-p-706.html

Supported hardware

I tested this sketch on the following 'CAN-BUS Shield'.

https://www.sparkfun.com/products/10039

How to use

Burn your Arduino with this and install can-utils for your linux environment in advance.

Deps

  1. slcan (kernel module)
  2. SocketCAN (http://www.pengutronix.de/software/libsocketcan/)
  3. can-utils (https://github.com/linux-can/can-utils)

setup:

$ sudo slcan\_attach -f -s6 -o /dev/ttyUSB0  
$ sudo slcand -S 1000000 ttyUSB0 can0  
$ sudo ifconfig can0 up  

then,

$ candump can0

cleanup:

$ sudo ifconfig can0 down  
$ sudo killall slcand  

About

USB-CAN(SocketCAN) sketch for Arduino CAN-BUS shield

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 62.1%
  • C++ 19.0%
  • Other 18.9%