TMC is an independent, primarily volunteer organization that relies on ad revenue to cover its operating costs. Please consider whitelisting TMC on your ad blocker or making a Paypal contribution here: paypal.me/SupportTMC

Moc Tesla Canbus Development

Discussion in 'Model S: User Interface' started by mochouinard, Apr 2, 2016.

  1. mochouinard

    mochouinard Member

    Joined:
    Aug 3, 2014
    Messages:
    339
    Location:
    Montréal, Quebec, Canada
    Hi,

    I've created the site Teslalog.com over a year ago to record data that provided from the Tesla API.

    That data set provided by the API is useful but limited... So I've started exploring recording the CANBus data directly from the car.

    I've work with a bunch of you in decoding a bunch of new CANBus messages on the Tesla Model S and I was at a point where I had to start visualize all this information for post recording or realtime data.

    So here a page where you can see prerecorded data played back at random speed (depend of your browser speed (I recommend chrome over firefox for speed).

    https://teslalog.com/demo_canbus_recorded_route/

    This is not all the informations I've decoded... Just an experiment I've started yesterday on how to display it on screen.

    The top graph show the different voltage of all the 96 group of battery in a 85kWh battery pack.

    Bottom left show different temperature within the battery pack (32 sample).

    Bottom center show a display similar to the Tesla Model S legacy cars. It will display the Speed, Power, Cruse Control Speed and Range.

    Bottom right show GPS coordinate.

    This is running of a Raspberry Pi 3 (Work also on a Raspberry Pi Original with lot of USB devices).
    I use Wifi for automatic upload of locally recorded canbus data in a custom fileformat I made.

    I use bluetooth for configuration of the raspberry pi and live capture of data like what you see here on a android application (Maybe ios too... but I got no mac or iphone compile it on).

    I'm using a Cantact.io CANBus USB capture device with a custom firmware I've made so it capture everything on a raspberry pi.

    And a cheap GPS 20$ GPS Receiver since I don't have the GPS coordinate position from the car.

    The whole setup cost about 130$ USD excluding a case for the electronic and installation time. But if I had more time and knowleadge, I would make something a little bit more integrated into a single device (and have more canbus connections).

    I've made the capture system in C for the Cantact, GPS & Bluetooth so it run smoothly on the Raspberry pi and to be low power. Everything running off a single Tesla USB Port. I haven't checked but I'm guessing it draw less than 10watt (versus the +220watt the rest of the car draw when idle and no one in it)

    So I'm not 100% sure where I'm going with this :) My main interest was to record all the canbus data so if something happen, I can go look at it. At the same time, 3G service included with the car won't be on for ever(maybe), and Tesla might decide to block usage of Teslalog.com / visibletesla...

    It also reduice the vampire drain versus Teslalog.com since you can let the car go to sleep, which will disable the USB power and shutdown the raspberry pi, and when power return, the capture start backup automaticly.

    And when I get home and in range of my wifi, it will connect and upload everything to my server.

    So that about 1 month of experimentation. Oh and I also have Teslalog.com I'm working on (a little bit less though), and an actual job I got to work.

    I hope you guys find this interesting.

    Marc
     
    • Like x 1
  2. garygid

    garygid Member

    Joined:
    Aug 11, 2014
    Messages:
    612
    Location:
    Laguna Hills, Orange County, CA
    Where do you find the Rated Range and Speed, please?

    Do you have a list of msgIDs and Data Byte Numbers for other interesting data?

    Thanks, Gary
     
  3. mochouinard

    mochouinard Member

    Joined:
    Aug 3, 2014
    Messages:
    339
    Location:
    Montréal, Quebec, Canada
    Well there is a bunch of msgid that is decoded by me and others devs. I can't share that document since it not my document to share...

    You can check Wk057 pdf document that contain already a lot of information including the speed I think.

    Or you can look at the html source code to look at the different ID and what I did to get the interesting value
     
  4. joaquinsfy

    joaquinsfy Member

    Joined:
    Sep 10, 2015
    Messages:
    32
    Location:
    barcelona (spain)
    nice job!!
     
  5. artsci

    artsci Sponsor

    Joined:
    May 10, 2012
    Messages:
    4,675
    Location:
    Timonium, Maryland
    Do you have the data for right and left rear turn signals, reverse light, running lights, and something that indicates the car is charging?. Not to be disrespectful, but the battery info is interesting but from a practical point of view useless. But one could do something very valuable (read control the lighted rear applique) with the data suggested.

    In fact tapping that CAN bus data would eliminate a hours of wiring work from the installation.
     
  6. mochouinard

    mochouinard Member

    Joined:
    Aug 3, 2014
    Messages:
    339
    Location:
    Montréal, Quebec, Canada
    As long as things work ok, I agree that lot of info is just fun to have... Even with just teslalog.com I can follow history of the battery state in some way. But I do get much better information from the canbus data.

    On the canbus, you do get all this informations you want. In my case, it on a different bus so I would need a second canbus adaptor. But for your need, you would just need one. Unless you want to do progressive breaking light based on the regen on the motor...
     
  7. mochouinard

    mochouinard Member

    Joined:
    Aug 3, 2014
    Messages:
    339
    Location:
    Montréal, Quebec, Canada
    Note that Tesla Canbus wire are considered critical part of the car and are NOT TO BE SPLICED !!! So connect where there is a free connector only. And be sure that your canbus interface is READ ONLY ! Do not inject any message on any canbus.

    If I ever install a hitch on my tesla, I'll do a wireless interface that will control the light on the trailer instead of doing wirering splicing.
     
  8. Chris TX

    Chris TX Active Member

    Joined:
    Sep 30, 2013
    Messages:
    1,486
    Location:
    Dallas, TX
    Doing some CANbus playing, myself. I've connected to buses 2,3,4, and 6 through the TDC behind the cubby and none of them provide a response for OBD PIDs, from what I've seen. Does anyone know how to get a response for Mode 1, PID 0 request? I haven't explored the K line bus, yet.
     
  9. garygid

    garygid Member

    Joined:
    Aug 11, 2014
    Messages:
    612
    Location:
    Laguna Hills, Orange County, CA
    It is most likely that Tesla does not support any of the OBD2 queries, which are only required in vehicles that produce emissions.
     

Share This Page