如何与OBD-II设备通信 [英] How to communicate with OBD-II device

查看:792
本文介绍了如何与OBD-II设备通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

OBD-II 设备,如 http://www.rczd.com/c/2015/Car_Diagnostic_Tools_0223/41193.html
此设备提供商没有其网页或文档来源。我们在框中有简短的快速启动,并保证它支持 OBD-II PID

最近我曾经关注 https ://en.wikipedia.org/wiki/OBD-II_PIDs#Mode_1_PID_41

问题是,如果有任何一般模式如何与此沟通icar设备。

The question is, if there are any general pattern how to communicate with this icar device.

在我习惯连接(freematics)加密狗之前,我发送了数据流我在飞行中解析。

Before I've used to connect with (freematics)dongle that has send the stream of data which I've parsed on fly.

我们发送给它的一个请求后,当前只发送一个值(它是同步的,每次不能处理多个请求)。

Current one send only one value after one request we send to it (it is synchronous and can't handle more than one request per time).

我想获得最新的 OBD-II 参数来显示它们(经常)。

I would like to get up-to-date OBD-II params to display them(frequently).

任何想法?

推荐答案

如果您的设备与ELM327兼容,您可以使用多个PID请求但仅当适配器通过CAN协议连接到车辆时。所以它只适用于一部分车辆,因为并非所有车辆都支持CAN。

If your device is compatible with the ELM327 you can use multiple PID requests but only if adapter is connected to the vehicle with CAN protocol. So it would work only with a subset of vehicles because not all vehicles support CAN.

流行的扫描工具只是发送顺序请求。使用这种方法可以获得的最大吞吐量约为30-40 rps。

Popular scan tools simply sends sequential requests. Maximum throughput you can gain with this approach is about 30-40 rps.

我不知道freematics加密狗是如何工作的,但我可以看到它安装了一些SD卡 - 也许它只提供并行仿真,内部每个请求都是按顺序发送的?

I don't know how freematics dongle works but I can see it has some SD card mounted - maybe it gives only emulation of parallelism and internally every request is sent sequentially?

如果你正在寻找可靠的Java库来连接OBD II设备我建议你 https://github.com/pires/obd-java-api 。你也可以看看我的图书馆 - https://github.com/devesion/java-obd-adapter

If you are searching for reliable Java library for connecting to OBD II device I would recommend you https://github.com/pires/obd-java-api . You can also take a look at my library - https://github.com/devesion/java-obd-adapter

这篇关于如何与OBD-II设备通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆