.. _can-bus: CAN Bus ^^^^^^^^^^^^^^ This gateway features up to two CAN 2.0B ports: * ``canE``: permanent; always enabled and accessible * ``canC``: optional; always enabled, but accessible only when the CAN I/O module is installed Interface configuration """""""""""""""""""""""" Configure the CAN interface bitrate to 1 Mbit/sec:: $ sudo ip link set canE type can bitrate 1000000 Enable the CAN interface:: $ sudo ip link set canE up Send/receive packets """""""""""""""""""""" Send standard CAN frame (on the first device): .. code:: console $ sudo cansend canE 111#1122334455667788 Send extended CAN frame (on the first device): .. code:: console $ sudo cansend canE 11111111#1122334455667788 Example of CAN frame generator (extended mode) with random payload and 50 msec interval between successive frames: .. code:: console $ sudo cangen -g 50 -e -D r -v canE ... canE 1E5137F4#0F.4D.8B.7A.25.4D.DB.21 canE 1B6C965C#8C.DE.96.58.69.5F.D5.26 canE 1BD23086#8D.DB.C4.3E.81.57.BA.34 canE 127B2322#F4.16.31.2E.34.04.62 canE 1A6366DB#A8.73.C0.37.D8 canE 03620EE4# canE 023AC34D#C6.08.BD.2A.04.B3.BF.43 canE 1C19AD2E#09.C1.B3.26.23.E5.6A.5A canE 02BCA994#48.32.46.7C.F0.3F.29.1E canE 08104C67#59.9F.FE.44 canE 1C280582#6F.D4.9C.38.A5.28.A3 canE 0BC219EE#D9.2C.05 canE 04AA80B8#A1.93 canE 1A3E2392#AD.98 canE 0025950E#E3.99.38 ... Dump all received data frames as well as error frames: .. code:: console $ sudo candump any,0:0,#FFFFFFFF ... canE 0CC89C1A [1] 51 canE 0A097EFB [0] canE 02B59BD5 [5] 68 6F 47 64 D9 canE 03743A1E [7] FA BF E4 38 3E BF C8 canE 13C9B644 [8] 30 FB 60 6F E1 FC 55 65 canE 018A8975 [0] canE 0C9C8179 [0] canE 011F5D90 [6] 65 DB DD 5A AA F9 canE 07B7FD18 [6] CC 96 26 1D 13 7C canE 1FBD7177 [8] 69 BF 8D 1E 4C 0D 73 02 canE 107A7E2D [2] 25 D3 canE 12B9E279 [8] 89 77 B7 54 BD 98 83 06 canE 112A44EA [8] 9E 95 D9 6B 60 CE B4 52 canE 0ADF9869 [3] C8 A0 27 canE 1580C274 [5] B2 7A F7 43 04 canE 06DDDBCC [7] AF 19 88 04 E4 D8 95 canE 127FA5CE [8] F7 54 57 20 45 17 3D 12 canE 09A37893 [0] canE 01BA4332 [6] 0B AF 0C 2E AB 25 canE 180A8AD5 [5] 68 BE F7 5A C0 canE 06DC994E [7] 20 9E E9 7B B8 31 BC ...