Skip to content

Relay information from an OBD-II reader to an MQTT broker via Hologram Nova

Notifications You must be signed in to change notification settings

HologramEducation/hologram-vehicle-monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Relay information from an OBD-II reader to an MQTT broker via Hologram Nova

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages