brendan-w / python-OBD

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

How to make py-obd discard duplicate responses #100

Open Kirangey opened 6 years ago

Kirangey commented 6 years ago

I am trying to get OBD information from a Toyota ETIOS car using this OBD Bluetooth devuce

I could see three types of responses for the same command : 2 unsuccessful and 1 successful

  1. "No Data"

    Testing command :  GET_DTC
    [obd.obd] Sending command: b'03': Get DTCs
    [obd.elm327] write: b'03\r\n'
    [obd.elm327] read: b'NO DATA\r\r>'
    []
  2. Failure to parse due to duplicate response

    [obd.obd] Sending command: b'0115': O2: Bank 1 - Sensor 2 Voltage
    [obd.elm327] write: b'01151\r\n'
    [obd.elm327] read: b'7E8 04 41 15 00 FF \r7E8 04 41 15 00 FF \r\r>'
    [obd.protocols.protocol_can] Dropping frame in multi-frame response not marked as FF or CF
    [obd.protocols.protocol_can] Dropping frame in multi-frame response not marked as FF or CF
    [obd.protocols.protocol_can] Never received frame marked FF
    [obd.obd] No valid OBD Messages returned
    None
  3. Successful response : Sometime the same command that failed in 2 succeeds:

    [obd.obd] Sending command: b'0115': O2: Bank 1 - Sensor 2 Voltage
    [obd.elm327] write: b'01151\r\n'
    [obd.elm327] read: b'7E8 04 41 15 9C FF \r\r>'
    0.78 volt

Can someone please answer my questions:

  1. Why am I getting "No Data" response from the bluetooth device? Is it because the ECU didn't respond in time?
  2. Why am I getting duplicate responses from the bluetooth device?
  3. I know that the above queries might not be relevant here. So at least let me know how I can configure py-obd to ignore the duplicate responses?
Kirangey commented 6 years ago

I would really appreciate any help on this. Or please let me know if there is somewhere else I can get answer for this

apecone commented 5 years ago

Hi @Kirangey , given that this issue deals with inconsistent response behaviors given the same issuing commands, it might have something to do with #122 . Please take a look and let me know if #122 resolves your problem. Thanks :)