Code Monkey home page Code Monkey logo

pi-bluetooth-obd's Introduction

pi-bluetooth-obd

Connect Raspberry Pi with Bluetooth OBD adapter and collect real-time car data.

Requirements:

Step 1 - Install Softwares

  • Install Python OBD: sudo pip3 install obd
  • Upgrade pySerial: sudo pip3 install --upgrade pyserial
  • Install Screen sudo apt-get install screen

Step 2 - Connect OBD Adapater via Bluetooth

bluetoothctl
help <-- see all the commands
show
power on
pairable on
agent on <-- used for persisting pairing code
default-agent
scan on <-- find OBDII and its MAC address
pair <mac_address> <-- enter pin 1234
trust <mac_address> <-- this will allow Pi to automatically pair with the device next time
scan off
quit

Step 3 - Connect Car with Screen (Optional)

screen /dev/rfcomm0
atz
atl1
ath1
atsp0 <-- use protocol auto, available protocols: 1, 2, 3, 4, 5, 6, 7, 8, 9, A
0100 <-- mode 01, pid 00, supported pids

If successfully connected to the car, 0100 will return something instead of "UNABLE TO CONNECT" or "CAN ERROR" or "BUS INIT: ...ERROR".

Step 4 - Connect Car with Python OBD

  • Create a serial port: sudo rfcomm bind hci0 <mac_address>
  • Run the program: python3 obd_reader.py
  • See a list of commands here

Step 5 - Upload Car Data to AWS Dynamo DB (Optional)

  • Install AWS Python SDK: sudo pip3 install boto3
  • Follow the instructions to set up AWS credentials, and create a DynamoDB table named "telematics" with primary key "id"
  • Run the program: python3 obd_uploader.py
  • Check if the speed & fuel level data are uploaded to the DynamoDB table

Step 6 - Create an Alexa Skill (Optional)

  • Create an Alexa skill that reads from the DynamoDB table, so when ask "what's my fuel level", Alexa will respond "your fuel level is 60%"
  • Use the Alexa skill configs and Lambda function from "alexa" folder

pi-bluetooth-obd's People

Contributors

grimlockrocks avatar

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.