Giter VIP home page Giter VIP logo

node-bluetooth-obd's Introduction

Eric Smekens

Hi, I'm Eric, a Node.js developer at Enexis ๐Ÿ‘จโ€๐Ÿ”งโšก, working on the energy transition. I live in Dorst, a small village near Breda in the Netherlands. ๐Ÿ™Œ

My values, explained by my favorite proverbs

๐ŸŒด No man is an island.
โ˜˜ You will never plough a field if you only turn it over in your mind.
๐Ÿ’– Be kind, for everyone you meet is fighting a hard battle.

How I work

I love it to learn something new, get that elbow grease, and then sharing the problems and knowledge you've found. And after that, piece by piece, no matter how tiny that piece might be, make it more understandable, make it better.

Projects

Have a look in my repositories down below.

๐Ÿš— obd projects

Part of my graduation internship. It perfectly describes the way how I like to work. Learning obd and node.js at the same time, and making something that is shareable to the rest of the community. It is definitely not the best package out there, but it is still a place of shareable information.

โœ” jsep

Used this as a dependency in my first job. Spent some free time on it, to learn more and try to extend it. Eventually became a collaborator, and now the maintainer of the package. Thanks to the original author as well for the great work.

Get in touch

LinkedIn

StackOverFlow

node-bluetooth-obd's People

Contributors

bryant1410 avatar damoclark avatar ericsmekens avatar germanbluefox avatar joouis avatar kauegimenes avatar szaboge avatar ulizama avatar yimengzhu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-bluetooth-obd's Issues

cant install

when i do

npm install bluetooth-obd

it try to compile something and throws error.

Get Error: Error finding serialport: undefined

Hi Eric, Thank you for the excellent work. Now i can connect my OBD with my server. But i always get the Error: Error finding serialport: undefined before i can receive the data. As soon as this error is thrown the OBD will disconnect. Do you know how can i fix this Problem?

Parameters Supported By This Library

This library supports which parameters (such as rpm, speed) in a car for an obd to get values from?
I have already tested rpm, the speed with ELM327 OBD-II.
I also tried to test the fuel level input, but I got no response using this library. It showed no data!
Please let me know the parameters, soon.
Thanks

Messages failing after disconnect

Hi,
I am creating a graphing app based off your library. The first time I connect to a device it works perfectly (Other than I had to remove the "replies" part of the string that gets added to the Queue. It seems like it always appends a 1 to every PID which would just make my ELM Simulator return nothing. Removing this makes it work.

However back to the issue, once I disconnect and reconnect it seems there are really weird concatenated messages being sent to the BT device.

Seems like something weird goes on after a disconnect that doesn't properly clean up. I have a hunch it is something to do with the intervalWriter which may go deeper into the way the btSerial lib is handling the buffers. But am struggling to debug that. I've tried just adding all the functions I could find that detach listeners, detach pollers, clear queue,etc..etc. None of it helped. If you disconnect again and reconnect the problem only compounds. See my 3rd screenshot.

Screenshot of Good Calls on first connect on OBD Device

Screenshot of Data receieved back in front end from OBD Device

Screenshot of calls being sent after disconnect and reconnect.

Screenshot of Data receieved back in front end from OBD Device after disconnect and reconnect.

After second disconnect and reconnect

You can find my project here which should demonstrate the issue.
https://github.com/Reiss-Cashmore/obdii-grapher

I am using Mac OSX if that helps.

does it control the signals?

Hello guys, i have a question does it control the signals? because I would like to play with them and make a little program for car to "dance" to music :))

install issues

Upon installation on raspbian the following error occurs

pi@raspi-car-01:~/testodb2 $ npm install --save bluetooth-obd

> [email protected] install /home/pi/testodb2/node_modules/bluetooth-serial-port
> node-gyp configure build

make: Entering directory '/home/pi/testodb2/node_modules/bluetooth-serial-port/build'
  CXX(target) Release/obj.target/BluetoothSerialPort/src/linux/BluetoothSerialPort.o
  CXX(target) Release/obj.target/BluetoothSerialPort/src/linux/DeviceINQ.o
../src/linux/DeviceINQ.cc:35:37: fatal error: bluetooth/bluetooth.h: No such file or directory
     #include <bluetooth/bluetooth.h>
                                     ^
compilation terminated.
BluetoothSerialPort.target.mk:105: recipe for target 'Release/obj.target/BluetoothSerialPort/src/linux/DeviceINQ.o' failed
make: *** [Release/obj.target/BluetoothSerialPort/src/linux/DeviceINQ.o] Error 1
make: Leaving directory '/home/pi/testodb2/node_modules/bluetooth-serial-port/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Linux 4.14.79+
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /home/pi/testodb2/node_modules/bluetooth-serial-port
gyp ERR! node -v v10.14.2
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

Please add to the installation that libbluetooth-dev is required as found on stackoverflow.com

Please add as a Request in README.md

Pre-requests on Linux

Needs Bluetooth development packages to build

$ sudo apt-get install libbluetooth-dev

It delayed the test for a hole day.

thank in advance.

Problem Installing for Android use

Log

PS C:\Users\fjsolance\Desktop\MotorBikeControl\MotorBikeControlApp> npm install --save bluetooth-serial-port
npm ERR! code 1
npm ERR! path C:\Users\fjsolance\Desktop\MotorBikeControl\MotorBikeControlApp\node_modules\bluetooth-serial-port
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp configure build
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | x64
npm ERR! gyp info find Python using Python version 3.10.4 found at "C:\Users\fjsolance\AppData\Local\Programs\Python\Python310\python.exe"
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack at VisualStudioFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:122:47)
npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:75:16
npm ERR! gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:363:14)
npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:71:14
npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:384:16
npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:406:5)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:526:28)
npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1092:16)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "build"
npm ERR! gyp ERR! cwd C:\Users\fjsolance\Desktop\MotorBikeControl\MotorBikeControlApp\node_modules\bluetooth-serial-port
npm ERR! gyp ERR! node -v v16.14.2
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\fjsolance\AppData\Local\npm-cache_logs\2022-05-20T11_48_07_556Z-debug-0.log

Node Red

Hi,

I have been experimenting with this in Node Red trying to utilise it using the Node Red NPM node.
Having little to no luck at all and was wondering have you experimented with this and been able to get it to work?

Timing

Timing new responses should be improved.

Data contains nothing

Hi,

I've a ELM327 connected to a raspberry. Succesfully paired and trusted.
When I'm running the demo code, data is always empty. Console shows rows with {} What's going wrong?

Thanks in advance!

VIN

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?

Npm install failing

Unable to use this for the moment. Please help
Ubuntu 14 is the OS used

Details:
_modules/bluetooth-serial-port/build'
CXX(target) Release/obj.target/BluetoothSerialPort/src/linux/BluetoothSerialPort.o
CXX(target) Release/obj.target/BluetoothSerialPort/src/linux/DeviceINQ.o
../src/linux/DeviceINQ.cc:35:37: fatal error: bluetooth/bluetooth.h: No such file or directory
#include <bluetooth/bluetooth.h>
^
compilation terminated.
make: *** [Release/obj.target/BluetoothSerialPort/src/linux/DeviceINQ.o] Error 1
make: Leaving directory /home/home/node_sundar/node_modules/bluetooth-obd/node_modules/bluetooth-serial-port/build' gyp ERR! build error gyp ERR! stack Error:make` failed with exit code: 2

Commented ATZ command returns no data

When testing the module as-is, and setting a poll on rpm, I get OKs for the sets, and then empty objects for all of the poll results:

{ value: 'OK' }
{ value: 'OK' }
{ value: 'OK' }
{ value: 'OK' }
{ value: 'OK' }
{ value: 'OK' }
{}
{}
{}
...

Based on testing/reading, it looks like the problem is the ATZ (ELM327 chip reset) being commented out. Is there a reason for that? Things work for me when it's un-commented.

        //self.write('ATZ');
        //Turns off extra line feed and carriage return
        self.write('ATL0');
        //This disables spaces in in output, which is faster!
        self.write('ATS0');
        //Turns off headers and checksum to be sent.
        self.write('ATH0');
        //Turns off echo.
        self.write('ATE0');
        //Turn adaptive timing to 2. This is an aggressive learn curve for adjusting the timeout. Will make huge difference on slow systems.
        self.write('ATAT2');
        //Set timeout to 10 * 4 = 40msec, allows +20 queries per second. This is the maximum wait-time. ATAT will decide if it should wait shorter or not.
        //self.write('ATST0A');
        //Set the protocol to automatic.
        self.write('ATSP0');

Problem Connecting on Raspberry PI Rasbian

Using the code in your sample. Device is being found, but connection is failing.

Error Below:

Debug: Found device: OBDII (00:0D:18:06:00:00)
Debug: Found device channel: 16
connected
Error: Error with OBD-II device: Error: Cannot connect

Returned data from OBD split up into chunks

Hi Eric,

Amazing library really getting to grips with it, however there is one strange issue I'm having.
I have adapted the code to work in a hybrid app but whenever I send a command to the OBD device it returns the data in an inconsistent chunk of results, example:

Me: 010C
OBDII:
OBDII: 4
OBDII: 3C
OBDII: 3
OBDII: 3C C
OBDII: 3C
OBDII:
OBDII:
OBDII: >

It is a similar issue to this stackoverflow post: http://stackoverflow.com/questions/25374953/bluetoothchat-to-elm327-split-response-message

Although the solution there appears to be in Java.

I have a work around where I loop over the results adding the relevant parts together then when i receive a ">" command I stop as i know its finished.

Have you ever come across this before?

Thanks again for the library and any help,

Chris

Connection to VEEPEAK BLE+

Hi,
I'm a little confused on how to connect to a device, I have this one:

info 34:81:F4:D2:43:2C
Device 34:81:F4:D2:43:2C (public)
	Name: VEEPEAK
	Alias: VEEPEAK
	Class: 0x00240404
	Icon: audio-card
	Paired: yes
	Trusted: yes
	Blocked: no
	Connected: no
	LegacyPairing: yes
	UUID: Serial Port               (00001101-0000-1000-8000-00805f9b34fb)
	UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
	Modalias: bluetooth:v0039p5056d0120
	RSSI: -84

I have tried the commands:
btOBDReader.autoconnect('34:81:F4:D2:43:2C');
btOBDReader.autoconnect('VEEPEAK');
btOBDReader.autoconnect('veepeak'); - just in case it was case sensitive
btOBDReader.connect('34:81:F4:D2:43:2C', 1); - as I have no idea what the port is...

Any ideas?

Thanks,
Jamie

WiFi

Can this be adapted to the wifi serial interface? 192.168.0.10:35000

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.