0

在 Revolution Pi 上使用 CANopen 我有来自 MLS(磁力线传感器)的数据,但是接收到的数据对于需要来说太慢了,因为更新需要即时。我需要做什么才能使数据更新更快?

CAN 设置使用:

sudo ip link set can0 type can bitrate 125000
sudo ip link set can0 up
candump can0 -td

我使用 Python-can 库创建了一个基本程序来调查它是否会更快地轮询:

import can

can_interface = 'can0'
bus = can.interface.Bus(can_interface, bustype='socketcan')

while 1 < 2:
    bus.flush_tx_buffer()
    message = bus.recv()
    print(message)

打印的数据消息数据(类似于 candump 的数据)应该在一秒钟内多次发布新消息,但是我在来自传感器的消息之间等待 <1 秒到 > 10 分钟

4

1 回答 1

0

在尝试了不同的 MLS 传感器后,数据每 0.01 秒发布一次,这是理想的速度。因此,原始传感器肯定存在未知错误,但这确实适用于 CANET-2(CAN 到以太网)设备

于 2019-07-26T12:36:42.483 回答