简体   繁体   English

通过USB进行OBD通讯

[英]OBD communication through USB

I am currently working on an app which intents to read data from the ECU through OBD and I would like to use USB adapter which I would connect to my phone. 我目前正在开发一个旨在通过OBD从ECU读取数据的应用程序,我想使用USB适配器连接到手机。 Problem is that I see bluetooth based libraries everywhere. 问题是我到处都可以看到基于蓝牙的库。 Is there anybody willing to help me? 有谁愿意帮助我吗? I intend to use this library: https://github.com/pires/android-obd-reader 我打算使用此库: https : //github.com/pires/android-obd-reader

https://github.com/pires/obd-java-api/ (maybe this one would be better) https://github.com/pires/obd-java-api/ (也许这会更好)

But I cannot figure out how to build my app, so it can communicate through usb. 但是我无法弄清楚如何构建我的应用程序,因此它可以通过USB进行通信。 I have the cable and tested it with other store apps. 我有电缆,并已与其他商店应用进行了测试。

Thank you guys. 感谢大伙们。

The easiest way to do this, would be to use a bluetooth ELM327, and try to set up a bluetooth basic example for communication using one of the libraries. 最简单的方法是使用蓝牙ELM327,并尝试使用其中一个库建立用于通信的蓝牙基本示例。

Not sure of your knowledge, so I don't know where to start on helping you. 不确定您的知识,所以我不知道从哪里开始为您提供帮助。 1) Do you know about OBD protocols? 1)您知道OBD协议吗? 2) Do you know how to request PIDS from the ECU, and read them? 2)您知道如何从ECU请求PIDS并读取它们吗? 3) What vehicle are you communicating with? 3)您正在与哪种车辆通信? 4) Are you asking for help on how to use bluetooth to communicate, or vehicle communication with bluetooth, or both? 4)您是否在寻求有关如何使用蓝牙进行通信或车辆与蓝牙进行通信的帮助?

Bluetooth communication is essentially just serial communication, that is wireless. 蓝牙通信本质上只是串行通信,即无线。 So first set up a basic example with the library of how to connect, and send a message. 因此,首先建立一个有关如何连接和发送消息的基本示例。 Once that is done, try sending your first message! 完成后,尝试发送您的第一条消息! You can try getting the RPM's (01 0C).. 您可以尝试获取RPM(01 0C)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM