Difference between revisions of "Open Source Tuning"

From Simos Wiki
Jump to navigation Jump to search
 
(13 intermediate revisions by 2 users not shown)
Line 5: Line 5:
  
 
= Who is it for =
 
= Who is it for =
 +
[[File:Stage3.png|frameless]]
  
 
= How does it work =
 
= How does it work =
Line 12: Line 13:
 
#Flash the modified calibration
 
#Flash the modified calibration
 
#Log the modifications and see what changed
 
#Log the modifications and see what changed
 +
##Logging with ED based ASW can be done by using the python based logger available here [[https://github.com/joeFischetti/SimosHighSpeedLogger SimosHighSpeedLogger]]
  
 
In the case of open source tuning we really need to rely on two things:
 
In the case of open source tuning we really need to rely on two things:
Line 36: Line 38:
 
= How can I contribute =
 
= 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
 
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
 +
#Build your tune(cal) in tunerpro
 +
#Copy the cal to your raspberry pi
 +
#Pre-reqs
 +
#Checksum the cal
 +
#Encrypt and compress the cal to prepare it for flashing
 +
#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:
 +
 +
<pre>
 +
pscp C:\somedirectory\thisismytune.bin pi@raspberrypi.local:/home/pi/flashfiles/tunes/thisismytune.bin
 +
</pre>
 +
 +
=== Pre-reqs ===
 +
<pre>
 +
git clone https://github.com/bri3d/VW_Flash.git
 +
cd /home/pi/VW_Flash
 +
python3 -m pip install -r requirements.txt
 +
cd ~/VW_Flash/lzss
 +
make
 +
</pre>
 +
 +
=== 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
 +
<pre>
 +
cd /home/pi/VW_Flash
 +
python3 checksumsimos18.py -i /home/pi/flashfiles/tunes/thisismytune.bin -o /home/pi/flashfiles/tunes/thisismytune.bin.checksummed --block 5
 +
</pre>
 +
 +
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:
 +
<pre>
 +
cd /home/pi/VW_Flash
 +
./prepareblock.sh /home/pi/flashfiles/tunes/thisismytune.bin.checksummed 5
 +
</pre>
 +
 +
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:
 +
<pre>
 +
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
 +
</pre>
 +
 +
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:
 +
<pre>
 +
cd /home/pi/VW_Flash
 +
python3 flashsimos18.py --file /home/pi/flashfiles/tunes/thisismytune.bin.checksummed.flashable --block CAL
 +
</pre>
 +
 +
This command will use the "flashable" file to flash it to the "CAL" block on the ECU.  You can also use --block by number.
 +
 +
= Getting started with a Stage X tune =
 +
 +
 +
== Limiters ==
 +
 +
 +
== Fueling ==
 +
 +
 +
== Torque Request ==

Latest revision as of 13:17, 17 September 2021

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

Stage3.png

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. Pre-reqs
  4. Checksum the cal
  5. Encrypt and compress the cal to prepare it for flashing
  6. 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

Pre-reqs

git clone https://github.com/bri3d/VW_Flash.git
cd /home/pi/VW_Flash
python3 -m pip install -r requirements.txt
cd ~/VW_Flash/lzss
make

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 checksumsimos18.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.bin.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.

Getting started with a Stage X tune

Limiters

Fueling

Torque Request