4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[ビルドメモ] cantools - Raspberry Pi

Last updated at Posted at 2016-06-14

概要

  • cantoolsをラズパイでビルドのメモ
    cantools is a set of command line tools for dealing with DBC, ASC, and MDF files. The tools can be used to analyze and convert the data to other formats. Shared libraries for parsing and accessing these files are also provided.

    cantoolsはDBC、ASC、およびMDFファイルを扱うためのコマンドラインツールのセットです。ツールは、分析し、他の形式にデータを変換するために使用することができます。これらのファイルを解析し、アクセスするための共有ライブラリも提供されます。 (グーグル翻訳)

  • 関連: [メモ] オープンソースのcantools の libcandbcで、.dbcファイルの読み込み

  • cantools-0.15.tar.gzでは、ファイルが足りない? (fileFormat.hとか)
    => svnから取得

  • libmatioとか、hdf5がないとかでエラー
    => sudo apt-get install libmatio-dev

  • compileとか test-driverがないとかでエラー
    => cantools-0.15.tar.gzに含まれているのをコピー

  • リンクエラー
    => ヘッダファイルの、inline void*inline static void*

  • # can-utilsは socketcanとかにつかうやつ。

環境

  • 2016-05-27-raspbian-jessie-lite.img

手順

sudo apt-get install -y libmatio-dev check automake libtool bison flex
sudo apt-get install -y subversion

svn checkout svn://svn.code.sf.net/p/cantools/code/trunk cantools-code -r 57
wget  -O cantools-0.15.tar.gz https://sourceforge.net/projects/cantools/files/cantools-src/0.15/cantools-0.15.tar.gz/download
tar xf cantools-0.15.tar.gz
cp ./cantools-0.15/{compile,test-driver} cantools-code/.
cd cantools-code

#パッチ 
sed -i 's/inline/inline\ static/g' src/hashtable/hashtable_itr.h
#
libtoolize --force
autoconf -i -f
./configure LDFLAGS="-L/usr/lib/arm-linux-gnueabihf/hdf5/serial"
make
make check

その他

テスト用に、j1939_utf8.dbcとかぐぐるといいかも。

dbcls

pi@raspberrypi:~/cantools-code $ ./dbcls --help
Usage: dbcls [OPTION] -d dbcfile
List information about dbcfile.

Options:
  -N, --networks             list networks
  -n, --nodes                list nodes
  -e, --envvars              list environment variables
  -m, --messages             list messages
  -s, --signals              list signals
      --verbose              verbose output
      --brief                brief output (default)
      --help     display this help and exit
pi@raspberrypi:~/cantools-code $ ./dbcls -m -d ./j1939_utf8.dbc 
$C0000000;VECTOR__INDEPENDENT_SIG_MSG;0;Vector__XXX;"This is a message for not used signals, created by Vector CANdb++ DBC OLE DB Provider.";;
$88F02DFE;AccelerationSensor;7;Vector__XXX;"The acceleration sensor message shall provide a measurement of the vehicle's acceleration in the lateral, longitudinal,
and vertical axes.";  GenMsgCycleTime = 10 (INT)  GenMsgSendType = 0 (INT)  VFrameFormat = 3 (INT);
$98FCEAFE;VEP4;8;Vector__XXX;"Vehicle Electrical Power #4";  VFrameFormat = 3 (INT);
...
...
...
$9CFDA7FE;VROM;8;Vector__XXX;"Voltage Regulator Operating Mode";  GenMsgCycleTime = 1000 (INT)  GenMsgSendType = 0 (INT)  VFrameFormat = 3 (INT);
$8CFDA6FE;VREP;8;Vector__XXX;"Voltage regulator excitation status";  GenMsgCycleTime = 100 (INT)  GenMsgSendType = 0 (INT)  VFrameFormat = 3 (INT);
pi@raspberrypi:~/cantools-code $ 
4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?