EricSmekens / node-bluetooth-obd

Node package for communication with Bluetooth OBD connectors.
Other
262 stars 72 forks source link

VIN #23

Closed scramble45 closed 1 year ago

scramble45 commented 7 years ago

I'm not having much luck getting the VIN. I made it a little further by adding this in obd.js

else if (valueArray[0] === "49") {
        reply.mode = valueArray[0];
        for (var i = 0; i < PIDS.length; i++) {
            console.log('pid length:', PIDS.name);
            if (PIDS[i].mode == "09") {
                reply.name = PIDS[i].name;
                reply.value = PIDS[i].convertToUseful(hexString);
                console.log('value:', reply.value);
            }
        }
    } 

Any suggestions as it stands I do not believe the methods for getting VIN actually work... or am I mistaken?

EricSmekens commented 7 years ago

No, VIN was a big question mark for me when I was still active with this. Might want to investigate on how other librabries are doing this.

scramble45 commented 7 years ago

I have noticed with OBDII, that things like the VIN take a while to request, that and battery voltage. Both of those require more time before you will get something back.

EricSmekens commented 7 years ago

Okay, good to know. How long, like a second, or multiple of them?

scramble45 commented 7 years ago

Around 50-100ms it seems. Seems like you don't really want to poll VIN just have a method to get it once before any polling starts. Battery voltage ('01422') seems to also take while which is kinda odd since its mode 1.

Sent from my iPhone

On Jan 25, 2017, at 3:02 PM, Eric Smekens notifications@github.com wrote:

Okay, good to know. How long, like a second, or multiple of them?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

csurf commented 1 year ago

Not all vehicles support VIN requests, mainly the older pre-CAN vehicles I believe.