Sunday 4 p.m.–4:50 p.m.

Hitting the Pavement with Python: Pt1

Josh Francisco

Audience level:
Novice

Description

Using python to interact with aftermarket engine management controllers. Part 1 will focus on the initial discovery of the controller's serial protocol, communicating with the controller over a serial port, unpacking the byte stream, and using Redis as a mechanism to store and radiate data.

Abstract

Intro

Don't be scared! I'll go over the 'need-to-know' automotive bits quickly so that we can remain focused on python.

This project was the result of my second serious attempt at a project in python. I ended up with a good code base for the evolution of a more complete platform in the future.

Talk Outline

Intro

  • ~5min - Introduce self, obligatory company representation

Hardware

  • ~5min - Quickly list required/useful hardware/tools

Software

  • ~5min - Quickly list used software

Preparing a simulated environment

  • Determining your engine's trigger configuration
  • Setup ardu-stim (engine oriented signal generator)
  • Verify serial connection state with TunerStudio
  • Setup MS controller to your engine's specs
  • Wiring the things on a breadboard

The Code

  • Environment setup (redis, pyenv, pip the things)
  • ./collect - start data collection in a loop
  • read .ini config file to determine packet structure
  • open serial connection
  • send 'A' command
  • collect and unpack(struct) result
  • store and publish result to redis
  • ./display - display live data
  • connect to redis channel
  • print published data

The Future

  • Installation into Vehicle
  • Analytics
  • Secondary data sources (ardunios, gpio, etc)