summaryrefslogtreecommitdiffstats
path: root/docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level
diff options
context:
space:
mode:
authorgrowupboron <shankhoghosh123@gmail.com>2020-09-11 17:18:57 +0530
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2020-09-11 12:11:56 +0000
commit4aad369c9728061c97b3de792286e743ee884b09 (patch)
tree14bddddeab334e3fdbdcf29446a87aa11cf6cd97 /docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level
parent619a7e48085be1538c3b01eb93dcb9dc95bf0436 (diff)
Simplified doc-site generationjellyfish_9.99.4jellyfish/9.99.49.99.4
Updated theme to windmill Using Mkdocs static site generator Deployed on readthedocs Signed-off-by: growupboron <shankhoghosh123@gmail.com> Change-Id: If62eaaea1855c91b64f687900f54eba6bc1caee8 Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/documentation/+/25236 Reviewed-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org> Tested-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
Diffstat (limited to 'docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level')
-rw-r--r--docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/1_Architecture.md34
-rw-r--r--docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/2_Installation.md196
-rw-r--r--docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/3_Installation-J1939.md90
-rw-r--r--docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/4_Installation-ISOTP.md59
-rw-r--r--docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/5_Usage.md433
-rw-r--r--docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/images/CAN_bindings_communication.pngbin0 -> 43504 bytes
-rw-r--r--docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/images/CAN_level_mapping.pngbin0 -> 56087 bytes
-rw-r--r--docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/images/OpenXC_to_AGL.pngbin0 -> 84031 bytes
8 files changed, 812 insertions, 0 deletions
diff --git a/docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/1_Architecture.md b/docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/1_Architecture.md
new file mode 100644
index 0000000..4606568
--- /dev/null
+++ b/docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/1_Architecture.md
@@ -0,0 +1,34 @@
+---
+edit_link: ''
+title: Architecture presentation
+origin_url: >-
+ https://git.automotivelinux.org/apps/agl-service-can-low-level/plain/docs/1-Architecture.md?h=master
+---
+
+<!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/apis_services/master/agl-service-can-low-level-developer-guides-api-services-book.yml -->
+
+# AGL CAN binding architecture proposal
+
+It's meant to generate, from a JSON file describing CAN messages and diagnostic message \(OBD2 for now\), a cpp file to integrate with the project.
+
+Once generated binding is built with it and result will be a widget file to install on an AGL target system.
+
+![From OpenXC firmware to AGL binding](images/OpenXC_to_AGL.png)
+
+Bringing CAN management into the AGL project is more than allowing decode and print CAN messages, lot of tools can do that (Wireshark, CAN-utils, ...).
+
+The goal is to provide a common API and abstraction to the CAN bus then you can bring some more high level functionalities to the system.
+
+CAN binding will be separated in two parts:
+
+![CAN low and high level bindings mapping](images/CAN_level_mapping.png)
+
+- High level: Binding from which others applications will connect to.
+It will provides valuable access to the CAN bus by aggregate signals or providing new signals from several originals. For example, a signal exposing whether or not a door is open, no matter which one it is. Also, we can imagine an application which supervise if there is no one in the car but moving (1m, 2m ?) to alert the owner of an unexpected behavior. The high level binding will sends a single event representing that behavior to the application which in turn will send a phone message to.
+
+- Low level: Decode messages that transit and send event through **Application Framework** to the subscribers with human readable message. It provides some basic access to the bus + some basic mathematical, statistical features (last_values, min, max, timestamps, averaging) as well as basic filter to get discerning signal only (This part are not implemented yet in the low level).
+
+
+![Communication between CAN bindings and third applications](images/CAN_bindings_communication.png)
+
+Last but not least, the low level binding can be shipped as binary only using OpenXC inspired [AGL low level CAN binding Generator](https://gerrit.automotivelinux.org/gerrit/gitweb?p=src/low-level-can-generator.git;a=summary).
diff --git a/docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/2_Installation.md b/docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/2_Installation.md
new file mode 100644
index 0000000..ad7fedb
--- /dev/null
+++ b/docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/2_Installation.md
@@ -0,0 +1,196 @@
+---
+edit_link: ''
+title: Installation Guide
+origin_url: >-
+ https://git.automotivelinux.org/apps/agl-service-can-low-level/plain/docs/2-Installation.md?h=master
+---
+
+<!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/apis_services/master/agl-service-can-low-level-developer-guides-api-services-book.yml -->
+
+# Prerequisites
+
+* An AGL system installed with latest Daring Dab version with latest Application
+framework version >= 0.6.
+
+* Make sure you built the AGL generator else you will not be able to generate custom low-level CAN binding.
+
+It will produce a _application-generated.cpp_ file to paste in the source, _CAN-binder/low-can-binding/binding/_, directory.
+
+* Make sure you already set up the AGL SDK using the following [Download or Build Your SDK Installer](../../../getting_started/reference/getting-started/app-workflow-sdk.html). Alternatively, please refer to official guides available on [AGL Developer Site](../../../devguides).
+
+If you need to have the graphic stack inside your SDK, you have to prepare your environment with the **iotbzh**, or **Daring Dab** flavor using _prepare_meta_ tool. To do so, run the following command in your docker image in the step 4 in place of `... [ prepare build environment ] ...`:
+
+> **NOTE** These commands assume that proprietary graphic drivers for Renesas Porter board are located in _/home/devel/share/proprietary-renesas-rcar_ directory.
+
+```bash
+prepare_meta -f iotbzh -o /xdt -l /home/devel/mirror -p /home/devel/share/proprietary-renesas-rcar/ -t m3ulcb -e wipeconfig -e rm_work -e cleartemp
+/xdt/build/m3ulcb/agl-init-build-env
+```
+
+* (Optionnal) An [USB CAN adapter](https://shop.8devices.com/index.php?route=product/product&path=67&product_id=54) connected to connector through the [right cable](https://www.mouser.fr/ProductDetail/EasySync/OBD-M-DB9-F-ES?qs=pLQRQR43dtrcAQQLCUAIxA%3D%3D) if you want to connect to a real car through the OBD2 connector.
+
+<!-- pagebreak -->
+
+# Getting started
+
+## CAN config generator usage
+
+### Build requirements
+
+* CMake version 3.3 or later
+* G++, Clang++ or any C++11 compliant compiler.
+
+### Compile
+
+```bash
+source /xdt/sdk/environment-setup-aarch64-agl-linux
+export PATH=$PATH:/xdt/sdk/sysroots/x86_64-aglsdk-linux/usr/bin
+export WD=$(pwd)
+git clone --recursive https://gerrit.automotivelinux.org/gerrit/apps/agl-service-can-low-level -b Renesas_delivery_Q2
+git clone --recursive https://gerrit.automotivelinux.org/gerrit/apps/low-level-can-generator
+cd ${WD}/low-level-can-generator
+mkdir -p build
+cd build
+cmake -G "Unix Makefiles" ..
+make
+```
+
+### Naming convention
+
+We chose a doted naming convention because it's a well know schema.
+
+It separates and organize names into hierarchy. From the left to right, you describe your names using the more common ancestor at the left then more you go to the right the more it will be accurate.
+
+Let's take an example, here is an example about standard PID name following this convention:
+
+```
+engine.load
+engine.coolant.temperature
+fuel.pressure
+intake.manifold.pressure
+engine.speed
+vehicle.speed
+intake.air.temperature
+mass.airflow
+throttle.position
+running.time
+EGR.error
+fuel.level
+barometric.pressure
+commanded.throttle.position
+ethanol.fuel.percentage
+accelerator.pedal.position
+hybrid.battery-pack.remaining.life
+engine.oil.temperature
+engine.torque
+```
+
+> **NOTE** It's recommended that you follow this naming convention to named your CAN signals.
+>
+> There is only character `*` that is forbidden in names because it's used as wildcard for subscription and unsubscription.
+>
+> This described in the below chapter.
+
+### Available decoder
+
+You can use some basic decoder provided by default by the binding which are:
+
+* ***decoder_t::decode_noop*** : Default decoder if not specified, return raw value from signal's bitfield.
+* ***decoder_t::decode_boolean*** : Coerces a numerical value to a boolean.
+* ***decoder_t::decode_state*** : Find and return the corresponding string state for a CAN signal's raw integer value.
+
+### Generating JSON from Vector CANoe Database
+
+> **CAUTION** This chapter has not been tested since it haven't necessary automotive tools for that.
+
+If you use CANoe to store your `gold standard` CAN signal definitions, you may be able to use the OpenXC `xml_to_json.py` script to make your JSON for you. First, export the Canoe .dbc file as XML - you can do this with Vector CANdb++. Next, create a JSON file according to the format defined above, but only define:
+
+* CAN messages.
+* Name of CAN signals within messages and their generic_name.
+* Optionnaly name of diagnostic messages and their name.
+
+To install the OpenXC utilities and runs `xml_to_json.py` script:
+
+```bash
+sudo pip install openxc
+cd /usr/local/lib/python2.7/dist-packages/openxc/generator
+```
+
+Assuming the data exported from Vector is in `signals.xml` and your minimal mapping file is `mapping.json`, run the script:
+
+```bash
+python -m openxc.utils ./xml_to_json.py signals.xml mapping.json signals.json
+```
+
+The script scans `mapping.json` to identify the CAN messages and signals that you want to use from the XML file. It pulls the neccessary details of the messages (bit position, bit size, offset, etc) and outputs the resulting subset as JSON into the output file, `signals.json`.
+
+The resulting file together with `mapping.json` will work as input to the code generation script.
+
+### Generate your config file
+
+To generate your config file you just have to run the generator using the `-m` option to specify your JSON file.
+
+```bash
+./can-config-generator -m ../tests/basic.json -o application-generated.cpp
+```
+
+If you omit the `-o` option, then code is generated on the stdout.
+You also can specify a header and a footer file.
+These files must be valid C++ fragment as long as they will be inserted as is.
+Use the `-h` option to display help.
+
+> **CAUTION:** Each `diagnostic_message` must define the same `bus` as the binding will use only one bus.
+
+### Supported OpenXC items
+
+About now, compliance with OpenXC reference is in progress, can-config-generator and CAN\_signaling will implement them soon.
+`initializers`, `loopers`, `commands` and `handlers` nodes are ignored for now.
+
+This generator will follow OpenXC support status of the low level CAN signaling binding.
+
+> **NOTE**: The `buses` item will not be supported by this generator because the binding use another way to declare and configure buses. Please refer to the binding's documentation.
+
+## Compile and install the binding
+
+### Build requirements
+
+* Kernel >= 4.8
+* CMake version 3.3 or later
+* G++, Clang++ or any C++11 compliant compiler.
+
+### Compile
+
+Clone the binding repository, copy the generated file and updated the git submodules.
+
+Execute the following commands from this repository:
+
+```bash
+cd ${WD}/agl-service-can-low-level
+cp ${WD}/low-level-can-generator/build/application-generated.cpp ../low-can-binding/binding
+```
+
+### Installation
+
+```bash
+cd ${WD}/agl-service-can-low-level
+mkdir build
+cd build
+cmake ..
+make
+make widget
+```
+
+To install it manually, you need to copy the _low-can-service.wgt_ file on your target, then from it execute the following commands :
+
+On your host, to copy over the network :
+
+```bash
+scp low-can-service.wgt root@<target_IP>:~
+```
+
+On the target, assuming _**wgt**_ file is in the root home directory:
+
+```bash
+afm-util install low-can-service.wgt
+{ "added": "low-can-service@4.0" }
+```
diff --git a/docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/3_Installation-J1939.md b/docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/3_Installation-J1939.md
new file mode 100644
index 0000000..6ba03af
--- /dev/null
+++ b/docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/3_Installation-J1939.md
@@ -0,0 +1,90 @@
+---
+edit_link: ''
+title: Installation Guide for J1939
+origin_url: >-
+ https://git.automotivelinux.org/apps/agl-service-can-low-level/plain/docs/3-Installation-J1939.md?h=master
+---
+
+<!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/apis_services/master/agl-service-can-low-level-developer-guides-api-services-book.yml -->
+
+# Installation j1939 for AGL
+
+#### Minimum kernel version : 4.19
+
+## Compilation of kernel j1939
+
+##### Clone linux-can-next repository on kernel.org
+
+```bash
+git clone https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git/
+```
+
+##### Checkout on j1939 branch
+
+```bash
+git checkout j1939
+```
+
+##### Add the compilation of the j1939
+
+```bash
+make menuconfig
+ - Networking Support
+ - Can bus subsystem support
+ - <M> SAE J1939
+ - [*] debug SAE J1939
+```
+
+##### Compile
+
+```bash
+make
+```
+
+##### Install
+
+```bash
+make modules_install
+make install
+```
+
+##### Update grub
+
+###### CentOS/RHEL/Oracle/Scientific and Fedora Linux
+
+```bash
+grub2-mkconfig -o /boot/grub2/grub.cfg
+grubby --set-default /boot/vmlinuz-...
+reboot
+```
+
+###### Debian/Ubuntu Linux
+
+```bash
+update-grub
+reboot
+```
+
+##### Check if the installation is correct
+
+```bash
+modprobe can-j1939
+```
+
+If no errors are generated you have successfully install a kernel with j1939 module.
+
+You can have a problem with header file, to check that go in the file /usr/include/linux/can.h
+
+```bash
+vi /usr/include/linux/can.h
+```
+
+If in the struct sockaddr_can you don't see j1939, the header are not upgrade.
+
+So you need to do this manually, go to you're linux-can-next repository and do the following command:
+
+```bash
+cp include/uapi/linux/can.h /usr/include/linux/can.h
+cp include/uapi/linux/can/j1939.h /usr/include/linux/can/
+```
+
diff --git a/docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/4_Installation-ISOTP.md b/docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/4_Installation-ISOTP.md
new file mode 100644
index 0000000..066ef27
--- /dev/null
+++ b/docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/4_Installation-ISOTP.md
@@ -0,0 +1,59 @@
+---
+edit_link: ''
+title: Installation Guide for ISOTP
+origin_url: >-
+ https://git.automotivelinux.org/apps/agl-service-can-low-level/plain/docs/4-Installation-ISOTP.md?h=master
+---
+
+<!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/apis_services/master/agl-service-can-low-level-developer-guides-api-services-book.yml -->
+
+# Installation isotp for AGL
+
+## Compilation and installation of module kernel isotp
+
+##### Clone repository Linux Kernel Module for ISO 15765-2:2016 CAN transport protocol
+
+```bash
+git clone https://github.com/hartkopp/can-isotp.git
+```
+
+##### Move into the new repository
+
+```bash
+cd can-isotp
+```
+
+##### Install packages to build
+
+```bash
+sudo apt-get install build-essential linux-headers-$(uname -r)
+```
+
+##### Compile
+
+```bash
+make
+```
+
+##### Install
+
+```bash
+sudo make modules_install
+```
+
+##### Load module
+
+
+```bash
+modprobe can
+modprobe vcan
+sudo insmod ./net/can/can-isotp.ko
+```
+
+
+## Include headers files
+
+
+```bash
+sudo cp include/uapi/linux/can/isotp.h /usr/include/linux/can/
+``` \ No newline at end of file
diff --git a/docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/5_Usage.md b/docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/5_Usage.md
new file mode 100644
index 0000000..77aad7f
--- /dev/null
+++ b/docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/5_Usage.md
@@ -0,0 +1,433 @@
+---
+edit_link: ''
+title: Usage Guide
+origin_url: >-
+ https://git.automotivelinux.org/apps/agl-service-can-low-level/plain/docs/5-Usage.md?h=master
+---
+
+<!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/apis_services/master/agl-service-can-low-level-developer-guides-api-services-book.yml -->
+
+# Configure the AGL system
+
+## Virtual CAN device
+
+Connected to the target, here is how to load the virtual CAN device driver and
+set up a new vcan device :
+
+```bash
+modprobe vcan
+ip link add vcan0 type vcan
+ip link set vcan0 up
+```
+
+You also can named your linux CAN device like you want and if you need name it
+`can0` :
+
+```bash
+modprobe vcan
+ip link add can0 type vcan
+ip link set can0 up
+```
+
+## CAN device using the USB CAN adapter
+
+Using real connection to CAN bus of your car using the USB CAN adapter
+connected to the OBD2 connector.
+
+Once connected, launch `dmesg` command and search which device to use:
+
+```bash
+dmesg
+[...]
+[ 131.871441] usb 1-3: new full-speed USB device number 4 using ohci-pci
+[ 161.860504] can: controller area network core (rev 20120528 abi 9)
+[ 161.860522] NET: Registered protocol family 29
+[ 177.561620] usb 1-3: USB disconnect, device number 4
+[ 191.061423] usb 1-2: USB disconnect, device number 3
+[ 196.095325] usb 1-2: new full-speed USB device number 5 using ohci-pci
+[ 327.568882] usb 1-2: USB disconnect, device number 5
+[ 428.594177] CAN device driver interface
+[ 1872.551543] usb 1-2: new full-speed USB device number 6 using ohci-pci
+[ 1872.809302] usb_8dev 1-2:1.0 can0: firmware: 1.7, hardware: 1.0
+[ 1872.809356] usbcore: registered new interface driver usb_8dev
+```
+
+Here device is named `can0`.
+
+This instruction assuming a speed of 500000kbps for your CAN bus, you can try
+others supported bitrate like 125000, 250000 if 500000 doesn't work:
+
+```bash
+ip link set can0 type can bitrate 500000
+ip link set can0 up
+ip link show can0
+ can0: <NOARP, UP, LOWER_UP, ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
+ link/can
+ can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
+ bitrate 500000 sample-point 0.875
+ tq 125 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
+ sja1000: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..64 brp-inc 1
+ clock 16000000
+```
+
+On a Rcar Gen3 board, you'll have your CAN device as `can1` because `can0`
+already exists as an embedded device.
+
+The instructions will be the same:
+
+```bash
+ip link set can1 type can bitrate 500000
+ip link set can1 up
+ip link show can1
+ can0: <NOARP, UP, LOWER_UP, ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
+ link/can
+ can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
+ bitrate 500000 sample-point 0.875
+ tq 125 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
+ sja1000: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..64 brp-inc 1
+ clock 16000000
+```
+
+## Rename an existing CAN device
+
+You can rename an existing CAN device using following command and doing so move
+an existing `can0` device to anything else and then use another device as `can0`
+. For a Rcar Gen3 board do the following by example:
+
+```bash
+sudo ip link set can0 down
+sudo ip link set can0 name bsp-can0
+sudo ip link set bsp-can0 up
+```
+
+Then connect your USB CAN device that will be named `can0` by default.
+
+# Configure the binding
+
+The binding reads system configuration file _/etc/dev-mapping.conf_ at start to
+map logical name from signals described in JSON file to linux devices name
+initialized by the system.
+
+Edit file _/etc/dev-mapping.conf_ and add mapping in section `CANbus-mapping`.
+
+Default binding configuration use a CAN bus named `hs` so you need to map it to
+the real one, here are some examples:
+
+* Using virtual CAN device as described in the previous chapter:
+
+```ini
+[CANbus-mapping]
+hs="vcan0"
+ls="vcan1"
+```
+
+* Using real CAN device, this example assume CAN bus traffic will be on can0.
+
+```ini
+[CANbus-mapping]
+hs="can0"
+ls="can1"
+```
+
+* On a Rcar Gen3 board there is an embedded CAN device so `can0` already exists. So you might want to use your USB CAN adapter plugged to the OBD2 connector, in this case use `can1`:
+
+```ini
+[CANbus-mapping]
+hs="can1"
+```
+
+* You can use this configuration for j1939:
+
+```ini
+[CANbus-mapping]
+hs="can0"
+ls="can1"
+j1939="can2"
+```
+
+> **CAUTION VERY IMPORTANT:** Make sure the CAN bus\(es\) you specify in your
+> configuration file match those specified in your generated source file with
+> the `CAN-config-generator`.
+
+
+
+## Change name of ECU for J1939
+
+To change the name of an ECU to J1939, you must go to the file conf.d/cmake/config.cmake and modify the value at :
+
+
+```cmake
+# Define name for ECU
+set(J1939_NAME_ECU 0x1239)
+```
+
+
+
+# Run it, test it, use it.
+
+You can run the binding using **afm-util** tool, here is the classic way to go :
+
+```bash
+afm-util run low-can-service@4.0
+1
+```
+
+You can find instructions to use afm-util tool
+[here](../../reference/af-main/1-afm-daemons.html#using-afm-util),
+ as well as documentation about Application Framework.
+
+But you can't control nor interact with it because you don't know security
+token that **Application Framework** gaves it at launch.
+
+So, to test it, it is better to launch the binding manually. In the following
+example, it will use port **1234** and left empty security token for testing
+purpose:
+
+```bash
+afb-daemon --binding=/var/lib/afm/applications/low-can-service/4.0/lib/afb-low-can.so --rootdir=/var/lib/afm/applications/low-can-service/4.0/ --port=1234 --token=1
+NOTICE: binding [/usr/lib/afb/afb-dbus-binding.so] calling registering function afbBindingV1Register
+NOTICE: binding /usr/lib/afb/afb-dbus-binding.so loaded with API prefix dbus
+NOTICE: binding [/usr/lib/afb/authLogin.so] calling registering function afbBindingV1Register
+NOTICE: binding /usr/lib/afb/authLogin.so loaded with API prefix auth
+NOTICE: binding [/var/lib/afm/applications/low-can-service/4.0/libs//low-can-binding.so] calling registering function afbBindingV1Register
+NOTICE: binding /var/lib/afm/applications/low-can-service/4.0/libs//low-can-binding.so loaded with API prefix low-can
+NOTICE: Waiting port=1234 rootdir=/var/lib/afm/applications/low-can-service/4.0/
+NOTICE: Browser URL= http:/*localhost:1234
+```
+
+On another terminal, connect to the binding using previously installed
+**AFB Websocket CLI** tool:
+
+```bash
+afb-client-demo ws://localhost:1234/api?token=1
+```
+
+You will be on an interactive session where you can communicate directly with
+the binding API.
+
+The binding provides at this moment 2 verbs, _subscribe_ and _unsubscribe_,
+which can take argument by a JSON **event** object.
+
+The argument value is the CAN message **generic\_name** as described in the
+JSON file used to generate cpp file for the binding.
+
+To use the _**AFB Websocket CLI**_ tool, a command line will be like the
+following:
+
+```
+<api> <verb> <arguments>
+```
+
+Where:
+
+* API : _**low-can**_.
+* Verb : _**subscribe**_ or _**unsubscribe**_
+* Arguments : _**{ "event": "driver.doors.open" }**_
+
+## Subscription and unsubscription
+
+You can ask to subscribe to chosen CAN event with a call to _subscribe_ API
+verb with the CAN messages name as JSON argument.
+
+> **NOTE:** If no argument is provided, then you'll subscribe to all signals
+> at once.
+
+For example from a websocket session:
+
+```json
+low-can subscribe { "event": "doors.driver.open" }
+ON-REPLY 1:low-can/subscribe: {"jtype":"afb-reply","request":{"status":"success","uuid":"a18fd375-b6fa-4c0e-a1d4-9d3955975ae8"}}
+```
+
+Subscription and unsubscription can take wildcard in their _event_ value and are
+**case-insensitive**.
+
+To receive all doors events :
+
+```json
+low-can subscribe { "event" : "doors*" }
+ON-REPLY 1:low-can/subscribe: {"jtype":"afb-reply","request":{"status":"success","uuid":"511c872e-d7f3-4f3b-89c2-aa9a3e9fbbdb"}}
+```
+
+Then you will receive an event each time a CAN message is decoded for the event
+named _doors.driver.open_ with its received timestamp if available:
+
+```json
+ON-EVENT low-can/messages.doors.driver.open({"event":"low-can\/messages.doors.driver.open","data":{"name":"messages.doors.driver.open","value":true, "timestamp": 1505812906020023},"jtype":"afb-event"})
+```
+
+Notice that event shows you that the CAN event is named
+_messages.doors.driver.open_ but you ask for event about
+_doors.driver.open_.
+
+This is because all CAN messages or diagnostic messages are prefixed by the
+JSON parent node name, **messages** for CAN messages and
+**diagnostic\_messages** for diagnostic messages like OBD2.
+
+This will let you subscribe or unsubcribe to all signals at once, not
+recommended, and better make filter on subscribe operation based upon their type. Examples:
+
+```json
+low-can subscribe { "event" : "*speed*" } --> will subscribe to all messages with speed in their name. Search will be make without prefix for it.
+low-can subscribe { "event" : "speed*" } --> will subscribe to all messages begin by speed in their name. Search will be make without prefix for it.
+low-can subscribe { "event" : "messages*speed*" } --> will subscribe to all CAN messages with speed in their name. Search will be on prefixed messages here.
+low-can subscribe { "event" : "messages*speed" } --> will subscribe to all CAN messages ending with speed in their name. Search will be on prefixed messages here.
+low-can subscribe { "event" : "diagnostic*speed*" } --> will subscribe to all diagnostic messages with speed in their name. Search will be on prefixed messages here.
+low-can subscribe { "event" : "diagnostic*speed" } --> will subscribe to all diagnostic messages ending with speed in their name. Search will be on prefixed messages here.
+```
+
+You can also subscribe to an event with the ID or the PGN of the message definition :
+
+
+```json
+low-can subscribe {"id" : 1568}
+low-can subscribe {"pgn" : 61442}
+```
+
+And subscribe to all ID or PGN :
+
+```json
+low-can subscribe {"id" : "*"}
+low-can subscribe {"pgn" : "*"}
+```
+
+
+You can stop receiving event from it by unsubscribe the signal the same way you did for subscribe
+
+```json
+low-can unsubscribe { "event": "doors.driver.open" }
+ON-REPLY 2:low-can/unsubscribe: {"jtype":"afb-reply","request":{"status":"success"}}
+low-can unsubscribe { "event" : "doors*" }
+ON-REPLY 3:low-can/unsubscribe: {"jtype":"afb-reply","request":{"status":"success"}}
+```
+
+### Filtering capabilities
+
+It is possible to limits received event notifications into minimum and maximum
+boundaries as well as doing frequency thinning. This is possible using the
+argument filter with one or more of the filters available :
+
+* frequency: specify in Hertz the frequency which will be used to getting
+ notified of new CAN events for the designated signal. If, during the blocked
+ time, further changed CAN messages are received, the last valid one will be
+ transferred after the lockout with a RX_CHANGED.
+* min: Minimum value that the decoded value needs to be above to get pushed to
+ the subscribed client(s).
+* max: Maximum value that the decoded value needs to be below to get pushed to
+ the subscribed client(s)
+* rx_id : For the ISO TP protocol, define the id of source to write a message
+* tx_id : For the ISO TP protocol, define the id of emitter to receive message
+
+Order doesn't matter neither the number of filters chosen, you can use one, two
+or all of them at once.
+
+Usage examples :
+
+```json
+low-can subscribe {"event": "messages.engine.speed", "filter": { "frequency": 3, "min": 1250, "max": 3500}}
+low-can subscribe {"event": "messages.engine.load", "filter": { "min": 30, "max": 100}}
+low-can subscribe {"event": "messages.vehicle.speed", "filter": { "frequency": 2}}
+# ISOTP
+low-can subscribe {"id": 273, "filter": {"tx_id" : 562}}
+```
+
+## Get last signal value and list of configured signals
+
+You can also ask for a particular signal value on one shot using **get** verb, like
+this:
+
+```json
+low-can get {"event": "messages.engine.speed"}
+ON-REPLY 1:low-can/get: {"response":[{"event":"messages.engine.speed","value":0}],"jtype":"afb-reply","request":{"status":"success"}}
+```
+
+> **CAUTION** Only one event could be requested.
+
+Also, if you want to know the supported CAN signals loaded by **low-can**, use
+verb **list**
+
+```json
+low-can list
+ON-REPLY 2:low-can/list: {"response":["messages.hvac.fan.speed","messages.hvac.temperature.left","messages.hvac.temperature.right","messages.hvac.temperature.average","messages.engine.speed","messages.fuel.level.low","messages.fuel.level","messages.vehicle.average.speed","messages.engine.oil.temp","messages.engine.oil.temp.high","messages.doors.boot.open","messages.doors.front_left.open","messages.doors.front_right.open","messages.doors.rear_left.open","messages.doors.rear_right.open","messages.windows.front_left.open","messages.windows.front_right.open","messages.windows.rear_left.open","messages.windows.rear_right.open","diagnostic_messages.engine.load","diagnostic_messages.engine.coolant.temperature","diagnostic_messages.fuel.pressure","diagnostic_messages.intake.manifold.pressure","diagnostic_messages.engine.speed","diagnostic_messages.vehicle.speed","diagnostic_messages.intake.air.temperature","diagnostic_messages.mass.airflow","diagnostic_messages.throttle.position","diagnostic_messages.running.time","diagnostic_messages.EGR.error","diagnostic_messages.fuel.level","diagnostic_messages.barometric.pressure","diagnostic_messages.ambient.air.temperature","diagnostic_messages.commanded.throttle.position","diagnostic_messages.ethanol.fuel.percentage","diagnostic_messages.accelerator.pedal.position","diagnostic_messages.hybrid.battery-pack.remaining.life","diagnostic_messages.engine.oil.temperature","diagnostic_messages.engine.fuel.rate","diagnostic_messages.engine.torque"],"jtype":"afb-reply","request":{"status":"success","uuid":"32df712a-c7fa-4d58-b70b-06a87f03566b"}}
+```
+
+## Write on CAN buses
+
+Two modes could be used for that which is either specifying the CAN bus and a
+*RAW* CAN message either by specifying a defined signal, **case-insensitively**,
+and its value.
+
+Examples:
+
+```json
+# Authentification
+low-can auth
+# Write a raw can frame to the CAN id 0x620
+low-can write { "bus_name": "hs", "frame": { "can_id": 1568, "can_dlc": 8, "can_data": [ 255, 255, 255, 255, 255, 255, 255, 255]} }
+# Write a signal's value.
+low-can write { "signal_name": "engine.speed", "signal_value": 1256}
+# Write J1939 'single frame'
+low-can write { "bus_name": "j1939", "frame": { "pgn": 61442, "length":8, "data": [ 255, 255, 255, 255, 255, 255, 255, 255]} }
+# Write J1939 'multi frame'
+low-can write { "bus_name": "j1939", "frame": { "pgn": 61442, "length":9, "data": [ 255, 255, 255, 255, 255, 255, 255, 255, 254]} }
+# Write ISOTP 'single frame'
+low-can write {"bus_name": "hs", "filter": {"rx_id" : 562}, "frame": { "can_id": 273, "can_dlc": 8, "can_data": [ 255, 255, 255, 255, 255, 255, 255, 255]} }
+# Write ISOTP 'multi frame'
+low-can write {"bus_name": "hs", "filter": {"rx_id" : 562}, "frame": { "can_id": 273, "can_dlc": 9, "can_data": [ 255, 255, 255, 255, 255, 255, 255, 255, 25]} }
+```
+
+To be able to use write capability, you need to add the permission
+ ```urn:AGL:permission::platform:can:write``` to your package configuration
+ file that need to write on CAN bus through **low-can** api.
+
+Then in order to write on bus, your app needs to call verb **auth**
+before calling **write**, to raise its **LOA**, Level Of Assurance,
+which controls usage of verb **write**.
+
+## Using CAN utils to monitor CAN activity
+
+You can watch CAN traffic and send custom CAN messages using can-utils
+preinstalled on AGL target.
+
+To watch watch going on a CAN bus use:
+
+```bash
+candump can0
+```
+
+Or for an USB CAN adapter connected to porter board:
+
+```bash
+candump can1
+```
+
+Send a custom message:
+
+```bash
+cansend can0 ID#DDDDAAAATTTTAAAA
+```
+
+You can also replay a previously dumped CAN logfiles. These logfiles can be
+found in _can_samples_ directory under Git repository. Following examples use
+a real trip from an Auris Toyota car.
+
+Trace has been recorded from a CAN device `can0` so you have to map it to the
+correct one you use for your tests.
+
+Replay on a virtual CAN device `vcan0`:
+
+```bash
+canplayer -I trip_test_with_obd2_vehicle_speed_requests vcan0=can0
+```
+
+Replay on a CAN device `can0`:
+
+```bash
+canplayer -I trip_test_with_obd2_vehicle_speed_requests can0
+```
+
+Replay on a CAN device `can1` (porter by example):
+
+```bash
+canplayer -I trip_test_with_obd2_vehicle_speed_requests can1=can0
+```
diff --git a/docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/images/CAN_bindings_communication.png b/docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/images/CAN_bindings_communication.png
new file mode 100644
index 0000000..426e2f7
--- /dev/null
+++ b/docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/images/CAN_bindings_communication.png
Binary files differ
diff --git a/docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/images/CAN_level_mapping.png b/docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/images/CAN_level_mapping.png
new file mode 100644
index 0000000..1f1d906
--- /dev/null
+++ b/docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/images/CAN_level_mapping.png
Binary files differ
diff --git a/docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/images/OpenXC_to_AGL.png b/docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/images/OpenXC_to_AGL.png
new file mode 100644
index 0000000..6e40336
--- /dev/null
+++ b/docs/4_APIs_and_Services/4.5_Message_Signaling/2_AGL_Service_CAN_Low_Level/images/OpenXC_to_AGL.png
Binary files differ