Leaf NV200 python monitoring

My Nissan Leaf Forum

Help Support My Nissan Leaf Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

KarmaProd

New member
Joined
May 13, 2022
Messages
1
Hi,I want monitoring a Nissans Leaf NV200 using this python script and obd2 bluetooth adapter:

Code:
import serial

elm = serial.Serial("/dev/rfcomm0", 38400, timeout=5)

elm.write(b"ATZ\r\n")  # reset all
print(elm.read_until(b"\r\n>").decode())

elm.write(b"ATE0\r\n")  # print version ID
print(elm.read_until(b"\r\n>").decode())

elm.write(b"ATH1\r\n")  # headers on
print(elm.read_until(b"\r\n>").decode())

elm.write(b"ATAL\r\n")  # allow long messages
print(elm.read_until(b"\r\n>").decode())

elm.write(b"ATSP6\r\n")  # set protocol ISO 15765-4 CAN (11/500)
print(elm.read_until(b"\r\n>").decode())

elm.write(b"ATCM 55B \r\n")  # SOC 
print(elm.read_until(b"\r\n>").decode())

elm.write(b"ATCF 7FF \r\n")  #
print(elm.read_until(b"\r\n>").decode())

elm.write(b"ATMA\r\n")  # monitor all messages

print(elm.read_until(b"\r"))

elm.close()
It works but how can I change it to get more pid at the same time? After sending the ATMA command the connection is closed.
 
Back
Top