Open g4b-y opened 3 years ago
It looks like there is no connection to the ELM device. Can you connect to it with screen, minicom or something similar?
I am facing same issue. When I try to connect using screen to the ELM devices this is what happens:
pi@leaf01:~$ screen /dev/rfcomm0 [screen is terminating] pi@leaf01:~$
` pi@leaf01:~$ python3 Python 3.7.3 (default, Jul 25 2020, 13:03:44) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information.
import obd, time
obd.logger.setLevel(obd.logging.DEBUG) connection = obd.OBD() [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'' [obd.elm327] Response from baud 9600: b'' [obd.elm327] Response from baud 230400: b'' [obd.elm327] Response from baud 115200: b'AT+BRSF=24\r' [obd.elm327] Response from baud 57600: b'' [obd.elm327] Response from baud 19200: b'' [obd.elm327] Failed to choose baud [obd.elm327] closing port [obd.elm327] write: b'ATZ\r' [obd.elm327] Failed to set baudrate [obd.obd] Closing connection [obd.obd] Cannot load commands: No connection to car [obd.obd] =================================================================== connection = obd.OBD(baudrate=115200, fast=False) [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=115200 PROTOCOL=auto [obd.elm327] write: b'ATZ\r' [obd.elm327] wait: 1 seconds [obd.elm327] Device disconnected while reading [obd.elm327] cannot perform write() when unconnected [obd.elm327] cannot perform read() when unconnected [obd.elm327] ATE0 did not return 'OK' [obd.obd] Closing connection [obd.obd] Cannot load commands: No connection to car [obd.obd] =================================================================== connection = obd.OBD(baudrate=115200) [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=115200 PROTOCOL=auto [obd.elm327] write: b'ATZ\r' [obd.elm327] wait: 1 seconds [obd.elm327] Device disconnected while reading [obd.elm327] cannot perform write() when unconnected [obd.elm327] cannot perform read() when unconnected [obd.elm327] ATE0 did not return 'OK' [obd.obd] Closing connection [obd.obd] Cannot load commands: No connection to car [obd.obd] ===================================================================
`
I'm having trouble making a stable connection to my OBD and am confused why - despite seeing the ports it either throws a Failed to choose baud or with a given baud, Failed to read port (though it does seem to read and write some data).
(MacOS (and Windows7 😬), Python v3.8.5, python-OBD v0.7.1, a few different adapters (inc. Cable Shack, Carly cable + bluetooth))
My code, basically:
Auto ports and auto baud:
With specified baudrate and protocol:
Any help greatly appreciated.