Skip to content
Relay information from an OBD-II reader to an MQTT broker via Hologram Nova
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.DS_Store
.gitignore
README.md
adafruitConfig.py
dashboard.png
main.py
obd-test.py

README.md

Hologram Vehicle Monitoring Example

This example uses the Hologram Nova USB Modem with a Raspberry Pi in order to relay OBDII data to the AdafruitIO cloud. This guide assumes you have access to a terminal on your Raspberry Pi. I recommend connecting via a serial terminal.

Installation

Run the following in a terminal, it will install the Hologram, Adafruit-IO and OBD Python SDKs as well as the Hologram CLI.

curl -L hologram.io/python-install | bash
curl -L hologram.io/python-update | bash

sudo pip install adafruit-io
sudo pip install obd

Hardware

Run the Example

  1. Clone this repo
  2. Create a file adafruitConfig.py with the following:
ADAFRUIT_IO_KEY      = 'YOUR ADAFRUIT IO KEY'
ADAFRUIT_IO_USERNAME = 'YOUR ADAFRUIT IO USERNAME'
  1. Spin up the network connection through the NOVA
sudo hologram network connect
  1. Start the script
sudo python main.py
  1. Go to your adafruit.io account and create a dashboard to watch your new feed named "fleet"
  2. ????
  3. PROFIT

OBD-II Commands

The main example send up values returned from the SPEED command. Below is a basic example of how to use the OBD python library.

Here is a link to all the supported commands: https://github.com/brendan-w/python-OBD/blob/master/docs/Command%20Tables.md

Give different ones a shot and see if there is data that you might find more useful from your vehicle.

import obd

connection = obd.OBD() # auto-connects to USB or RF port
cmd = obd.commands.STATUS # select an OBD command (sensor)
response = connection.query(cmd) # send the command, and parse the response

print(response.value) # returns unit-bearing values thanks to Pint

Adafruit IO dashboard

Dashboard set-up is similar to this guide https://cdn-learn.adafruit.com/downloads/pdf/adafruit-io-basics-gps.pdf

To better understand the API and different ways to send data you can check out these docs https://learn.adafruit.com/adafruit-io/mqtt-api

example_dashboard

You can’t perform that action at this time.