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

Logging Multiple CAN Buses to PC with my CAN-Do Program

Discussion in 'Model S' started by garygid, Mar 10, 2016.

  1. garygid

    garygid Member

    Joined:
    Aug 11, 2014
    Messages:
    612
    Location:
    Laguna Hills, Orange County, CA
    I have been asked about my logging of multiple CAN buses, up to 4 simultaneously.

    Here, I will attempt to describe what we have done to facilitate our exploration and
    further our understanding of the data that we find on the CAN buses of various EVs.

    There are many OBD2 analyzers that plug into the OBD port on "smog-producing" cars.
    The no-emission EVs are not required to conform to the OBD2 specifications, so most
    manufacturers of BEVs have invented their own proprietary CAN messages and data.

    We started with the Nissan LEAF almost 5 years ago, shortly after some of us got our LEAFs.
    Using meters and oscilloscopes, we found 3 CAN buses on the LEAF's OBD connector,
    and another hidden CAN bus. On the Rav4EV there are at least two CAN buses, one
    "hidden" in the back of the car. In the Tesla, we know of 4 on the "hidden" TDC, probably
    two on the OBD connector, and at least one elsewhere. So, the question remains, what
    can we learn, just by listening, recording (logging), and examining the data that we log.

    A few details to cover in future posts:
    1. Hardware, for logging 1, 2, 3, or 4 CAN buses.
    2. Firmware for the above hardware.
    3. PC Software for Logging, and investigating the Logs.
    4. Investigation techniques.

    More later, with pictures, and links to sources.
    Cheers, Gary
     
  2. MarcG

    MarcG Active Member

    Joined:
    Oct 29, 2014
    Messages:
    1,663
    Location:
    San Francisco
    Subscribed. Looking forward to it!
     
  3. garygid

    garygid Member

    Joined:
    Aug 11, 2014
    Messages:
    612
    Location:
    Laguna Hills, Orange County, CA
    #3 garygid, Mar 11, 2016
    Last edited: Mar 11, 2016
    Logging Hardware #1

    In the hardware area, we have several pieces of the system:

    1. Connectors and wiring to connect #2 to the CAN buses of interest.
    I will deal with that in my next post, what we did for the LEAF, and what
    we are doing for the Tesla.

    2. High speed CAN readers: One for each CAN bus, programmed to try to catch all
    the CAN messages, buffer if needed, are used to send each message quickly to the PC.
    Since the AVR-CAN board was not very expensive from Mouser, we started using
    it to log one LEAF CAN bus, what we called the EV-CAN bus (its power train bus).
    Later, we used 3 or 4 of these boards for simultaneous reading of more CAN buses.

    3. The AVR-CAN board has a serial RS232 type output. Since most PCs no longer
    have the "old" DB9 (9-pin) RS232 ports, but there are a lot of older RS232 devices
    in use, people started producing RS232-to-USB adapter cables, and some work
    better than others. We found some that worked well, and use these to send the
    AVR-CAN board's output to the PC laptop. When logging multiple CAN buses, we
    found a 4-port high speed RS232 to USB adapter box that was convenient to
    use with multiple AVR-CAN boards. Details, pictures, and links later

    --------''
    To support the above hardware, I used Visual Basic 6 (yes, now fairly old) to write a program for the PC
    to capture, time-stamp (seconds and milliseconds), add Date-Time pseudo-messages, and store
    the messages in a large array. Then, adding Save to and Read from Log files, and ways to view and
    graph selected message data in various ways facilitated our investigation, initially
    a search for a better indication of the LEAF's "fuel on board".

    We logged a 6 hour charging session, and started looking for data that was gradually increasing.
    More on that later, but we were successful.
     
  4. MarcG

    MarcG Active Member

    Joined:
    Oct 29, 2014
    Messages:
    1,663
    Location:
    San Francisco
    Gary do you know anything about the below cable? If I married this to a "standard" ODBII-USB cable (I have the HEX-USB from Ross-Teck, which is a dual-K VAG/ISO interface I used successfully as VAG-COM to my last Audi), would it be sufficient to start reading the Model S's CAN buses?

    http://www.panjo.com/buy/tesla-model-s-obd2-can-adapter-cable-pre-sept-2015-265769?utm_source=email_tesla-motors-club_weeklyclassifieds_3112016&utm_medium=email&utm_content=tesla-motors-club&utm_campaign=weeklyclassifieds
     
  5. garygid

    garygid Member

    Joined:
    Aug 11, 2014
    Messages:
    612
    Location:
    Laguna Hills, Orange County, CA
    #5 garygid, Mar 11, 2016
    Last edited: Mar 11, 2016
    Connectors and Wiring #1

    Connectors at the moment are of several types:

    1. The female OBD connector found on most modern vehicles.
    2. The male OBD that connects to #1
    3. The 12-pin Tesla Diagnostics Connector (TDC) used in the pre-Sept 2015 Model S.
    4. The "female" mate to #3
    5. The 20-pin TDC used in the post-Sept 2015 Model S (and in the Model X, we believe).
    6. The "female" mate to #5
    7. The DB9 (9-pin) connector used for RS232 and as input and output to the AVR-CAN board.

    More detail on all of these in a later post.

    ----------
    Generally the Adapter cables used for TM-Spy use only 4 wires, ...from these pins on the "classic" 12-pin TDC:

    1. Ground on TDC pin 9 - goes go OBD pin 4
    2. Power ("12v", usually more) from TDC pin 10 - goes to OBD pin 16
    3. CAN3 High pin 1 - goes to OBD pin 6
    4. CAN3 Low pin 6 (which is adjacent to pin 1) - goes to OBD pin 14

    For logging the single CAN3 bus messages, the same adapter cable can be used,
    giving a "standard" OBD female connector like the car has. However, the Tesla's
    built in OBD connector is not yet sufficiently well understood by us to describe.

    However, for logging up to 3 additional CAN bus messages from the TDC, up to
    three aditional pairs (6 more wires) are needed ... from the TDC ... but to where?

    In our multi-CAN logging for the LEAF, where the LEAF's OBD connector has 3 CAN
    buses wired to it, and we already have cables to log those three, why not use the
    same OBD pins as the LEAF uses? OK, the 4th CAN can be wired to the ODB pins
    1 and 9, that the Tesla S uses for a CAN bus on its built-in OBD connector.

    Good, so my TDC to OBD Logging Adapter will add these pairs to the TM-Spy Adaoter:
    (Which already connects CAN3 (powertrain) to the LEAF's Car-CAN pins; 1 to 6 and 6 to 14)

    1. CAN6 (chassis) pins to LEAF's EV-CAN .... pins: 4 (H) to OBD 13 and 11 (L) to OBD 12
    2. CAN2 (body) .... pins to LEAF's AV-CAN .... pins: 5 (H) to OBD 11 and 12 (L) to OBD 3
    3. CAN4 (body fault tool) pins to Tesla's OBD pins: 2 (H) to OBD 9 ..and.. 7 (L) to OBD 1

    Cheers, Gary
     
  6. garygid

    garygid Member

    Joined:
    Aug 11, 2014
    Messages:
    612
    Location:
    Laguna Hills, Orange County, CA
    #6 garygid, Mar 11, 2016
    Last edited: Mar 11, 2016
    Using ICE OBD2 Diagnostics Tools #1

    The cable is the "standard" adapter cable for TM-Spy, with the 4 wire connections that I described above.

    Concerning your Ross-Tech HEX-USB tools connected to the Tesla:

    Do not ... here us why.

    Some OBD diagnostics tools for ICEs would be able to read the "standard" CAN bus of an OBD2 car,
    but the Tesla does not have anything "standard", and the OBD2 standards do not apply.

    Your software is likely to try to Write to the Tesla's CAN bus, writing things that the Tesla is not
    designed to handle. Those messages written might be ignored, and might not clobber important
    messages in the Tesla, but I would not try it, especially if the Tesla is moving. I say don't try.

    Second, even if there is a Read-Only mode, it is unlikely that the OBD2 software would understand
    any of the Tesla's proprietary messages. So, unlikely to be a useful tool for the Tesla. (**)

    Further, it is unlikely that the tool will "log" and store all the many unknown messages,
    so it is not likely to be useful for the kind of logging that we are doing.

    A good substitute would be the TM-Spy to look at the few things that
    various people have managed to identify, and it is a lot less expensive.
    It only graphs data from one message at a time, but it is being programmed
    to let the user graph any data from any one message ID.

    (**) I suspect that some folks are working on similar tools for the Tesla, but
    we need to know a lot more before we would be able to do that.

    Sorry for the bad news, Gary
     
  7. MarcG

    MarcG Active Member

    Joined:
    Oct 29, 2014
    Messages:
    1,663
    Location:
    San Francisco
    Thanks for the details Gary. I wasn't suggesting using the software from Ross tech, just asking about whether the cable itself has the right pin outs or is it completely useless?
     
  8. garygid

    garygid Member

    Joined:
    Aug 11, 2014
    Messages:
    612
    Location:
    Laguna Hills, Orange County, CA
    The cable from Panjo is useful for accessing the Tesla's CAN3 bus.

    The HEX-USB is a lot more than a "cable". There is a computer in the big end, and
    the program in the PC has to know how to talk to it. Ross-Tech says that is something
    that only their programs know how to do. So, useless to us, it seems.

    Cheers, Gary
     
  9. MarcG

    MarcG Active Member

    Joined:
    Oct 29, 2014
    Messages:
    1,663
    Location:
    San Francisco
    Understood, thanks Gary. Might you suggest a retail OBDII-USB cable (link would be highly appreciated!) that might work with Panjo's then?
     
  10. garygid

    garygid Member

    Joined:
    Aug 11, 2014
    Messages:
    612
    Location:
    Laguna Hills, Orange County, CA
    #10 garygid, Mar 11, 2016
    Last edited: Mar 11, 2016
    A Google search for ... obd2 to usb ... shows lots:
    obd2 to usb - Google Search

    A typical one might be this, but I have no experience with it:
    Highly Reliable ELM327 USB Diagnostic Cable for Various Cars - Black-8.30 and Free Shipping| GearBest.com


    But most of these are meant to work with programs that talk to OBD2 vehicles,
    unless you have a special program to operate it with the Tesla.
    Also, most are too slow to do logging.

    What program do you have/intend to use with it?

    Perhaps best to continue this in another thread, please.
     

Share This Page