1. Attachments are working again! Check out this thread for more details and to report any other bugs.

PROD - OBD application for Win32 and WinCE (OttoNavi)

Discussion in 'Prius OBDII Third-Party Apps' started by seckwielen, Feb 3, 2013.

  1. seckwielen

    seckwielen Member

    Joined:
    Aug 31, 2012
    112
    26
    0
    Location:
    Florida
    Vehicle:
    2010 Prius
    Model:
    III
    Been working on a WinCE OBD reader for my OttoNavi unit... :cool:

    Developing under Lazarus which allows for win32 and winCE builds... Lazarus is a rather nice FREE visual pascal program platform... it's a free, open source, version of Delphi.

    Have a working Win32 application (both GUI and OBD interface)
    Have a almost working WinCE application (Gui is running, OBD interface need debugging)

    Both applications use a "FTDI FT232RL OBDII USB Interface" from eBay. Less than $30. Prolific will work on Win32 but does not have drivers for WinCE. The FTDI does support WinCE and was rather easy and straight forward to install on my OttoNavi. Putty for CE (terminal program) is working communicating through Com6...

    Thank you to vincent1449p for allowing me to import his Standard and Custom PID files. These allow for super easy decoding of the HEX data from the PIDs.... I have the application able to decode the HEX and use standard mathmatical equations from within the CSV file... IE ICE RPM PID 01c0 is ((A*256)+B)/4

    Here is what the first pass looks like on my OttoNavi...

    Not going to promise quick programming... This is a labor of love, and free time... Program as often as I can from my couch in the evening...

    Still working through the com decoding on the WinCe version... The ports connect but I think the trouble may be missing something simple like a missing or extra ctrl character that is messing with my packet logic... I have just hacked together a test program... I will be testing the com with it shortly... I hope to have the WinCE version not only looking good, but running the numbers as well reall soon...

    -steve

    IMG_1985.JPG
     
    Lakis dj likes this.
  2. seckwielen

    seckwielen Member

    Joined:
    Aug 31, 2012
    112
    26
    0
    Location:
    Florida
    Vehicle:
    2010 Prius
    Model:
    III
    Ok.. Now that the cat is out of the bag..

    What information would on your ideal data screen and what would it look like?
     
  3. seckwielen

    seckwielen Member

    Joined:
    Aug 31, 2012
    112
    26
    0
    Location:
    Florida
    Vehicle:
    2010 Prius
    Model:
    III
    Tested the winCE com port logic this am. Yep. Missing a Ctrl character that my simulator didn't have. Gonna correct that tonight. :)
     
  4. seckwielen

    seckwielen Member

    Joined:
    Aug 31, 2012
    112
    26
    0
    Location:
    Florida
    Vehicle:
    2010 Prius
    Model:
    III
    Woooo Hoooo. :D
    Enabled OBD headers and Linefeeds. The Application is now reading data. (y)
    Now to fix some formatting errors and speed up requests.
     
  5. seckwielen

    seckwielen Member

    Joined:
    Aug 31, 2012
    112
    26
    0
    Location:
    Florida
    Vehicle:
    2010 Prius
    Model:
    III
    WinCE version is running... Win32 version is running... Going though PID list and checking received values with actual reading and comparing with other OBD applications.

    Data requests have been increased but threading out the readport. This also greatly improved the reliabilty of reading the multiline return strings.

    Stay tuned for more...
     
  6. seckwielen

    seckwielen Member

    Joined:
    Aug 31, 2012
    112
    26
    0
    Location:
    Florida
    Vehicle:
    2010 Prius
    Model:
    III
    WinCE version working good on my OttoNavi..... Currently looking into Math Expression Parsing issues..... Win32 reports the correct values... WinCE is giving me slightly different results....
     
  7. seckwielen

    seckwielen Member

    Joined:
    Aug 31, 2012
    112
    26
    0
    Location:
    Florida
    Vehicle:
    2010 Prius
    Model:
    III
    Math Parsing issues was not an issue with the Calculating routine, but a bug in the FormatFloat function in the Lazarus compiler that I chose to use. Hmmppp. I guess that's what you can expect for a free pascal compiler o_O

    Win32 and WinCE now calculating correctly... Working on information displays.

    Anyone have any favorite group of PID information that could be used as a display? Open to suggestions. Thanks.
     
  8. seckwielen

    seckwielen Member

    Joined:
    Aug 31, 2012
    112
    26
    0
    Location:
    Florida
    Vehicle:
    2010 Prius
    Model:
    III
    Ahhhh, sweet success....
    I believe I have the floating point and Lazarus issues corrected. Updated my Lazarus version to the most current, changed my Calculating object to a basic math one, and changed my double/floaing point variable to Currency as described in many WinCE Lazarus application forums.
    I will be posting some pictures in the near future...
     
  9. seckwielen

    seckwielen Member

    Joined:
    Aug 31, 2012
    112
    26
    0
    Location:
    Florida
    Vehicle:
    2010 Prius
    Model:
    III
    Thought I'd post a few pictures of my Prod application running on my OttoNavi.

    Main OttoNavi menu.
    ImageUploadedByTapatalk1363152306.690525.jpg

    Start and connection screen.
    ImageUploadedByTapatalk1363152319.414909.jpg

    PID list, values, and equations.
    ImageUploadedByTapatalk1363152360.557048.jpg

    RPMs.
    ImageUploadedByTapatalk1363152395.594209.jpg

    Temperatures.
    ImageUploadedByTapatalk1363152419.477692.jpg

    Gauges. For RPM and MPH.
    ImageUploadedByTapatalk1363152450.907107.jpg

    MG1 and MG2 statuses.
    ImageUploadedByTapatalk1363152487.011243.jpg
     
    Lakis dj likes this.
  10. GasperG

    GasperG Senior Member

    Joined:
    May 13, 2011
    1,168
    598
    1
    Location:
    Slovenia
    Vehicle:
    2018 Prius
    Model:
    N/A
    Wow, very nice app, I don't have Win CE head unit ... yet, maybe I will buy one.

    - It would be nice to get real time BSFC [g/kWh] of ICE = (Fuel flow[g/h] / (ICE kW))
    - Drive train efficiency:
    - % of power that goes through electric path (MG1 kW/ICE kW)
    - electric path efficiency (MG2 kW / (MG1 kW - battery kW)

    You can calculate kW from torque sensor and rpm sensor = (Nm * 2 * 3.14159 * rpm) / 60000).

    I have no idea if this would be useful in real life driving, but it would be definitely interesting to see.
     
    seckwielen likes this.
  11. seckwielen

    seckwielen Member

    Joined:
    Aug 31, 2012
    112
    26
    0
    Location:
    Florida
    Vehicle:
    2010 Prius
    Model:
    III
    I will check to see if the genIII has those PIDs available, if so ill see if I can add the calculations.

    I also have the application compiled under win32. Lazarus is great in that sense, but still has a few bugs in the CE compiler that I have had to work around.
     
  12. seckwielen

    seckwielen Member

    Joined:
    Aug 31, 2012
    112
    26
    0
    Location:
    Florida
    Vehicle:
    2010 Prius
    Model:
    III
    Thanks to GasperG I have started a new feature. Adding in the ability to include custom equations. I have a basic equation feature coded and working. Basic, meaning as long as all of the PID parameters in the equation come from the same ECU the calculation is good. Working on making it ECU independant, so I can have mixed ECU equation paramters. Should have the multiple ECU code finished by tomorrow.
     
  13. seckwielen

    seckwielen Member

    Joined:
    Aug 31, 2012
    112
    26
    0
    Location:
    Florida
    Vehicle:
    2010 Prius
    Model:
    III
    Mixed ECU equations are now working. Basic Testing completed on my ICE OBD simulator. Some of the more involved equations that I have use Toyota Custom PIDs which I will need to test in the WinCE in my Prius.

    GasperG - waiting to see how your equations work out on the actual ECUs. :) Thanks again.
     
  14. seckwielen

    seckwielen Member

    Joined:
    Aug 31, 2012
    112
    26
    0
    Location:
    Florida
    Vehicle:
    2010 Prius
    Model:
    III
    Been looking into the kW for the ICE.... can't seem to find an active one for the ICE on my 2010 Prius Gen III...
    MG1 and MG2 kW was straighforward... thou torque was in ft/lbs that was easy to convert....

    Anyone have another way to calcualate ICE kW on a 2010 Gen III?
     
  15. vincent1449p

    vincent1449p Active Member

    Joined:
    May 24, 2004
    894
    331
    0
    Location:
    Singapore
    Vehicle:
    2012 Prius c
    There is 1 PID "Requested Engine Torque" which I believe is the requested engine power because the unit is in kW. I think what you want is the actual engine power and you should be able to derive it from the "Actual Engine Torque" * RPM * 2 * 3.14159 / 60000.

    Vincent
     
  16. GasperG

    GasperG Senior Member

    Joined:
    May 13, 2011
    1,168
    598
    1
    Location:
    Slovenia
    Vehicle:
    2018 Prius
    Model:
    N/A
    I calculated it from Actual engine torque, from the list of custom PIDs for Torque app, here is spreadsheet and some data obtained from Torque App:
    Welcome to Google Docs
     
  17. seckwielen

    seckwielen Member

    Joined:
    Aug 31, 2012
    112
    26
    0
    Location:
    Florida
    Vehicle:
    2010 Prius
    Model:
    III
    I found my issue with the PID 2137 not returning a value in my code. It actually was sending a response. The issue was that the first data byte was a 7F which I misinterpreted as a failure packet (03 7F). I now check for more of the failure packet including the size byte.

    I will be testing more tonight. When I get this ironed out I will be posting the executable for others to enjoy and help me test.
     
  18. seckwielen

    seckwielen Member

    Joined:
    Aug 31, 2012
    112
    26
    0
    Location:
    Florida
    Vehicle:
    2010 Prius
    Model:
    III
    Ok. Here y'all go.... V0.99 beta versions Win32 WinCE and the data files.... :cool:
    WinCe is optomized for the OttoNavi.
    Win32 and WinCE GUI are currently created with the GenIII Prius in mind... I'll work later in a configurable GUI...
    But hey... I made it for MY car :p ... and sharing it with you all...:)

    You will need to save the data files a CSV in the same directory as the EXE for them to load.

    I had to comiple with Debug turn off so PriusChat would allow me to upload... The file was too large with it...

    I use TrackBars for ProgressBars because in the Lazarus compiler the WinCE ARM compiled code did not graph correctly..
     

    Attached Files:

  19. seckwielen

    seckwielen Member

    Joined:
    Aug 31, 2012
    112
    26
    0
    Location:
    Florida
    Vehicle:
    2010 Prius
    Model:
    III
    Oh... Use the Debug mode sparingly.... It is quite a CPU hog.... :sick:

    You can right click on the Received Data List, PID Status List, and Debug List to Export them for examination..
     
  20. GasperG

    GasperG Senior Member

    Joined:
    May 13, 2011
    1,168
    598
    1
    Location:
    Slovenia
    Vehicle:
    2018 Prius
    Model:
    N/A
    Will try this on my old Omnia 2 WM phone, will it work?