Since recording the bus doesn’t work for me, I figured I could write some custom code to do some queries, save the resulting hex dumps for later off-line analysis.
So sarting with Support for electric vehicles I have some custom code that calls obd.query and logs the data (to minion.log) for later upload -
for mode in ['21']:
for pid in ['01','02','f2']:
args = ['scan '+mode+pid]
kwargs = {
'mode': mode,
'pid': pid,
'header': '7E2',
'baudrate': 500000,
'protocol': '6',
'verify': False,
'force': True,
}
log.info ("SCAN: "+mode+" "+pid+" "+str(__salt__['obd.query'](*args, **kwargs)))
However I noticed this is pretty slow - about one query per second. I thought the OBD port was much faster than this.
So is there a better/faster/more efficient way to scan multiple PID’s for recording purposes ?
Yes, you still need to use __salt__ to execute the module.
The return value is more raw than the obd.query, it returns a string array with the response(s).
And remember that obd.send does not take a formula like obd.query.