Anyone know Python?

Developer topics relating to software that logs data from ECUs

Moderator: Freon

Anyone know Python?

Postby hotspoons » Fri Apr 25, 2008 11:39 am

Hello,

I'm in the beginning stages of writing a python library for talking SSM via a Tactrix cable. My goal is to have something cross platform (i.e. works on anything that Python runs on) that will translate ECU parameters into a named socket (on linux/unix/mac) and/or a TCP/IP socket on some arbitrary port; the TCP/IP socket would be capable of two things, depending on the request header:

The first is to serve a web page (i.e. micro webserver) with an AJAX readout of engine parameters, as well as having the ability to select which parameters to read, and have the ability to log this information to a database (SQLite would be easiest and most portable) and play it back. This would allow anyone with a web browser to access your car's engine read-outs from anywhere, so long as the TCP port assigned to the Python library is forwarded to the internet.

The second capability would be to speak a simple protocol allowing a front end to be built for local or remote viewing or logging of data. I started this because I was messing with Cairo/GTK+ python bindings and found it quite easy to make an animated gauge from an SVG file that looked really nice; however, I didn't have a way to get it to talk to my ECU, so here I am.

So...thus far, I've been looking over implementations of SSM in RomRaider, JDash, and ECUExplorer source code. The implementation in RomRaider, from my experience using it, is pretty solid. JDash's implementation is flakier (it works about 1/10 times I try), and I haven't used ECU Explorer, but the source file is several thousand lines of C++ for the SSM protocol for ECU explorer, and isn't as readable as the (still wordy) Java implementations.

Doing something like this in Python would allow for much shorter, easier to read coding, similar portability to Java (i.e. installing Python on Windows, or using the distributed Python on Mac or Linux, is all that would be necessary for this to work), very simple implementation of a web server, and the ability to make front ends in any language on any platform.

Look at the source for PyOBD, and you'll see that talking to a car via Python is orders of magnitude less involved than doing it in C++ or Java. Granted, SSM is a more complicated protocol than OBDII, but this should be quite doable.

Thus far, I have coded about 1/4 of what is necessary to initialize an ECU connection and request data. Once I get it to work, then I would begin coding a web interface and simple protocol, and finish my PyGTK+/Cairo front end for a digital dash. Anyone want to help? I have never done anything with serial communications before, so I could definitely use some help with getting SSM to work; Also, I could use help with writing a front end that work with less required libraries on Mac and Windows (PyGame?). I'm going to set up a LaunchPad page and/or sourceforge page for the project soon...what should I call it? Thanks,

-Rich

References:
hotspoons
 
Posts: 2
Joined: Mon Jun 18, 2007 7:20 pm

Postby Jon [in CT] » Fri Apr 25, 2008 12:25 pm

A couple of people here have mentioned that they've written SSM loggers using Python. I doubt their loggers have implemented the architecture you've described, though.

http://forums.openecu.org/viewtopic.php?p=7590#7590
http://forums.openecu.org/viewtopic.php?p=16984#16984
Jon [in CT]
 
Posts: 352
Joined: Sat Jan 01, 2005 10:23 am


Return to Data Logging Software

Who is online

Users browsing this forum: No registered users and 6 guests