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

[obd.elm327] ATL0 did not return 'OK' #159

Closed Fernien closed 4 years ago

Fernien commented 4 years ago

Hey, i had my little script working. My raspberry Pi died so i switched the whole sd card to a new one. Since i did this its unable to connect to my car. I got this issue. Tbh i dont understand why it says ATL0 OK and 2 lines after tries the same and replies with not ok. Anyone got a clue? I read someting about adding delay=1 in elm327.py. Didnt help in my case.

[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: '?\r\r>' [obd.elm327] Choosing baud 38400 [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' [obd.elm327] write: 'ATH1\r' [obd.elm327] read: b'OK' [obd.elm327] write: 'ATL0\r' [obd.elm327] wait: 1 seconds [obd.elm327] read: b'\r>OK\r\r>' [obd.elm327] closing port [obd.elm327] write: 'ATZ\r' [obd.elm327] ATL0 did not return 'OK' [obd.obd] Closing connection [obd.obd] Cannot load commands: No connection to car [obd.obd] =================================================================== [obd.obd] Query failed, no connection available

alistair23 commented 4 years ago

It sounds like a timing issue. Have a look at this issue for more details: https://github.com/brendan-w/python-OBD/issues/158