在 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 分钟