| | 1 | [[PageOutline(1-10,Contents)]] |
| | 2 | |
| | 3 | = CanGateway plugin = |
| | 4 | |
| | 5 | == Goal == |
| | 6 | |
| | 7 | The CanGateway plugin is in charge of interfacing a CAN bus and it manages the CAN card. |
| | 8 | |
| | 9 | == Driver installation == |
| | 10 | |
| | 11 | === Linux driver === |
| | 12 | |
| | 13 | The supported driver are: |
| | 14 | - socketCAN |
| | 15 | - kvaser card (USB, PCI, PCIe,...) |
| | 16 | |
| | 17 | First of all, follow the README in source:pacpussensors/trunk/CanGateway/driver/kvaser/linuxcan.tar.gz in order to install the kvaser driver. |
| | 18 | |
| | 19 | ''Note that this procedure blacklist the SocketCAN driver.'' |
| | 20 | |
| | 21 | To check if the KVASER driver is properly installed, type in a terminal {{{lsmod | grep kv}}}. |
| | 22 | You must see a kvaser driver running: |
| | 23 | {{{ |
| | 24 | #!sh |
| | 25 | $ lsmod | grep kv |
| | 26 | kvm 452088 0 |
| | 27 | kvpcican 43541 0 |
| | 28 | }}} |
| | 29 | |
| | 30 | If the automatic loading of the driver doesn't work at startup, you can add the file {{{kvaser.conf}}} containing this text: |
| | 31 | {{{ |
| | 32 | # kvaser module load |
| | 33 | kvpcican |
| | 34 | }}} |
| | 35 | in the {{{/etc/modules-load.d}}} folder. |
| | 36 | |
| | 37 | |
| | 38 | === Windows driver === |
| | 39 | |
| | 40 | TODO |
| | 41 | |
| | 42 | |
| | 43 | == Compilation == |
| | 44 | |
| | 45 | First, make sure the CMakeList.txt at the root of the directory is well configured (into trunk/). In order to install the CanGateway plugin, modify the file and verify you have the following line : |
| | 46 | {{{ |
| | 47 | #!sh |
| | 48 | add_subdirectory(CanGateway) |
| | 49 | }}} |
| | 50 | |
| | 51 | Also, the environment variable $PACPUS_ROOT must point to the pacpus installation directory (you normally already set it when you installed PACPUS). |
| | 52 | |
| | 53 | |
| | 54 | Then we need to configure the installation : |
| | 55 | {{{ |
| | 56 | #!sh |
| | 57 | $ export PACPUS_ROOT=/opt/pacpus/0.2.3 # Pacpus Framework path |
| | 58 | $ cd trunk/build/ # first go into the build folder |
| | 59 | $ cmake .. |
| | 60 | }}} |
| | 61 | |
| | 62 | Now we can compile and install : |
| | 63 | {{{ |
| | 64 | #!sh |
| | 65 | $ sudo make install |
| | 66 | }}} |
| | 67 | |
| | 68 | Make sure the executable files you just created are copied into $PACPUS_ROOT/lib/. |
| | 69 | |
| | 70 | |
| | 71 | = Execution = |
| | 72 | |
| | 73 | In order to work with the plugins we want, PACPUS needs an XML file. |
| | 74 | |
| | 75 | == XML configuration == |
| | 76 | |
| | 77 | Put an example xml file. |
| | 78 | |
| | 79 | Fields: |
| | 80 | - source ... |
| | 81 | - speed ... |
| | 82 | |
| | 83 | == Running the plugin == |
| | 84 | |
| | 85 | Please verify that you have a working pacpus installation on your system: refer to the GettingStarted page. |
| | 86 | |
| | 87 | === Testing under Linux === |
| | 88 | |
| | 89 | Run the plugin with this command: |
| | 90 | |
| | 91 | {{{ |
| | 92 | cd $PACPUS_ROOT |
| | 93 | ./PacpusSensor can.xml |
| | 94 | }}} |
| | 95 | |
| | 96 | === Testing under Windows === |
| | 97 | |
| | 98 | TODO |