Pyserial, Getting extra info from OBD Device

淺唱寂寞╮ 提交于 2019-12-06 15:06:01

Send ATE0 to the ELM-device.

This disables the echo, so atrv won't be send back to you!

Have a look into this: http://elmelectronics.com/DSheets/ELM327DS.pdf , collection of lots of AT commands, could be helpful!

on a raspberry PI i had to modify the code to:

import serial
import time
import string
import io
import os
import sys

ser = serial.Serial("/dev/rfcomm0")
ser.baudrate = 115200
s = input('Enter AT command --> ')
print ('AT command = ' + s)
ser.flushInput();
ser.write(bytes(s + '\r\n', encoding = 'utf-8'))
ser.flush();
ser.timeout = 1
response = ser.read(999).decode('utf-8')
print(response)
ser.close()
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!