Search code examples
ionic2obd-ii

Read OBDII data in Ionic 2 via bluetooth


There are many obd npm packages but most of them are written to be used with java. Is there any way to read data from the OBDII by using Ionic 2 framework?


Solution

  • The language is not important. If your language can manage a bluetooth connection it's done because you only send hex message and receive hex message using bluetooth socket with ELM327 that is connected in your OBD port in the car.

    The only things that you do is to read the hex message and convert it how suggest the wikipedia table: Pids and mode

    So for example when you manage the connection with your language just send a command like 01 0C:

    string msg -> 01 0C\r  #Message for rpm or speed don't remember
    write(socket, msg);
    

    And the ELM respond with:

    41 0C 00 00