DIY open-source SD2 diagnostic software project | FerrariChat

DIY open-source SD2 diagnostic software project

Discussion in 'Technical Q&A' started by colinb, Dec 20, 2024.

This site may earn a commission from merchant affiliate links, including eBay, Amazon, Skimlinks, and others.

  1. colinb

    colinb Rookie

    Oct 15, 2006
    12
    NH
    Full Name:
    Colin
    Hi all,

    I've been working on some open-source software that replicates parts of the SD2 system capability. It's not a finished product, and at the moment, it's probably only of interest to those who have an engineering/software background and are looking for a DIY project. I'd be happy to get feedback or contributions.

    For the most part, the ECUs supported by SD2 use K-Line communication (0V/12V) and there are plenty of USB K-Line adapters on the market. They vary in quality, but the important thing is to find one that uses a genuine (i.e. not counterfeit) FTDI chip. One of these cables -- which are generally less than 50 USD at the time I'm writing this -- will replace the specialized serial transceiver hardware in the SD2 "Tester" tablet. Most of the in-car diagnostic ports in the F355/456/550 era use the three-pin connector that was common across FIAT/Alfa/Lancia vehicles at the time. There also exist commercial adapters that will allow mating these three-pin connectors to the 16-pin OBD2-style connector used by the USB K-Line adapter.

    Many of the pre-OBD2 cars supported by SD2 use an old Bosch protocol called KWP-71. There are also some that use a KWP-71 derivative named FIAT-9141, a few that use something called Marelli 1AF, and several other oddball protocols. My goal is to provide a generic implementation of these protocols in software so that they could be used with any car/ECU that supports them. ECUs in the OBD2-era cars started to use KWP2000 and CAN bus, which of course are better documented and have support from various existing software libraries. Because of this, I have been focusing on the earlier, more obscure protocols.

    Regardless of protocol, diagnostics for a particular ECU requires knowledge of the memory locations at which different parameters are stored, and the format of those parameters. I wrote a software simulator of the SD2 Tester tablet so that I could connect to it with the Win32 SD2 software, and this allowed dissecting the requests/responses for individual ECU parameters.

    So here's the stack of things needed for an SD2 alternative based on open-source software:
    • Physical connector / adapter (e.g. FIAT 3-pin to J1962 16-pin)
    • Serial transceiver hardware (FTDI USB K-Line cable)
    • Software implementation of protocols. I wrote this C++ library intended for use on Linux, and it currently supports KWP-71, FIAT-9141, and Marelli 1AF (untested): https://github.com/colinbourassa/libiceblock
    • Config file definition of ECU parameters. I've just built a couple of these as an example. I chose JSON as the file format: https://github.com/colinbourassa/torinoscan/tree/master/json
    • Front-end software that uses the protocol library and parameter config files to actually read and display data. This part doesn't exist yet.
    For reference, I've also built a list of SD2-supported ECUs, with (incomplete) details about each module's protocol, baud rate, and bus address: https://github.com/colinbourassa/torinoscan/wiki/List-of-ECUs

    To build additional JSON config files for more ECUs, it's probably easiest to run the original SD2 Windows software in VirtualBox and connect it to the SD2 Tester Simulator that I wrote: https://github.com/colinbourassa/sd2-tester-sim
    This allows the user to set values at arbitrary memory locations to see the reaction of the SD2 software.

    I also wrote up the details of the SD2 Tester protocol here: https://colinbourassa.github.io/car_stuff/sd2/

    I hope this is useful or interesting!

    --Colin
     
  2. flash32

    flash32 F1 Veteran

    Aug 22, 2008
    7,134
    Central NJ
    Full Name:
    Dominick
    This is exciting news ...
    Can the parameters and config be used with the kwp71 diag tool front end
     
  3. colinb

    colinb Rookie

    Oct 15, 2006
    12
    NH
    Full Name:
    Colin
    #3 colinb, Dec 20, 2024
    Last edited: Dec 20, 2024
    No, I created my own config file format. I hadn't read much information about Kwp71Diag (which seems to be related to UniDiag somehow?), but that seems to be closed-source software. My intent is to make this as open/free as possible so that diagnostics are accessible to everyone.

    Edit: My "torinoscan" project (on Github) is the beginning of a front-end interface, but it doesn't yet do much. I'll continue to work on it as time allows.
     
    flash32 likes this.
  4. flash32

    flash32 F1 Veteran

    Aug 22, 2008
    7,134
    Central NJ
    Full Name:
    Dominick
    I was hoping with your knowledge you can create the mapping for kwp71 and be closer ..thoughts
     
  5. flash32

    flash32 F1 Veteran

    Aug 22, 2008
    7,134
    Central NJ
    Full Name:
    Dominick
    BTW - I am very interested in your work since I have a 512 TR and always wanted to view engine live data
     
  6. colinb

    colinb Rookie

    Oct 15, 2006
    12
    NH
    Full Name:
    Colin
    I haven't been able to find any information about the details of the Kwp71Diag config file(s), or even a working link to download it.
     
  7. colinb

    colinb Rookie

    Oct 15, 2006
    12
    NH
    Full Name:
    Colin
  8. Emanuele

    Emanuele Rookie

    May 11, 2007
    40
    Bologna (Italy)
    Very interesting! I translated the libiceblock library to use it in windows and tried with the Ferrari 550 Bilstein ECU, I can get the 5 baud initialization and the ISO code but then the ECU doesn't respond anymore. Has anyone tried the original code on a Bilstein ECU?
     
  9. brogenville

    brogenville Formula 3
    Rossa Subscribed

    Apr 24, 2012
    2,310
    UK
    Full Name:
    Robin
    Anyone here fancy making a GUI for this so that non software engineer types can make sense of it?

    Great job though regardless.
     
    flash32 likes this.
  10. Tonybolony

    Tonybolony Rookie

    Apr 10, 2025
    6
    Full Name:
    Antony Jones
    same here a gui would be awesome
     
  11. 360trev

    360trev F1 Rookie
    Project Master

    Oct 29, 2005
    4,330
    Gibraltar
    Full Name:
    360trev
    Sent you a pm.
     
    Andviv likes this.
  12. szechyjs

    szechyjs Rookie
    Silver Subscribed

    May 1, 2025
    4
    Ohio, USA
    Full Name:
    Jared
    Software engineer here, would be happy to help.
     

Share This Page