2

尝试使用can-utils重放 2018 Dodge Promaster 的 CAN 代码。根据我的阅读,他们使用 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?

4

2 回答 2

1

您可以使用带有过滤选项的 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)
于 2019-08-29T12:24:25.507 回答
1

您不能强制 candump 使用 11 位 ID,因为帧格式由仲裁字段中的位定义(参见Wikipedia - CAN bus,“数据帧”小节)。快速浏览您链接的文章后,我看到汽车型号是 2000 年代的,而您的汽车是 2018 年的。在此期间可能进行了许多更改。

总之:你的问题不是一个,而是你的文章太旧了,和你的车不匹配。

于 2019-06-18T17:02:29.783 回答