Open Source Tuning

From Simos Wiki
Jump to navigation Jump to search

What is it

Open source tuning is, generally, the use of openly available tools to tune a car. Some would argue that you can even consider it open source tuning if you're using commercial tools since we're all relying on openly shared information.


Who is it for

How does it work

The process follows along with the overview provided in other pages on here. To recap:

  1. Flash an application software to your ECU that allows for modified blocks
  2. Edit the calibration
  3. Flash the modified calibration
  4. Log the modifications and see what changed
    1. Logging with ED based ASW can be done by using the python based logger available here [SimosHighSpeedLogger]

In the case of open source tuning we really need to rely on two things:

  1. The ability to flash files to the ECU
    1. Using some commercially provided solution
    2. Using some open source solution like @bri3d's [VW_FLASH]
  2. The ability to edit the calibration
    1. Using software like RomRaider or TunerPro AND
    2. definitions files for the calibration (which point to where tables/maps/values are located in the raw bin) [Simos Definitions]

Definitions by and large are built by other enthusiasts that have taken the time to locate the maps. There are *factory* definitions files (called A2L) that provide everything, but those will only be used with other commercial software. They're also not openly available.

Why should I open source tune?

Nobody can tell you why you should or shouldn't.... but in general:

  1. You'll learn more about your car/engine and how things work
  2. You'll feel better about the changes that you've made because you can learn how to optimize them
  3. You won't have anybody to point a finger at when something breaks
  4. You can make the community better by learning and sharing

What are the risks?

Total ECU brick and or broken hardware. Nobody guarantees anything.

How can I contribute

If you want to help contribute to the open source project, start by getting acquainted with the process. Check out the github repos for the flasher tool and the definitions. And reach out to webmaster@simoswiki.com

Thats cool - but how

Using Brian Ledbetters VW_FLASH Tool

Steps

  1. Build your tune(cal) in tunerpro
  2. Copy the cal to your raspberry pi
  3. Checksum the cal
  4. Encrypt and compress the cal to prepare it for flashing
  5. Flash it

Directions below will assume you have a directory on your pi for the flash tool (/home/pi/VW_FLASH) and for your tunes (/home/pi/flashfiles/tunes)

Copy the cal to your raspberry pi

A suggestion is to create a directory on your pi (within your home directory) that can hold all your tunes. Something like /home/pi/flashfiles/tunes

Using something like winscp (or scp if you're on a mac, or any number of other methods to transfer files to your pi), transfer your tune file to this directory:

pscp C:\somedirectory\thisismytune.bin pi@raspberrypi.local:/home/pi/flashfiles/tunes/thisismytune.bin

Checksum the cal

We won't re-explain everything... Just know that your file needs to be checksummed

Assuming you put the cal in /home/pi/flashfiles/tunes/thisismytune.bin

cd /home/pi/VW_FLASH
python3 checksumsimos.py -i /home/pi/flashfiles/tunes/thisismytune.bin -o /home/pi/flashfiles/tunes/thisismytune.bin.checksummed --block 5

The above commands will use the -i input file to create a -o output file that's been checksummed as a --block 5 (cal block) file.

Encrypt and compress the cal to prepare it for flashing

Thanks to Brian and David, we can then encrypt and prepare the CHECKSUMMED file for flashing by:

cd /home/pi/VW_FLASH
./prepareblock.sh /home/pi/flashfiles/tunes/thisismytune.bin.checksummed 5

This is a bash script that will re-run the checksum checker and (if it's valid), compress the file using VW's keys, and then encrypt the file and append .flashable to it. You'll now have a few extra files in your /home/pi/flashfiles/tunes directory. A worked example:

pi@raspberrypi:~/VW_Flash $ ls -l /home/pi/flashfiles/tunes/
18tsi_MPI_IS38hybrid_FlexTiming_3000rpmscav_1.9bar_500nm.bin
18tsi_MPI_IS38hybrid_FlexTiming_3000rpmscav_1.9bar_500nm.bin.checksummed
18tsi_MPI_IS38hybrid_FlexTiming_3000rpmscav_1.9bar_500nm.bin.checksummed.compressed
18tsi_MPI_IS38hybrid_FlexTiming_3000rpmscav_1.9bar_500nm.bin.checksummed.flashable

The .compressed file is an intermediate file that we don't really need anymore. And the original .bin file is identical to the .checksummed file (except that the checksum doesn't match). You can continue to build your tune off of EITHER the .bin or the .bin.checksummed file since next time you make revisions - the file will be re-checksummed anyway.

Flash it

The fun part:

cd /home/pi/VW_FLASH
python3 flashsimos18.py --file /home/pi/flashfiles/tunes/thisismytune.checksummed.flashable --block CAL

This command will use the "flashable" file to flash it to the "CAL" block on the ECU. You can also use --block by number.