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 and becoming a Supporting Member. For more info: Support TMC

Vendor Scan My Tesla, a CANBUS reader for Android

Discussion in 'Model S: User Interface' started by amund7, Apr 8, 2018.

  1. amund7

    amund7 Former Vendor

    Joined:
    May 8, 2015
    Messages:
    225
    Location:
    Norway
    Logo fra play.png Screenshot_1514928518.png Screenshot_1514923124.png

    Hi,

    Finally we have an official thread in this forum! Ask questions, share your findings, and make this thread awesome. I will try to answer all questions, and take note of any feature requests.


    Google Play links:
    Scan My Tesla
    Scan My Tesla DEMO (this is just a UI demo, playing back a recorded log)

    Documentation:
    scan my tesla


    Background:
    There was so much cool canbus stuff floating around the internet, especially on this forum, but it was really just floating around. I decided to create an app that could decode and display all those known canbus packets, and a framework that would quickly allow me to add new packets when they become available.

    I credit all the reverse engineering work to those who deserve it:
    Most CANBUS packets decoded by Jason Hughes (skie.net)
    Battery cell info decoded by Jack Rickard (evtv.me)
    DC/AC Charge counters publicized by "DB 2"
    HVAC controls by Marc Olivier Chouinard (teslalog.com)
    Trip recording system idea by Marc Olivier Chouinard (teslalog.com)
    Efficiency calculations suggested by WarpedOne

    I have since added a lot of my own, mostly combining already known packets into more interesting ones.

    There is also a simple trip computer, a bit like Tesla's in-built one, but you can have unlimited numbers of them, and it shows you regenerated energy and %, AC and DC charged energy.

    For those interested, I am working on a canbus reverse engineering suite, inspired by comma.ai Cabana, called CanbusAnalyzer: amund7/CANBUS-Analyzer

    The app source code is also in github: amund7/ScanMyTesla
     
    • Love x 9
    • Informative x 4
    • Like x 4
  2. Krash

    Krash Data Technician

    Joined:
    Apr 18, 2017
    Messages:
    1,636
    Location:
    Intermountain US
    #2 Krash, Apr 8, 2018
    Last edited: Apr 8, 2018
    Thank you for building this.

    I notice you have hardware requirements listed in the documentation. What wiring configurations do you support? Specifically do you support the ten wire, four CANBus setup?

    Do you plan to support the Model 3 if hardware isolating the CANBus becomes available?

    For those new to hardware required here is some detail: Diagnostic Port Index

    Happy to analyze any CSV exports for your users, especially if appropriate for understanding performance drivers like power and torque limitations, back EMF and thermal tolerances.
     
  3. amund7

    amund7 Former Vendor

    Joined:
    May 8, 2015
    Messages:
    225
    Location:
    Norway
    AFAIK, ELM327 and STN1110 command sets does not support multiple canbuses simultaneosly. I have a comma.ai Panda for testing, but that has a so incomplete ELM327 implementation that it is useless for Tesla. It could probably be a good platform for multi-bus reading, but it would require moving to USB or WIFI for the connections, removing all the ELM stuff, i.e. a complete rewrite of the app. And the gains are, well, debatable. Do you really need an app to log for 2 hours that your door is closed... stuff like that I think is a lot less useful than the CAN3/powertrain we are currently hooked into. And there is still so much unknown data on CAN3, I would prefer to keep exploring that bus first.

    Just realizing this was maybe not what you asked, the real answer is 'I don't know'. Will can3 line up with the 'regular' wiring in the 10 wire config? If yes, then maybe, except if the obd2 adapter's auto detect features will be confused with the data from the other buses.


    I am very eager to support Model 3, I saw you have a little bit of info on it in your thread, seems like OBD2 adapters will not work anymore?
    I suppose in any case, it will have to be a completely different app, as I am guessing the CAN packet ids will not be shared with S and X.
     
  4. Acho

    Acho Member

    Joined:
    Mar 28, 2017
    Messages:
    381
    Location:
    Las Vegas, NV
    Any plans for iOS version?
     
  5. amund7

    amund7 Former Vendor

    Joined:
    May 8, 2015
    Messages:
    225
    Location:
    Norway
    It was originally planned as a cross-platform project, but turned out not to be so easy (for me, I am Apple illiterate). Basically I would need to team up with a IOS developer, who would have to re-write the UI and bluetooth code for IOS, while basing the core functionalities on a shared code base. Anyone interested let me know. There will be moneys to be had!
     
    • Helpful x 1
    • Like x 1
  6. lymex2018

    lymex2018 Member

    Joined:
    Feb 4, 2018
    Messages:
    132
    Location:
    China
    Glad to have a thread for SMT which is my favorite app. One thing I'd like to do is to make recording while supercharging or on special trips and graph it later by Excel.
    SC-SMT1.1.png
    Do you think the 'lags' (such as the 'Cell temp min' circled above) is due to the slow speed of my ELM327? Or simply the canbus just lazy in sending this information? Or combined?

    Also, can two versions of SMT (such as 1.1.0 and 1.4.3) be installed on one Android phone? If not, I may have to use two phones (but that's Ok for me).
     
    • Informative x 2
    • Like x 1
  7. amund7

    amund7 Former Vendor

    Joined:
    May 8, 2015
    Messages:
    225
    Location:
    Norway
    Thank you for your kind words!

    About the jagged lines of max and min values, it happens because all of the battery cell temperatures have not been updated in a while. Probably this is because your ELM device gets flooded with too many packets too fast, and it randomly misses some of them. There are 2 solutions - log fewer different packets - or get a faster adapter, ODBLink LX is now the best adapter for the money I believe. As you are on to, it's a combination of rare/slow packets for the battery cell readings, and too much fast packets causing the adapter to miss some.

    Scan My Tesla helps you clean up, if you double tap a gauge or reading, it will select other readings within the same CAN packet ID. Meaning, there is no use deleting Battery Voltage if you keep Battery Power, since they both come from the same CAN packet, and the app would still have to keep that packet coming in. If you delete both, the app can change the hardware filters of the adapter, and lock out more traffic. With ELM327 devices the filters are bit based, so the filters have a very limited resolution so to speak. With an ODBLink adapter this is not an issue, it has a different command set that can filter individual packets, and it is in any case fast enough to eat all the car sends.


    You can only have one version of the app installed, but I am curious as to why you want to keep the old version?
     
    • Informative x 2
  8. lymex2018

    lymex2018 Member

    Joined:
    Feb 4, 2018
    Messages:
    132
    Location:
    China
    #8 lymex2018, Apr 10, 2018
    Last edited: Apr 10, 2018
    Thank you very much for the explanation. I may have to get the ODBLink LX in that case.

    I'd like to keep the old version because I have a lot of old logs and I need to compare them with new logs of the same meaning in case something is missing in the new version. If however every item in the old version exists and remains the same, I'll of course discard the old one.

    Edit/add: apart from ODBLink LX (color green), I found an 'updated' ODBLink MX (color black). Do you think this one is better? Or ODBLink LX is enough?

    And I got a log file from one of my fellow who use ODBLink MX on his Model S. There are 255000 lines of data in 1118 seconds, averaging a data line every 4.4ms. Also, the 'SOC UI' and 'SOC Min' are indeed missing from his Jan. 2018 version of SMT.
     
  9. amund7

    amund7 Former Vendor

    Joined:
    May 8, 2015
    Messages:
    225
    Location:
    Norway
    AFAIK the only difference between OBDLink MX and LX is that the MX supports an additional proprietary Ford protocol, which makes no difference for Scan My Tesla.

    SOC UI has been removed, and several other readings have been renamed since the early releases. I can easily re-instate SOC UI and SOC Min if that makes you happy, the oher changes I will have to dig a bit for. Off the top of my head I remember renaming 'Battery Odometer' to just 'Odometer', after 1 or 2 users confirmed this reading does not change with loaner batteries, or new replaced batteries.
     
  10. Lukez

    Lukez Member

    Joined:
    Mar 21, 2016
    Messages:
    625
    Location:
    Ontario
    This is all awesome stuff! I've read the various threads on this and want to plug in as well but having difficultly finding what scanner and cable I need for my 2013 MS.

    If possible could you recommend the hardware needed? I read something about different pin outs?

    For example is this the only cable I need? Tesla CAN Diagnostic Cable (2012 - early '15) – Crimped OBD-II | eBay
    What OBD2 scanner do you recommend?
     
  11. lymex2018

    lymex2018 Member

    Joined:
    Feb 4, 2018
    Messages:
    132
    Location:
    China
    In that case, I'll just buy OBDLink LX.

    There is a Bjorn's video indicating that SOC Min is the 'real' SOC (around 00:08:20), although I'm not sure what exactly is that mean.

    I would like to have these parameters back in the log file since they are 'raw' data of the BMS, but they can be hidden from the phone display to make it neat.

    It happened to me once, about 1 minute before I arrived at my usual supercharger, the dash already displayed 0%. When I arrived, I sit there for a while before charging, took a pic of the panel and start SMT recording. Here are the pic and a part log.
    20171228_1306.jpg
    201712281308.png
    I estimate that the dash SOC is about -0.3% at that time, therefore the 'Usable remaining' is about 1kWh above the dash SOC.
    Also, it seems that SOC UI is 4kWh (the buffer?) larger than 'Usable remaining' at that time.
     
    • Informative x 1
  12. amund7

    amund7 Former Vendor

    Joined:
    May 8, 2015
    Messages:
    225
    Location:
    Norway
    Yes, this is the correct cable. I think you need to message them and tell them you want to connect to CAN3 (powertrain bus).

    I reccommend the OBDLink LX, that is the best adapter for the money that I know of now (for this app).
     
  13. amund7

    amund7 Former Vendor

    Joined:
    May 8, 2015
    Messages:
    225
    Location:
    Norway
    Very interesting, so that means there is more you can use after car says 0%? And that 'usable' capacity maybe should be named something else... Do you think that you could drive the car further past 'usable' = 0, or do you think it is good to call it 'usable', so that regular users will not try to drive further?

    But I also know from Bjorns videos that the car can die at 14 km range... so I guess you can never trust the extra buffer below 0 km.

    If you could e-mail me that log to study, I would be very happy!
     
  14. lymex2018

    lymex2018 Member

    Joined:
    Feb 4, 2018
    Messages:
    132
    Location:
    China
    Yes, normally after the car says 0%, even when 'usable capacity' reaches 0, there is still something left. This can be verified by the pack voltage which won't telling lies like the SOC on the dash. In my log example above, the average cell voltage is 3.11V which is about 0.16V above the shutdown voltage and roughly equivalent to around 4kWh remains.

    Another example is from the Kmanauto's video where he continued 'driving' his car after zero mile and squeezed about 3.6kWh before stop testing. The SOC on TM-Spy screen is the same as 'SOC UI', started at 4.0% and ended at about -0.5%.

    I watched that video too, and I don't recommend driving pass 0 neither.

    However, I guess his case is the miss calculation of the SoC that sometime happened near empty especially at heavy load like pulling a trailer. At 00:01:47 of that video, the car suddenly showed 0km, which means the car found out it was wrong and corrected itself.
    Also at around 00:17:24 in the video, the car had been supercharged at about 56kW for about 4.5 minutes (from 17:37 on Bjorn's phone till 17:41:30 on the big screen) but the dash is still 0, which means that the car is at least 4.2kW below zero.

    Sure, but I cannot find you e-mail address. Just give me a PM.
     
  15. GatorGuy

    GatorGuy Member

    Joined:
    Feb 25, 2018
    Messages:
    529
    Location:
    Jacksonville
  16. Krash

    Krash Data Technician

    Joined:
    Apr 18, 2017
    Messages:
    1,636
    Location:
    Intermountain US
    Just drop down the shelf. It will come loose after a few progressively stronger tugs. If you have a prefacelift car be careful not to pull it out as it is hard to get back in. A coat hanger will be useful if you can't reach the cable. No need to get behind the screen unless you are rooting your car.
     
    • Helpful x 1
    • Informative x 1
  17. GatorGuy

    GatorGuy Member

    Joined:
    Feb 25, 2018
    Messages:
    529
    Location:
    Jacksonville
    I have a 2018.

    So I shove everything back inside after it's connected?
     
  18. Lukez

    Lukez Member

    Joined:
    Mar 21, 2016
    Messages:
    625
    Location:
    Ontario
    Just got my cables and OBDLink LX! Do I plug these in and leave them plugged in at all times or should this be only plugged in when wanting to get data?
     
  19. Krash

    Krash Data Technician

    Joined:
    Apr 18, 2017
    Messages:
    1,636
    Location:
    Intermountain US
    #19 Krash, Apr 18, 2018
    Last edited: Apr 18, 2018
    I think the vampire drain is minimal. I would leave it in all the time and snap the tray back up even though think that is a slight security risk. Actually I bought a Y ribbon ODB2 splitter so I can have two devices connected in the center console and swap them at will while keeping the tray closed. But I don't know how well it is going to work. I am still thinking I will wire it up on the four CAN, ten wire setup.
     
  20. GatorGuy

    GatorGuy Member

    Joined:
    Feb 25, 2018
    Messages:
    529
    Location:
    Jacksonville
    Why do you need 2 connections? What else would you attach?
     

Share This Page

  • About Us

    Formed in 2006, Tesla Motors Club (TMC) was the first independent online Tesla community. Today it remains the largest and most dynamic community of Tesla enthusiasts. Learn more.
  • Do you value your experience at TMC? Consider becoming a Supporting Member of Tesla Motors Club. As a thank you for your contribution, you'll get nearly no ads in the Community and Groups sections. Additional perks are available depending on the level of contribution. Please visit the Account Upgrades page for more details.


    SUPPORT TMC