Tools/Linux/CanBus

From UIT
(Difference between revisions)
Jump to: navigation, search
(driver)
 
Line 1: Line 1:
 
{{TOC right}}
 
{{TOC right}}
Example using the (CAN-) LiftEBS, tested on ubuntu 16.04.3 LTS.
+
Example using the (CAN-) LiftEBS, tested on ubuntu 16.04.3 LTS and raspbian stretch 2017-11-29.
  
Tested using Microchip CAN bus analyser (APGDT002), and the custom firmware from [https://github.com/rkollataj/mcba_firmware github].
+
Tested using Microchip CAN bus analyser (APGDT002), with the custom firmware from [https://github.com/rkollataj/mcba_firmware github].
 
The custom firmware enable remote frame and does not prevent using the microchip tools.
 
The custom firmware enable remote frame and does not prevent using the microchip tools.
  
== Hardware dependant part ==
+
Tested using 8devices usb2can.
=== mcba_usb : drivers for Microchip CAN bus analyser (APGDT002) ===
+
This driver has been included in Linux 4.12, so it should be supported out of the box. For other kernels, use this procedure:
+
(Tested on ubuntu 16.04.3 LTS and Raspbian stretch 2017-11-29).
+
  
==== Raspbian ====
+
== Drivers ==
 +
=== Raspbian ===
 
<source lang="bash">
 
<source lang="bash">
 
sudo apt-get install raspberrypi-kernel-headers
 
sudo apt-get install raspberrypi-kernel-headers
 
</source>
 
</source>
  
==== Ubuntu ====
+
=== Ubuntu ===
 
Install the latest HWE kernel ([https://wiki.ubuntu.com/Kernel/LTSEnablementStack HWE kernel]).
 
Install the latest HWE kernel ([https://wiki.ubuntu.com/Kernel/LTSEnablementStack HWE kernel]).
  
=== driver (for Raspberry PI and ubuntu) ===
+
=== mcba_usb : drivers for Microchip CAN bus analyser (APGDT002) ===
 +
This driver has been included in Linux 4.12, so it will work with later releases out of the box. For raspian and ubuntu LTS 16.04, use this procedure:
 +
'''Custom compiled modules won't load with secure boot enable!'''
 +
 
 
<source lang="bash">
 
<source lang="bash">
 
cd ~ && mkdir -p git && git clone https://github.com/rkollataj/mcba_usb.git
 
cd ~ && mkdir -p git && git clone https://github.com/rkollataj/mcba_usb.git
 
make -C /lib/modules/$(uname -r)/build M=$(pwd) modules
 
make -C /lib/modules/$(uname -r)/build M=$(pwd) modules
 
sudo make -C /lib/modules/$(uname -r)/build M=$(pwd) modules_install
 
sudo make -C /lib/modules/$(uname -r)/build M=$(pwd) modules_install
depmod -a
+
sudo depmod -a
 
</source>
 
</source>
  
'''Custom compiled modules won't load with secure boot enable!'''
+
=== usb_8dev : drivers for 8devices usb2can ===
 +
This driver is included in ubuntu 16.04 LTS, but for raspbian here is the procedure:
 +
 
 +
<source lang="bash">
 +
cd ~ && mkdir -p git && git clone https://github.com/krumboeck/usb2can.git
 +
make -C /lib/modules/$(uname -r)/build M=$(pwd) modules
 +
sudo make -C /lib/modules/$(uname -r)/build M=$(pwd) modules_install
 +
sudo depmod -a
 +
</source>
  
 
== Install the tools ==
 
== Install the tools ==

Latest revision as of 10:12, 22 December 2017

Contents

Example using the (CAN-) LiftEBS, tested on ubuntu 16.04.3 LTS and raspbian stretch 2017-11-29.

Tested using Microchip CAN bus analyser (APGDT002), with the custom firmware from github. The custom firmware enable remote frame and does not prevent using the microchip tools.

Tested using 8devices usb2can.

Drivers

Raspbian

sudo apt-get install raspberrypi-kernel-headers

Ubuntu

Install the latest HWE kernel (HWE kernel).

mcba_usb : drivers for Microchip CAN bus analyser (APGDT002)

This driver has been included in Linux 4.12, so it will work with later releases out of the box. For raspian and ubuntu LTS 16.04, use this procedure: Custom compiled modules won't load with secure boot enable!

cd ~ && mkdir -p git && git clone https://github.com/rkollataj/mcba_usb.git
make -C /lib/modules/$(uname -r)/build M=$(pwd) modules
sudo make -C /lib/modules/$(uname -r)/build M=$(pwd) modules_install
sudo depmod -a

usb_8dev : drivers for 8devices usb2can

This driver is included in ubuntu 16.04 LTS, but for raspbian here is the procedure:

cd ~ && mkdir -p git && git clone https://github.com/krumboeck/usb2can.git
make -C /lib/modules/$(uname -r)/build M=$(pwd) modules
sudo make -C /lib/modules/$(uname -r)/build M=$(pwd) modules_install
sudo depmod -a

Install the tools

sudo apt-get install can-utils

Enable the bus

sudo ip link set can0 type can bitrate 125000
sudo ifconfig can0 up

Dump the CAN bus traffic

candump can0

Request lift id

cansend can0 7ff#
Personal tools
Namespaces
Variants
Actions
Navigation
Browse
Toolbox