Android Canbus: Difference between revisions
From Variscite Wiki
No edit summary |
No edit summary |
||
(9 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{PageHeader|CAN bus}} | <!-- Set release according to "release" parameter in URL and use RELEASE_N7.1.1_1.0.0_VAR-SOM-MX6 as default | ||
{{DocImage|category1= | --> {{#vardefine:RELEASE_PARAM|{{#urlget:release}}}} <!-- | ||
--> {{#lst:Android_Platform_Customization|{{#var:RELEASE_PARAM|RELEASE_N7.1.1_1.0.0_VAR-SOM-MX6}}}} <!-- | |||
--> {{PageHeader|{{#var:HARDWARE_NAME}} - Android {{#var:ANDROID_NAME}} {{#var:ANDROID_VERSION}} - CAN bus}} {{DocImage|category1=Android|category2=VAR-SOM-MX6}}[[Category:DART-MX8M]][[Category:DART-MX8M-MINI]][[Category:VAR-SOM-MX8X]][[Category:VAR-SOM-MX8]] __toc__ | |||
Connect 2 boards | == Hardware setup == | ||
Connect 2 boards like the following:<br> | |||
<u>Board A</u> <u>Board B</u> | |||
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:<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 | On board A:<br> | ||
< | # candump can0 | ||
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> | |||
< |
Latest revision as of 09:52, 1 January 2020
VAR-SOM-MX6 - Android Nougat N7.1.1 - CAN bus
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