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

Is ELM327 version 1.5 supported? #173

Closed pacmandu closed 4 years ago

pacmandu commented 4 years ago

Hey I got a adapter for a Bluetooth connection to an ELM327. However, even with the engine running I am unable to query details from the car itself. The car is a 2014 Scion FRS and the adapter is powered correctly because I was able to get the firmware version. What am I doing wrong here? Do I need to set the protocol manually? The car is idling at about 800-1000 RPM at the time of this output.

Output from my test code:

[obd.obd] ======================= python-OBD (v0.7.1) ======================= [obd.obd] Explicit port defined [obd.elm327] Initializing ELM327: PORT=/dev/rfcomm0 BAUD=38400 PROTOCOL=auto [obd.elm327] write: 'ATZ\r' [obd.elm327] wait: 1 seconds [obd.elm327] read: b'\r\rELM327 v1.5\r\r>' [obd.elm327] write: 'ATE0\r' [obd.elm327] read: b'ATE0\rOK\r\r>' [obd.elm327] write: 'ATH1\r' [obd.elm327] read: b'OK\r\r>' [obd.elm327] write: 'ATL0\r' [obd.elm327] read: b'OK\r\r>' [obd.elm327] write: 'AT RV\r' [obd.elm327] read: b'14.5V\r\r>' [obd.elm327] write: 'ATSP0\r' [obd.elm327] read: b'OK\r' [obd.elm327] write: '0100\r' [obd.elm327] read: b'\r>' [obd.elm327] write: 'ATDPN\r' [obd.elm327] read: b'SEARCHING...\r7E9 06 41 00 88 18 00 13 \r7E8 06 41 00 BE 3F A8 13 \r\r>' [obd.elm327] Failed to retrieve current protocol [obd.elm327] Adapter connected, but the ignition is off [obd.obd] Cannot load commands: No connection to car [obd.obd] =================================================================== OBD Connected [obd.obd] Sending command: ATI: ELM327 version string [obd.elm327] write: 'ATI\r' [obd.elm327] read: b'ELM327 v1.5\r\r>' ELM327 v1.5 [obd.obd] Sending command: ATRV: Voltage detected by OBD-II adapter [obd.elm327] write: 'ATRV\r' [obd.elm327] read: b'13.5V\r\r>' 13.5 volt [obd.obd] '010C: Engine RPM' is not supported None

pacmandu commented 4 years ago

Here is when I set manually protocol 5.

[obd.obd] ======================= python-OBD (v0.7.1) ======================= [obd.obd] Explicit port defined [obd.elm327] Initializing ELM327: PORT=/dev/rfcomm0 BAUD=38400 PROTOCOL=5 [obd.elm327] write: 'ATZ\r' [obd.elm327] wait: 1 seconds [obd.elm327] read: b'\r\rELM327 v1.5\r\r>' [obd.elm327] write: 'ATE0\r' [obd.elm327] read: b'ATE0\rOK\r\r>' [obd.elm327] write: 'ATH1\r' [obd.elm327] read: b'OK\r\r>' [obd.elm327] write: 'ATL0\r' [obd.elm327] read: b'OK\r\r>' [obd.elm327] write: 'AT RV\r' [obd.elm327] read: b'13.9V\r\r>' [obd.elm327] write: 'ATTP5\r' [obd.elm327] read: b'OK\r' [obd.elm327] write: '0100\r' [obd.elm327] read: b'\r>' [obd.elm327] Connected Successfully: PORT=/dev/rfcomm0 BAUD=38400 PROTOCOL=5 [obd.obd] querying for supported commands [obd.obd] Sending command: 0100: Supported PIDs [01-20] [obd.elm327] write: '0100\r' [obd.elm327] read: b'BUS INIT: STOPPED\r\r>' [obd.OBDCommand] 0100: Supported PIDs [01-20] did not receive any acceptable messages [obd.obd] No valid data for PID listing command: 0100: Supported PIDs [01-20] [obd.obd] finished querying with 7 commands supported [obd.obd] =================================================================== Car Connected [obd.obd] Sending command: ATI: ELM327 version string [obd.elm327] write: 'ATI\r' [obd.elm327] read: b'ELM327 v1.5\r\r>' ELM327 v1.5 [obd.obd] Sending command: ATRV: Voltage detected by OBD-II adapter [obd.elm327] write: 'ATRV\r' [obd.elm327] read: b'13.1V\r\r>' 13.1 volt [obd.obd] '010C: Engine RPM' is not supported None

pacmandu commented 4 years ago

Sorry one more dump. Turns out it is receiving data but it can't parse it. I have confirmed that is is pulling the RPMs and Speed properly but the library can't parse multiple responses in the same line as shown below:

[obd.obd] ======================= python-OBD (v0.7.1) ======================= [obd.obd] Explicit port defined [obd.elm327] Initializing ELM327: PORT=/dev/rfcomm0 BAUD=38400 PROTOCOL=6 [obd.elm327] write: 'ATZ\r' [obd.elm327] wait: 1 seconds [obd.elm327] read: b'\r\rELM327 v1.5\r\r>' [obd.elm327] write: 'ATE0\r' [obd.elm327] read: b'ATE0\rOK\r\r>' [obd.elm327] write: 'ATH1\r' [obd.elm327] read: b'OK\r\r>' [obd.elm327] write: 'ATL0\r' [obd.elm327] read: b'OK' [obd.elm327] write: 'AT RV\r' [obd.elm327] read: b'14.7V\r\r>' [obd.elm327] write: 'ATTP6\r' [obd.elm327] read: b'OK\r\r' [obd.elm327] write: '0100\r' [obd.elm327] read: b'>' [obd.elm327] Connected Successfully: PORT=/dev/rfcomm0 BAUD=38400 PROTOCOL=6 [obd.obd] querying for supported commands [obd.obd] Sending command: 0100: Supported PIDs [01-20] [obd.elm327] write: '0100\r' [obd.elm327] read: b'7E8 06 41 00 BE 3F A8 13 \rSTOPPED\r\r>\r>' [obd.OBDCommand] 0100: Supported PIDs [01-20] did not receive any acceptable messages [obd.obd] No valid data for PID listing command: 0100: Supported PIDs [01-20] [obd.obd] Sending command: 0600: Supported MIDs [01-20] [obd.elm327] write: '0600\r' [obd.elm327] read: b'7E8 06 46 00 C0 00 00 01 \r\r>' [obd.obd] Sending command: 0620: Supported MIDs [21-40] [obd.elm327] write: '0620\r' [obd.elm327] read: b'7E8 06 46 20 80 00 0C 19 \r\r>' [obd.obd] Sending command: 0640: Supported MIDs [41-60] [obd.elm327] write: '0640\r' [obd.elm327] read: b'7E8 06 46 40 C0 00 00 01 \r\r>' [obd.obd] Sending command: 0660: Supported MIDs [61-80] [obd.elm327] write: '0660\r' [obd.elm327] read: b'7E8 06 46 60 00 00 00 01 \r\r>' [obd.obd] Sending command: 0680: Supported MIDs [81-A0] [obd.elm327] write: '0680\r' [obd.elm327] read: b'7E8 06 46 80 00 00 00 01 \r\r>' [obd.obd] Sending command: 06A0: Supported MIDs [A1-C0] [obd.elm327] write: '06A0\r' [obd.elm327] read: b'7E8 06 46 A0 F8 00 00 00 \r\r>' [obd.obd] finished querying with 26 commands supported [obd.obd] =================================================================== Car Connected [obd.obd] Sending command: ATI: ELM327 version string [obd.elm327] write: 'ATI\r' [obd.elm327] read: b'ELM327 v1.5\r\r>' ELM327 v1.5 [obd.obd] Sending command: ATRV: Voltage detected by OBD-II adapter [obd.elm327] write: 'ATRV\r' [obd.elm327] read: b'13.1V\r\r>' 13.1 volt [obd.obd] Sending command: 010C: Engine RPM [obd.elm327] write: '010C\r' [obd.elm327] read: b'7E9 04 41 0C 0A A8 \r7E8 04 41 0C 0A BC \r\r>' [obd.OBDCommand] 010C: Engine RPM did not receive any acceptable messages None [obd.obd] Sending command: 010D: Vehicle Speed [obd.elm327] write: '010D\r' [obd.elm327] read: b'7E8 03 41 0D 00 \r7E9 03 41 0D 00 \r\r>' [obd.OBDCommand] 010D: Vehicle Speed did not receive any acceptable messages None

Confirmed the Speed is 0 and RPMs are around 682. What gives about the library for saying the Vehicle did not return any acceptable messages when in fact it did?