Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot connect to car without debug mode #186

Open
michaelhku2002 opened this issue Apr 2, 2020 · 1 comment
Open

Cannot connect to car without debug mode #186

michaelhku2002 opened this issue Apr 2, 2020 · 1 comment

Comments

@michaelhku2002
Copy link

michaelhku2002 commented Apr 2, 2020

Hi!

I'm now facing a problem when developing project for getting OBD data and camera stream from the car and then sending back to server through 4G mobile communication. When enabling the debug mode, the OBD can get protocol and then the values of RPM and speed can be obtained, but the video capture cannot be got properly and then sent back to server. Then I tried to disable the debug mode of OBD, but it always said that the car cannot be connected and thus, no protocol can be retrieved. So is there any workaround for this? My program code is here for reference. Thanks!

import obd

obd.logger.setLevel(obd.logging.DEBUG)
ports=obd.scan_serial()
print("port for bluetooth OBD={}".format(ports))
connection=obd.OBD(portstr=ports[0],baudrate=115200,fast=False,timeout=60)
#connection=obd.OBD(portstr='/dev/rfcomm0',baudrate=115200,fast=False,timeout=60)
print("connection.status()={}".format(connection.status()))
print("protocol name={}".format(connection.protocol_name()))

resp_rpm=connection.query(obd.commands.RPM,force=True)
print("resp_rpm: {}".format(resp_rpm.value.magnitude))
resp_speed=connection.query(obd.commands.SPEED,force=True)
print("resp_speed: {}".format(resp_speed.value.magnitude))
@alistair23
Copy link
Collaborator

It sounds like a timing issue with your Bluetooth adaptor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants