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

Using TM-Spy for iOS

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

  1. garygid

    garygid Member

    Joined:
    Aug 11, 2014
    Messages:
    612
    Location:
    Laguna Hills, Orange County, CA
    I connected the adapter cable and connected a LELink dongle (Bluetooth 4.0 Low Energy) to the OBD end of the adapter. Then, using the free LightBlue app (a Bluetooth LE scanner) on the iPad 3, I got:


    So, at least the dongle is able to connect... when a test version of TM-Spy is available.
    Cheers, Gary
     
    • Informative x 1
  2. garygid

    garygid Member

    Joined:
    Aug 11, 2014
    Messages:
    612
    Location:
    Laguna Hills, Orange County, CA
    #2 garygid, Mar 17, 2016
    Last edited: Mar 17, 2016
    Strange, I cannot edit the first post to insert the screenshot.

    So,here it is:
    image.png

    And, a thumbnail to the screenshot:
    image.png

    It appears that, in this new forum, one cannot edit the first post... a bit strange?
    Cheers, Gary
     
  3. markb1

    markb1 Active Member

    Joined:
    Feb 17, 2012
    Messages:
    2,318
    Location:
    San Diego, CA
    I'm in the same place. I have my LELink and cable, and it shows up in LightBlue (but on my iPhone 6S).
     
  4. garygid

    garygid Member

    Joined:
    Aug 11, 2014
    Messages:
    612
    Location:
    Laguna Hills, Orange County, CA
    Turbo3 says the data from the OBDBLE dongle, posted above,
    appears to be as expected.. So, we are on the right path.
     
  5. garygid

    garygid Member

    Joined:
    Aug 11, 2014
    Messages:
    612
    Location:
    Laguna Hills, Orange County, CA
    The first Alpha Test of the iOS version of TM-Spy has been submitted to Apple for testing, and the testers should now have an email with their TestFlight Invitation Code, but my TestFlight program does not accept digits, only alphabetic.

    More info soon.
     
  6. Turbo3

    Turbo3 Member

    Joined:
    Feb 10, 2016
    Messages:
    168
    Location:
    San Jose, CA
    There is no need for any code just start up TestFlight and install TM-Spy.
     
  7. Benjamin Brooks

    Joined:
    Jan 21, 2013
    Messages:
    443
    Location:
    San Jose, California, United States
    I shared my Dropbox folder for TM Spy iOS with Turbo3.
    Looks like from the ELM trace logs that some CAN bus capturing is working, but I have had a BLE->OBD2 connection drop (requiring power cycle of the LeLink module) and app crash occur so far.
    Making progress though :)
     
  8. garygid

    garygid Member

    Joined:
    Aug 11, 2014
    Messages:
    612
    Location:
    Laguna Hills, Orange County, CA
    In the email from Jim, there is a Start Testing button,
    which works to get access to v0.0.1 of TM-Spy for iOS.

    Further, the app opens, but I have not yet been to the car to test it.
     
  9. Turbo3

    Turbo3 Member

    Joined:
    Feb 10, 2016
    Messages:
    168
    Location:
    San Jose, CA
    #9 Turbo3, Mar 18, 2016
    Last edited: Mar 18, 2016
    Ok, I see the problem. Will try to fix and get it uploaded in the next hour.

    ---------------------------
    Version 0.0.2 is being processed by iTunes.

    ---------------------------
    The best way to get data to me is to use the Dropbox sync function in TM-Spy and then share the TM-Spy folder with [email protected]. Then I can review any traces and data files.
     
  10. garygid

    garygid Member

    Joined:
    Aug 11, 2014
    Messages:
    612
    Location:
    Laguna Hills, Orange County, CA
    #10 garygid, Mar 18, 2016
    Last edited: Mar 18, 2016
    From version 0.0.1, which connected to my LELink, and took some time to show any data ... but got most everything excerpt the 12v battery info in the lower left.

    The app asks for access to Location Services, and just has OK ... no No.
    It also asks for Location Services for LeafSpy. Perhaps these are not intended?

    Exiting the app and restarting, the app would not connect to the apparently-busy LELink without powering the dongle off and on (plugging out then in again). While watching for data, the app's green button would flash yellow occasionally, apparently to try to reconnect?

    Here is a screenshot from the iPad 3:
    image.png

    Very good for a first shot and mostly LEAF testing... cool, Jim!

    Thanks a bunch for the early test opportunity (big smile) ✌
    Cheers, Gary
     
  11. Turbo3

    Turbo3 Member

    Joined:
    Feb 10, 2016
    Messages:
    168
    Location:
    San Jose, CA
    What Gary did was to work around the bug in 0.0.1 that prevents moving to reading the next frame by unplugging and plugging the LELink back in again. Slow but you can cycle through reading all the frames this way with 0.0.1.
     
  12. garygid

    garygid Member

    Joined:
    Aug 11, 2014
    Messages:
    612
    Location:
    Laguna Hills, Orange County, CA
    #12 garygid, Mar 18, 2016
    Last edited: Mar 18, 2016
    The v0.0.1 read all the data (Brick Volts, Module Temperatures, and the Total kWh charge and discharge, the Odometer, the two kWh values ...) and kept updating (at least Pack amps) without needing to re-plug the dongle.

    What is a "frame", please? Perhaps one set of all of this data, where possibly the Pack Volts and Amps are handled outside of the "frame" as a special case?

    I turned the A/C up to high-fan, and the amps went up to around 3.0, and then came back down after I returned the fan to low.
     
  13. Turbo3

    Turbo3 Member

    Joined:
    Feb 10, 2016
    Messages:
    168
    Location:
    San Jose, CA
    When I say "Frame" I mean frames having a specific ID number like 0x102 for pack voltage/current or 0x210 for DC-DC information. Version 0.0.1 will sit on one frame ID until you unplug/plug the LELink again. While sitting on that one ID the display will be updated reflecting the incoming data for that one ID. This is how graphing works sitting on a single ID so when I tested with the Leaf everything looked good. The problem is the app will not step to the next ID when not graphing which I currently can not test with the Leaf.
     
  14. Benjamin Brooks

    Joined:
    Jan 21, 2013
    Messages:
    443
    Location:
    San Jose, California, United States
    I'm confused how Gary got graphs in 0.0.1 when the release notes say that graphing isn't supported in this version.
    How many minutes to capture all the data Gary? I tried for ~10 minutes on my car and it wouldn't render any graphs nor log any frame files.
     
  15. Benjamin Brooks

    Joined:
    Jan 21, 2013
    Messages:
    443
    Location:
    San Jose, California, United States
    Never mind, I got it working for the battery cell data. Had to turn off the debug hooks and cycle the LeLink module...
     

    Attached Files:

  16. garygid

    garygid Member

    Joined:
    Aug 11, 2014
    Messages:
    612
    Location:
    Laguna Hills, Orange County, CA
    #16 garygid, Mar 18, 2016
    Last edited: Mar 18, 2016
    There are 3 bar-graphs supported, the Cell (Brick) Voltages, the Module Temperatures, and a histogram of the Cell Voltages, call them "charts".

    The "graphing" part is the gathering of data values over time and plotting them on a horizontal time axis. These data values are extracted from the 8 (or less) data bytes that accompany each CAN message. These messages have a "name", or message identifier (msgID), which is actually a numeric identifier, from 0x000 to 0x7FF in hex, 0 to 2047 in decimal.

    The TM-Spy app supports "Recipes" for specifying the msgID and how to extract the data value from the 8 bytes (D1 through D8) ... like use byte D5 and D2 as a 16-bit integer, with D5 (or D2) being the Most Significant Byte (MSB).

    Using up to 4 lines of Recipe, all with the SAME msgID, one can specify extraction of up to 4 values, like 4 temperature values, from one message, and thus get a string of values that vary over time from a series of messages. This "collecting data" and displaying the data in a time-graph is what Jim calls "graphing". It works (or sometimes not) on the Android version of TM-Spy, but is still under development in the early iOS versions ... so not enabled yet.
     
  17. Turbo3

    Turbo3 Member

    Joined:
    Feb 10, 2016
    Messages:
    168
    Location:
    San Jose, CA
    Since recipes are applied after the data is captured you can update them to show additional new information within the eight bytes to create an updated graph. You can use this feature to capture Message IDs for which we do not know the function and try different recipes to try to see their function.

    Version 0.0.2 is still in the automated step of "processing" so it does not look like it will get to the review step today.

    Most likely I will replace it with a newer version tonight (0.0.3) with additional improvements for tomorrow.
     
  18. garygid

    garygid Member

    Joined:
    Aug 11, 2014
    Messages:
    612
    Location:
    Laguna Hills, Orange County, CA
    Where are the files, like Recipes, frames, logs, etc. that we might need to see, edit, send to you, etc.? Apple seems to hide things that are not in the Documents folder. It appears that in Settings one can choose to use the Apple Cloud (which I do not use) for your output files, but how about accessing and editing the Recipe files?

    Perhaps you intend to show and edit them, line by line, on one screen in the app?
    Can the app access files in the Documents folder?

    Thanks for this first iOS app, Gary
     
  19. MikeBur

    MikeBur ManualPilot

    Joined:
    Dec 8, 2014
    Messages:
    579
    Location:
    Seattle, WA
    Got this going, thanks Jim.

    Using BT LELink.

    First time plugging in, was amazed how fast adapter sync'd. Much better than BT pairing nonsense. No data was exchanged with TM-spy 0.01 with app halted at "connected 20" in green at bottom right. 1 dropped frame from 2497.

    Exiting app and restarting resulted in data being captured for battery and connecting cycling from 1-26/27.

    Buglet: connected to old Dropbox account by mistake and cannot reset. I had stupidly backed up the settings after doing this, do restoring does not address. Can you add a "reset to default" in the settings please? ;-)

    Resolution / orientation all looks good. I'd like to upload some screens, though this new forum sw appears to have taken the simple and make it too complex... 3 media albums created by me, though none accessible by me :-(
     
  20. Turbo3

    Turbo3 Member

    Joined:
    Feb 10, 2016
    Messages:
    168
    Location:
    San Jose, CA
    You use iTunes to access the TM-Spy Documents folder.

    Startup iTunes with your iOS device plugged in. Select "Apps" just below "Summary" in the left top window. Scroll down to the "File Sharing" panel and select "TM-Spy". You will now see the folder with all the documents TM-Spy uses/creates. Unfortunately user accessible sub-folders are not supported in iTunes so everything goes together. For Dropbox TM-Spy uploads things to separate folders.
     

Share This Page