0
我想从USB OBD接收数据,我使用覆盆子PI3 ..这里是我的简单的代码:AttributeError的:“串行”对象有没有属性“in_waiting
import obd
connection = obd.OBD() # auto-connects to USB or RF port
cmd = obd.commands.RPM # select an OBD command (sensor)
response = connection.query(cmd) # send the command
print(response) # "2410 RPM"
当我开始运行代码我得到这个错误:
: AttributeError: 'Serial' object has no attribute 'in_waiting'
我该如何解决这个问题?
感谢您的回复..是的,我的pyserial版本是2.6,但是当我通过'python -m pip install pyserial --upgrade'升级pyserial时,它告诉我我使用的是最新版本(2.6)错误只出现在我当我在python 3.4上运行它,但是当我使用Python 2.7代码工作良好 –