Posts tagged: Hack

Tesla Roadster Logs and Python

A few days ago I mentioned on my sustainable fuel site TheSmartDrive that I was given a Tesla Roadster to drive for a few days. I was asked to see what ECU information is available, collect and parse the data from it….enter python

Take a look at the full write up: http://mybitbox.com/articles/tesla-roadster-log-parsing/

Update and some python serial info

I had a realization over the past few days.  I realized there is a bunch of stuff I do that never makes it to full projects and write ups but would be pretty cool to post online for fellow electronics and software peoples.  Then I wished I had a personal blog. Then I hit myself and asked why I’m not posting here more often.  So I’ve made the decision that myBitBox is going to have more short posts on cool things rather than wait for the once every 6 month post. And I’m talking about everything, so don’t be surprised to see things on cars, software, analog hardware and even “music of the moment” when I am coding.

So I’m an embedded engineer and work with PIC processors on custom hardware.  This hardware is designed to be in cars, connected to other PIC boards, not connected to a PC.  Because of this, the communication protocol between the boards is packeted with commands and data payloads.  This works well in the system, but is kinda a pain in the ass when you want to test things from a PC. Because of this, I wrote a little terminal program in Python to wrap serial commands in packets to talk to my systems. Yesterday I was doing some research on pyserial and came across this site with a few write ups on serial packets and framing in Python.

http://eli.thegreenplace.net/2009/08/12/framing-in-serial-communications/
http://eli.thegreenplace.net/2009/07/30/setting-up-python-to-work-with-the-serial-port/

This guy has a lot of info on frame wrapping, byte stuffing and how to build a pretty robust serial receiver class, anyone who does serial with Python should check it out.

As for my python terminal program, I don’t have code I can post right now, but I do want to put something up for everyone at some point.

WordPress Themes