Android Canbus: Difference between revisions

From Variscite Wiki
Line 6: Line 6:
==Hardware Setup ==
==Hardware Setup ==


Connect 2 boards with the appropriate cable.<br>
Connect 2 boards like the following:<br>
[[File:CAN_Bus_Connection.png|600px]]
<u>'''Board A'''</u>  <u>'''Board B'''</u>
 
  CAN_H --- CAN_H
Board A CAN_H --- CAN_H Board B <br>
  CAN_L --- CAN_L
Board A CAN_L --- CAN_L Board B <br>
  GND ----- GND
 


==Software Setup==
==Software Setup==

Revision as of 12:23, 29 December 2019

VAR-SOM-MX6 - Android Nougat N7.1.1 Android Canbus

Hardware Setup

Connect 2 boards like the following:

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

Software Setup

Android releases comes with the canutils pre-installed. Please use below commands either via serial terminal or via adb shell.

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.