Android Canbus: Difference between revisions

From Variscite Wiki
No edit summary
No edit summary
Line 1: Line 1:
{{PageHeader|CAN bus}}
{{PageHeader|CAN bus}}
{{DocImage|category1=Yocto|category2=VAR-SOM-MX6}}
{{DocImage|category1=Yocto|category2=VAR-SOM-MX6}}
==Hardware Setup ==


Connect 2 boards with the appropriate cable.<br>
Connect 2 boards with the appropriate cable.<br>
Line 9: Line 10:




==Software Setup==
Android current releases come with the canutils already installed.
Set up the boards by running the following on each of them:<br>  
Set up the boards by running the following on each of them:<br>  
<pre>
<pre>
Line 15: Line 18:


Then:<br>
Then:<br>
On board #1:<br>  
On board #A:<br>  
<pre>
<pre>
$ cansniffer can0
$ cansniffer can0
</pre>
</pre>


On board #2:<br>  
On board #B:<br>  
<pre>
<pre>
$ cansend can0 500#1E.10.10
$ cansend can0 500#1E.10.10
</pre>
</pre>
== Canbus at Framework - Android Java application ==
- If you want the application to use the canbus, you must port the framework level changes
- Port https://github.com/zhangjie201412/Flexcan to your android release.

Revision as of 02:31, 27 November 2018

CAN bus

Hardware Setup

Connect 2 boards with the appropriate cable.
File:CAN Bus Connection.png

Board A CAN_H --- CAN_H Board B
Board A CAN_L --- CAN_L Board B


Software Setup

Android current releases come with the canutils already installed. Set up the boards by running the following on each of them:

$ ip link set can0 up type can bitrate 125000

Then:
On board #A:

$ cansniffer can0

On board #B:

$ cansend can0 500#1E.10.10

Canbus at Framework - Android Java application

- If you want the application to use the canbus, you must port the framework level changes - Port https://github.com/zhangjie201412/Flexcan to your android release.