brendan-w / python-OBD

OBD-II serial module for reading engine data
GNU General Public License v2.0
1.07k stars 373 forks source link

0 at the end of command sent #108

Closed kbielak closed 5 years ago

kbielak commented 6 years ago

Hey, I was trying to send command 010D (Vehicle speed) without success. For some reason at the end of command 0 appears.

My script: cmdc = obd.commands.SPEED response = connection.query(cmdc, force=True)

Logs: [obd.elm327] write: '010D0\r\n' [obd.elm327] read: b'\r?WRONG HEXCHAR COUNT\r>'

My question is where does this 0 come from and how to get rid of this? I've tried sending '010' and get correct response for '0100'. Could you help me? Thanks in advance, cheers

brendan-w commented 6 years ago

looks like a problem with detecting the number of ECUs in your car (this normally looks like 010D1). That number was used to set the ELM's early-return message count, to avoid long timeouts. This logic had other problems, and I have since ripped it out in favor of something more robust. You have two options:

alistair23 commented 5 years ago

Closing as the issue appears to be fixed