お世話になります。
raspberry pi 3B+とmcp2515とTJA1050を含めたcANbusモジュールを利用して
車とCAN通信を行おうと思ってます。
参考サイトは以下です。
https://qiita.com/mt08/items/535ab4690eecbcf5375d#
機器の施工(特にmcp2515への3.3v供給)はできていると思うのですが
実際ラズパイ上でifconfigコマンドを行うと(不明なネット)という文面も
出てきて上手く通信ができているのかわかりません。
以下シェル上の表示です。
pi@raspberrypi:~
1pi@raspberrypi:~ $ dmesg | grep spi 2[ 5.582520] mcp251x spi0.0 can0: MCP2515 successfully initialized. 3pi@raspberrypi:~ $ sudo ip link set can0 type can bitrate 500000 4pi@raspberrypi:~ $ ifconfig can0 5can0: flags=128<NOARP> mtu 16 6 unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (不明なネット) 7 RX packets 0 bytes 0 (0.0 B) 8 RX errors 0 dropped 0 overruns 0 frame 0 9 TX packets 0 bytes 0 (0.0 B) 10 TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 11 12pi@raspberrypi:~ $ cd can-utils 13pi@raspberrypi:~/can-utils $ ./candump -cae-t z can0,0:0,#FFFFFFF 14./candump: invalid option -- '-' 15 16Usage: candump [options] <CAN interface>+ 17 (use CTRL-C to terminate candump) 18 19Options: -t <type> (timestamp: (a)bsolute/(d)elta/(z)ero/(A)bsolute w date) 20 -H (read hardware timestamps instead of system timestamps) 21 -c (increment color mode level) 22 -i (binary output - may exceed 80 chars/line) 23 -a (enable additional ASCII output) 24 -S (swap byte order in printed CAN data[] - marked with '`' ) 25 -s <level> (silent mode - 0: off (default) 1: animation 2: silent) 26 -l (log CAN-frames into file. Sets '-s 2' by default) 27 -L (use log file format on stdout) 28 -n <count> (terminate after reception of <count> CAN frames) 29 -r <size> (set socket receive buffer to <size>) 30 -D (Don't exit if a "detected" can device goes down. 31 -d (monitor dropped CAN frames) 32 -e (dump CAN error frames in human-readable format) 33 -x (print extra message infos, rx/tx brs esi) 34 -T <msecs> (terminate after <msecs> without any reception) 35 36Up to 16 CAN interfaces with optional filter sets can be specified 37on the commandline in the form: <ifname>[,filter]* 38 39Comma separated filters can be specified for each given CAN interface: 40 <can_id>:<can_mask> (matches when <received_can_id> & mask == can_id & mask) 41 <can_id>~<can_mask> (matches when <received_can_id> & mask != can_id & mask) 42 #<error_mask> (set error frame filter, see include/linux/can/error.h) 43 [j|J] (join the given CAN filters - logical AND semantic) 44 45CAN IDs, masks and data content are given and expected in hexadecimal values. 46When the can_id is 8 digits long the CAN_EFF_FLAG is set for 29 bit EFF format. 47Without any given filter all data frames are received ('0:0' default filter). 48 49Use interface name 'any' to receive from all CAN interfaces. 50 51Examples: 52candump -c -c -ta can0,123:7FF,400:700,#000000FF can2,400~7F0 can3 can8 53candump -l any,0~0,#FFFFFFFF (log only error frames but no(!) data frames) 54candump -l any,0:0,#FFFFFFFF (log error frames and also all data frames) 55candump vcan2,12345678:DFFFFFFF (match only for extended CAN ID 12345678) 56candump vcan2,123:7FF (matches CAN ID 123 - including EFF and RTR frames) 57candump vcan2,123:C00007FF (matches CAN ID 123 - only SFF and non-RTR frames) 58 59pi@raspberrypi:~/can-utils $ 60 61
どなたかご経験のある方いましたら教えていただけますでしょうか。
最終的には車とのCAN通信でROMデータ吸い取りができたらいいなぁと
思っております。
ご教授よろしくお願いします。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。