brendan-w / python-OBD

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

Not properly responding to queries. #193

Closed Fernien closed 4 years ago

Fernien commented 4 years ago

Hi, i got the latest version of the repo and when i run my script or the async example from the docs i get a single response from the adapter and aftert that only "None" as a response. I'm struggling with it for a really long time now. Maybe someone has an idea what the problem is? Im using a raspberrypi 3b+ with debian 10 buster.

Response:

0.0 revolutions_per_minute None None None

Debug output:

[obd.obd] ======================= python-OBD (v0.7.1) ======================= [obd.obd] Using scan_serial to select port [obd.obd] Available ports: ['/dev/rfcomm0'] [obd.obd] Attempting to use port: /dev/rfcomm0 [obd.elm327] Initializing ELM327: PORT=/dev/rfcomm0 BAUD=auto PROTOCOL=auto [obd.elm327] Response from baud 38400: b'?\r>' [obd.elm327] Choosing baud 38400 [obd.elm327] write: b'ATZ\r' [obd.elm327] wait: 1 seconds [obd.elm327] read: b'ELM327 v2.1\r>' [obd.elm327] write: b'ATE0\r' [obd.elm327] read: b'OK\r>' [obd.elm327] write: b'ATH1\r' [obd.elm327] read: b'OK\r>' [obd.elm327] write: b'ATL0\r' [obd.elm327] read: b'OK\r>' [obd.elm327] write: b'AT RV\r' [obd.elm327] read: b'12.1V\r>' [obd.elm327] write: b'ATSP0\r' [obd.elm327] read: b'OK\r>' [obd.elm327] write: b'0100\r' [obd.elm327] read: b'SEARCHING...\r7E8 06 41 00 BE 3E A8 13 \r\r>' [obd.elm327] write: b'ATDPN\r' [obd.elm327] read: b'A6\r>' [obd.protocols.protocol] map ECU 0 --> ENGINE [obd.elm327] Connected Successfully: PORT=/dev/rfcomm0 BAUD=38400 PROTOCOL=6 [obd.obd] querying for supported commands [obd.obd] Sending command: b'0100': Supported PIDs [01-20] [obd.elm327] write: b'0100\r' [obd.elm327] read: b'7E8 06 41 00 BE 3E A8 13 \r\r>' [obd.obd] Sending command: b'0120': Supported PIDs [21-40] [obd.elm327] write: b'0120\r' [obd.elm327] read: b'7E8 06 41 20 90 07 B0 01 \r\r>' [obd.obd] Sending command: b'0140': Supported PIDs [41-60] [obd.elm327] write: b'0140\r' [obd.elm327] read: b'7E8 06 41 40 FE D2 00 11 \r\r>' [obd.obd] Sending command: b'0600': Supported MIDs [01-20] [obd.elm327] write: b'0600\r' [obd.elm327] read: b'7E8 06 46 00 C0 00 00 01 \r\r>' [obd.obd] Sending command: b'0620': Supported MIDs [21-40] [obd.elm327] write: b'0620\r' [obd.elm327] read: b'7E8 06 46 20 80 00 08 01 \r\r>' [obd.obd] Sending command: b'0640': Supported MIDs [41-60] [obd.elm327] write: b'0640\r' [obd.elm327] read: b'7E8 06 46 40 00 00 00 01 \r\r>' [obd.obd] Sending command: b'0660': Supported MIDs [61-80] [obd.elm327] write: b'0660\r' [obd.elm327] read: b'7E8 06 46 60 00 00 00 01 \r\r>' [obd.obd] Sending command: b'0680': Supported MIDs [81-A0] [obd.elm327] write: b'0680\r' [obd.elm327] read: b'7E8 06 46 80 80 00 00 01 \r\r>' [obd.obd] Sending command: b'06A0': Supported MIDs [A1-C0] [obd.elm327] write: b'06A0\r' [obd.elm327] read: b'7E8 06 46 A0 80 00 00 01 \r\r>' [obd.obd] Sending command: b'0900': Supported PIDs [01-20] [obd.elm327] write: b'0900\r' [obd.elm327] read: b'7E8 06 49 00 55 42 00 00 \r\r>' [obd.OBDCommand] Message was shorter than expected (6<7). Padded message: bytearray(b'I\x00UB\x00\x00\x00') [obd.obd] finished querying with 98 commands supported [obd.obd] =================================================================== [obd.obd] Sending command: b'010C': Engine RPM [obd.elm327] write: b'010C\r' [obd.elm327] read: b'7E8 04 41 0C 00 00 \r\r>' [obd.obd] Sending command: b'010C': Engine RPM [obd.elm327] write: b'010C1\r' [obd.elm327] read: b'?\r>' [obd.OBDCommand] b'010C': Engine RPM did not receive any acceptable messages [obd.obd] Sending command: b'010C': Engine RPM [obd.elm327] write: b'\r' [obd.elm327] read: b'?\r>' [obd.OBDCommand] b'010C': Engine RPM did not receive any acceptable messages [obd.obd] Sending command: b'010C': Engine RPM [obd.elm327] write: b'\r' [obd.elm327] read: b'?\r>' [obd.OBDCommand] b'010C': Engine RPM did not receive any acceptable messages

Fernien commented 4 years ago

okay this might've be an hardware problem of the adapter. Got one from a friend and it reads perfectly fine.