{"id":15059689,"url":"https://github.com/evanshortiss/obd-parser-cli","last_synced_at":"2025-04-10T05:41:16.700Z","repository":{"id":65467281,"uuid":"76197849","full_name":"evanshortiss/obd-parser-cli","owner":"evanshortiss","description":"CLI to read diagnostic data from vehicles via OBD (ELM 327) connections","archived":false,"fork":false,"pushed_at":"2020-06-08T15:27:45.000Z","size":33,"stargazers_count":27,"open_issues_count":1,"forks_count":8,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-29T02:06:04.160Z","etag":null,"topics":["cli","elm","elm327","obd","obd-ii","obd-parser-cli","obd-port","obd2","serial","serialport","vehicle","vehicular-networks"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/evanshortiss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-11T20:25:13.000Z","updated_at":"2025-03-10T20:37:46.000Z","dependencies_parsed_at":"2023-01-25T08:45:53.232Z","dependency_job_id":null,"html_url":"https://github.com/evanshortiss/obd-parser-cli","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanshortiss%2Fobd-parser-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanshortiss%2Fobd-parser-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanshortiss%2Fobd-parser-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanshortiss%2Fobd-parser-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evanshortiss","download_url":"https://codeload.github.com/evanshortiss/obd-parser-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247918918,"owners_count":21018044,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","elm","elm327","obd","obd-ii","obd-parser-cli","obd-port","obd2","serial","serialport","vehicle","vehicular-networks"],"created_at":"2024-09-24T22:46:40.382Z","updated_at":"2025-04-10T05:41:16.673Z","avatar_url":"https://github.com/evanshortiss.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# obd-parser-cli\n\nA CLI tool that can interface with On Board Diagnostics (OBD II) of vehicles.\n\n## Compatibility and Testing\nThis software has only been tested with a Volkswagen MK6 GTI. Your success in\nusing this software with your vehicle might vary.\n\nUsing this software and related libraries is done so at your own risk.\n\n## Install\n```\nnpm install obd-parser-cli -g\n```\n\nNOTE: This module has a native dependency (serialport) that must be compiled\nduring install. Please ensure you have the relevant tools for compiling C/C++\ninstalled on your machine - typically this is Python v2.7 and developer\ntools such as GCC, Visual Studio, or XCode. More details can be found\n[here](https://github.com/nodejs/node-gyp#installation)\n\n\n## Connecting to OBD via USB\nConnecting to your vehicle's OBD system is relatively simple, you just need a\nUSB ELM327 cable [like these](https://www.amazon.com/s/?field-keywords=elm327+usb).\nYou might need to install drivers to get the cable working with your laptop, \nsuch as the macOS drivers at [this link](http://www.totalcardiagnostics.com/support/Knowledgebase/Article/View/19/0/how-to-install-elm327-usbbluetooth-on-mac-and-obd-software). \n\nAfter purchasing a cable and installing any required drivers you can connect\nyour ELM327 cable to your laptop via USB and plug the other end into the cars\nOBD port. The OBD port is usually above your gas/break pedal area.\n\nOnce you've plugged in your cable to both the laptop and vehicle you can run the\ncommand `ls /dev/tty.*` to verify the connection is detected. On macOS this will\nprint something like the following:\n\n```\n$ ls /dev/tty.*\n/dev/tty.Bluetooth-Incoming-Port /dev/tty.usbserial\n```\n\nThe existence of `/dev/tty.usbserial` tells us that the connection is detected\nand available for use by this CLI. You can use it like so:\n\n```\n$ obd poll -c serial -b 38400 -i /dev/tty.serialusb \"Engine RPM\"\n```\n\nThe `-c serial` tells us that we want to use a serial connection, `-b`\nspecifies the baudrate (this might vary based on vehicle) ,and `-i` specifies\nthe interface that the serial connection is running at.\n\n## Usage\nOnce installed you can run the program from a terminal. Here's how to load\nthe help menu:\n\n```\n$ obd --help\n\n🚔  OBD CLI 🚘\n\n  Usage: index [options] [command]\n\n\n  Commands:\n\n    list                                      list supported pids that can be passed to \"poll\" commands\n    poll \u003cpid\u003e [pids...]                      poll for an OBD value(s) specified by \u003cpid\u003e or a list of pids\n    monitor \u003cpid:interval\u003e [pid:interval...]  similar to poll, but continously checks PID values every n milliseconds,\n        e.g 0C:1000 will get RPM every 1000 milliseconds\n\n  Options:\n\n    -h, --help                 output usage information\n    -V, --version              output the version number\n    -c, --connection \u003cstring\u003e  type of connection, valid options are \"fake\" or \"serial\"\n    -b, --baudrate \u003cnumber\u003e    control connection baudrate, e.g 38400\n    -o, --outdir \u003cstring\u003e      loation to create folder containing monitor results\n    -i, --interface \u003cname\u003e     the interface to use for connection, e.g /dev/tty.serialusb\n```\n\n### Listing PIDs (list)\n\nUse the list command to view PIDs that can be read from vehicles. Currently\nonly a handful are supported by this module and certain vehicles will not\nsupport all PIDS either.\n\nHere's how you can view them:\n\n```\n$ obd list\n\n🚔 OBD CLI 🚘\n\nAvailable PIDs for \"poll\" commands are:\n\n2F - Fuel Level Input\n0C - Engine RPM\n05 - Engine Coolant Temperature\n0D - Vehicle Speed\n04 - Calculated Engine Load\n0A - Fuel Pressure\n0B - Intake Manifold Absolute Pressure\n0F - Intake Air Temperature\n10 - MAF Air Flow Rate\n11 - Throttle Position\n1C - OBD Standard\n03 - Fuel System Status\n20 - Supported PIDs\n\nExample command usage: \"obd poll 2F\"\n\nIt's also valid to supply the name, e.g \"Fuel Level Input\"\n``` \n\n\n### Polling (poll)\n\nUse the poll command to read (poll) values from a vehicle. You must pass the\nconnection option using \"-c\" or \"--connection\". Here we use the \"fake\"\nconnection type since we are just testing, but you can also pass \"serial\" as\nexplained in the help output.\n\nOnce you've entered connection options you can then list the PIDs by name, or\ncode that you need to read like so:\n\n```\n$ obd poll -c fake \"Engine RPM\" 2f\n\n🚔  OBD CLI 🚘\n\nConnecting via \"fake\" type...\nOBD module intialised...\n\nResults:\n\n┌──────────────────┬─────────┐\n│ Engine RPM       │ 4989.00 │\n├──────────────────┼─────────┤\n│ Fuel Level Input │ 37.65   │\n└──────────────────┴─────────┘\n```\n\nThe above example uses the \"fake\" connection type and therefore returns\nrandomised values for the PIDs you requested. If you'd like to connect via\na serial conncetion you can try the following (macOS tested) example:\n\n```\n$ obd poll -c serial -b 38400 -i /dev/tty.serialusb \"Engine RPM\"\n\n🚔  OBD CLI 🚘\n\nConnecting via \"serial\" type...\nOBD module intialised...\n\nResults:\n\n┌────────────┬────────┐\n│ Engine RPM │ 835.50 │\n└────────────┴────────┘\n```\n\n### Monitor\n\nThe monitor command is similar to poll, but instead it prints lines of JSON\ncontinuously until the process is killed. You can use the `--output` option\nto specify a directory to write JSON files to that will contain this data.\nThis creates a folder in the specified `output` directory with the current\ndate, and then writes the JSON to folders that represent each trip taken.\nInside each folder a JSON file is created. The name of the file will be\n0.json by default. Once this file reaches ~128KB in size a new file, 1.json\nwill be created, and so on until the process is killed.\n\nHere's a sample command and output data:\n\n```\n$ obd monitor 0d:100 0c:1000 05:5000 -c serial -i /dev/tty.usbserial -b 38400\n\n🚔  OBD CLI 🚘\n\nConnecting via \"fake\" type...\nOBD module intialised...\n\n{\"ts\":\"2017-03-15T16:57:18.296Z\",\"bytes\":\"410D26\",\"value\":38,\"counter\":715,\"pretty\":\"38km/h\",\"name\":\"Vehicle Speed\",\"pid\":\"0D\"}\n{\"ts\":\"2017-03-15T16:57:18.318Z\",\"bytes\":\"410C16CA\",\"value\":1458.5,\"counter\":716,\"pretty\":\"1458.5rpm\",\"name\":\"Engine RPM\",\"pid\":\"0C\"}\n{\"ts\":\"2017-03-15T16:57:18.946Z\",\"bytes\":\"410F43\",\"value\":27,\"counter\":717,\"pretty\":\"27°C\",\"name\":\"Intake Air Temperature\",\"pid\":\"0F\"}\n{\"ts\":\"2017-03-15T16:57:19.295Z\",\"bytes\":\"410D26\",\"value\":38,\"counter\":718,\"pretty\":\"38km/h\",\"name\":\"Vehicle Speed\",\"pid\":\"0D\"}\n{\"ts\":\"2017-03-15T16:57:19.316Z\",\"bytes\":\"410C1684\",\"value\":1441,\"counter\":719,\"pretty\":\"1441rpm\",\"name\":\"Engine RPM\",\"pid\":\"0C\"}\n{\"ts\":\"2017-03-15T16:57:20.296Z\",\"bytes\":\"410D22\",\"value\":34,\"counter\":720,\"pretty\":\"34km/h\",\"name\":\"Vehicle Speed\",\"pid\":\"0D\"}\n{\"ts\":\"2017-03-15T16:57:21.235Z\",\"bytes\":\"410572\",\"value\":74,\"counter\":722,\"pretty\":\"74°C\",\"name\":\"Engine Coolant Temperature\",\"pid\":\"05\"}\n```\n\nIf using the `--output` option, then the created folder structure might look\nas follows if you had two trips in a given day:\n\n```\n| |____\n| | |____2017-03-12\n| | | |____2ee5ff94-a02d-4791-9cd8-8b0d9770c34f\n| | | | |____0.json\n| | | |____599d7463-c568-441d-b6f7-86ea92ea3e59\n| | | | |____0.json\n| | | | |____1.json\n| | | | |____2.json\n| | | | |____3.json\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevanshortiss%2Fobd-parser-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevanshortiss%2Fobd-parser-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevanshortiss%2Fobd-parser-cli/lists"}