Connect Raspberry Pi with Bluetooth OBD adapter and collect real-time car data.
Requirements:
Step 1 - Install Softwares
sudo pip3 install obd
sudo pip3 install --upgrade pyserial
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
sudo rfcomm bind hci0 <mac_address>
python3 obd_reader.py
Step 5 - Upload Car Data to AWS Dynamo DB (Optional)
sudo pip3 install boto3
python3 obd_uploader.py
Step 6 - Create an Alexa Skill (Optional)