Candump显示29位ID而不是11位 - 不能重放代码

时间:2018-02-21 19:18:10

标签: can-bus socketcan canutils

尝试使用can-utils重播2018道奇Promaster的CAN代码。从I've read他们使用11位CAN ID。但是,当我使用:

candump -L can0 > can.log

日志显示29位ID

(1519238827.107818) can0 04394100#00000000F0006000
(1519238827.122395) can0 063D4000#4652000080FE0000
(1519238827.126761) can0 04394000#000000AB
(1519238827.147822) can0 03029000#0000000000000000
(1519238827.152676) can0 06254000#00FFFF00FFFFFF00
(1519238827.157823) can0 03029100#0000000000000000
(1519238827.207842) can0 04394100#00000000F0006000
(1519238827.222727) can0 06314000#0000000000000000
(1519238827.226953) can0 04394000#000000AB
(1519238827.244633) can0 0E094000#001A00000409
(1519238827.247843) can0 03029000#0000000000000000
(1519238827.249614) can0 0E094003#001A
(1519238827.251375) can0 0E094020#000A
(1519238827.253121) can0 0E09400A#001A
(1519238827.254935) can0 0621400A#0000
(1519238827.257940) can0 03029100#0000000000000000
(1519238827.262128) can0 06314020#100000BC

我认为这就是为什么用canplayer重播不起作用的原因。有谁知道我怎么能强迫candump使用11位ID?

2 个答案:

答案 0 :(得分:0)

您不能强制转储使用11位ID,因为帧格式是由仲裁字段中的一位定义的(参见Wikipedia - CAN bus,“数据帧”子节)。快速浏览一下您链接的文章后,我发现该车的型号是2000年代的,而您的车是2018年的。同时,可能已进行了很多更改。

总而言之:您的问题不是一个,而是您的文章太旧且与您的汽车不匹配。

答案 1 :(得分:0)

您可以将candump命令与过滤器选项配合使用,如下所示:

  Up to 16 CAN interfaces with optional filter sets can be specified
    on the commandline in the form: <ifname>[,filter]*

    Comma separated filters can be specified for each given CAN interface:
     <can_id>:<can_mask> (matches when <received_can_id> & mask == can_id & mask)
     <can_id>~<can_mask> (matches when <received_can_id> & mask != can_id & mask)
     #<error_mask>       (set error frame filter, see include/linux/can/error.h)
     [j|J]               (join the given CAN filters - logical AND semantic)

    CAN IDs, masks and data content are given and expected in hexadecimal values.
    When can_id and can_mask are both 8 digits, they are assumed to be 29 bit EFF.
    Without any given filter all data frames are received ('0:0' default filter).

    Use interface name 'any' to receive from all CAN interfaces.

    Examples:
    candump -c -c -ta can0,123:7FF,400:700,#000000FF can2,400~7F0 can3 can8
    candump -l any,0~0,#FFFFFFFF    (log only error frames but no(!) data frames)
    candump -l any,0:0,#FFFFFFFF    (log error frames and also all data frames)
    candump vcan2,92345678:DFFFFFFF (match only for extended CAN ID 12345678)
    candump vcan2,123:7FF (matches CAN ID 123 - including EFF and RTR frames)
    candump vcan2,123:C00007FF (matches CAN ID 123 - only SFF and non-RTR frames)