Android Canbus: Difference between revisions
From Variscite Wiki
No edit summary |
No edit summary |
||
Line 4: | Line 4: | ||
--> {{PageHeader|{{#var:HARDWARE_NAME}} - Android {{#var:ANDROID_NAME}} {{#var:ANDROID_VERSION}} Android Canbus}} {{DocImage|category1={{#var:HARDWARE_NAME}}|category2=Android}} __toc__ | --> {{PageHeader|{{#var:HARDWARE_NAME}} - Android {{#var:ANDROID_NAME}} {{#var:ANDROID_VERSION}} Android Canbus}} {{DocImage|category1={{#var:HARDWARE_NAME}}|category2=Android}} __toc__ | ||
==Hardware | == Hardware setup == | ||
Connect 2 boards like the following:<br> | Connect 2 boards like the following:<br> | ||
<u>Board A</u> <u>Board B</u> | <u>Board A</u> <u>Board B</u> | ||
CAN_H --- CAN_H | CAN_H --- CAN_H | ||
CAN_L --- CAN_L | CAN_L --- CAN_L | ||
GND ----- GND | GND ----- GND | ||
==Software | == Software setup == | ||
Android releases comes with the canutils pre-installed. | Android releases comes with the canutils pre-installed. | ||
Please use below commands either via serial terminal or via adb shell. | Please use below commands either via serial terminal or via adb shell. | ||
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> | ||
# ip link set can0 up type can bitrate 125000 | |||
Then:<br> | Then:<br> | ||
On board #A:<br> | On board #A:<br> | ||
# candump can0 | |||
On board #B:<br> | On board #B:<br> | ||
# cansend can0 500#1E.10.10 | |||
== | == CAN bus at Framework - Android Java application == | ||
If you want your application to use the CAN bus, you must port the framework level changes<br> | |||
Port https://github.com/zhangjie201412/Flexcan to your android release<br> |
Revision as of 13:15, 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:
# candump can0
On board #B:
# cansend can0 500#1E.10.10
CAN bus at Framework - Android Java application
If you want your application to use the CAN bus, you must port the framework level changes
Port https://github.com/zhangjie201412/Flexcan to your android release