Sending command to OBDII using Ionic 3 native bluetooth plugin

670 Views Asked by At

I'm trying to get data from OBDII using ionic native bluetooth plugin. However, when i called write method to send the command to the device, no data was returned. The code I used is as below:

readData(device){
    this.bluetoothSerial.write('010D').then( (success) => {
        alert('Connected to ' + device.name + '. Data reading is successful: ' + new Uint8Array(success));
    },
    (error) => {
        alert('reading failed:' + error );
    });
}

The result is shown as below: enter image description here

My question is: what is the proper way to send command to OBDII to retrieve data using native plugin.

1

There are 1 best solutions below

0
On BEST ANSWER

Try with "010D\r" where \r is a carriage return....and read the Hex response.

If you receive NoData means that or the sensor is not in the car or you send an incorrect command.

Remember that the ELM327 can manage one command per time, so you must use something like Queue for manage multi command.

PS:read some documentation about ELM327 and how it manage commands and configuration