Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kahiroka/slcanuino
USB-CAN(SocketCAN) sketch for Arduino CAN-BUS shield
https://github.com/kahiroka/slcanuino
Last synced: 3 months ago
JSON representation
USB-CAN(SocketCAN) sketch for Arduino CAN-BUS shield
- Host: GitHub
- URL: https://github.com/kahiroka/slcanuino
- Owner: kahiroka
- Created: 2015-03-19T07:17:40.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-11-17T03:06:58.000Z (almost 3 years ago)
- Last Synced: 2024-04-18T19:37:19.461Z (7 months ago)
- Language: C
- Homepage:
- Size: 19.5 KB
- Stars: 122
- Watchers: 13
- Forks: 41
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-canbus - slcanuino - USB-CAN (SocketCAN) sketch for Arduino CAN-BUS shield. (Hardware / Arduino)
README
# 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
If you are using SeeedStudio's one with its default setting please modify MCP2515_CS 'B,2' with 'B,1' in 'Canbus/defaults.h'.
http://wiki.seeedstudio.com/CAN-BUS_Shield_V2.0/
# 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)or just install can-utils package.
$ sudo apt install can-utils
## Setup
Please replace ttyUSB with ttyACM in case of using Arduino Uno.$ sudo slcan_attach -f -s6 -o /dev/ttyUSB0
$ sudo slcand -S 1000000 ttyUSB0 can0
$ sudo ifconfig can0 upthen,
$ candump can0
## Cleanup
$ sudo ifconfig can0 down
$ sudo killall slcand