This code uses my PSA VAN CAN bridge hardware from this repository to read the mileage from the odometer from cars with VAN bus. It uses the same command which is used by the BSI to read the mileage at startup.
I wanted to replace my odometer in my car with a different one. But unfortunately there is no safe way to know what mileage does the replacement unit has. And if it has a higher value than what the BSI stores then the value in the BSI gets overwritten. If it has a lower value than the BSI has then we are good, as the odometer will adjusts itself to the higher value, which means I will see the same value as my old odometer had.
You need to connect the DATA and DATAB pins on the VAN CAN bridge hardware to the appropiate pins of your odometer (it is different for each car model, so I can't help with that info). You should look for the numbers on the wiring loom of your car. DATAB is marked with number 9005 and DATA is marked with number 9004
Follow these steps to build the project:
- Install the ESP32 boards into the Arduino IDE (follow the instructions here)
- Install the libraries from the Used libraries section
- They should be installed under your documents folder. Which should be something like this:
- C:\Users\YOUR_NAME\Documents\Arduino\libraries
- At the end you should have a folder structure similar to this:
- C:\Users\YOUR_NAME\Documents\Arduino\libraries\esp32_arduino_rmt_van_rx\
- C:\Users\YOUR_NAME\Documents\Arduino\libraries\tss463_van\
- They should be installed under your documents folder. Which should be something like this:
- Extract the contents of the zip file
- Open the empty read_van_mileage\read_van_mileage.ino file from the Arduino IDE (do not rename any file or whatsoever)
- Select ESP32 Dev module from Tools\Board menu
- Now you should be able to compile it by clicking on the menu Sketch\Verify/Compile
You can also open the project from PlatformIO. It will download the necessary libraries so you don't have to worry about them.
- Arduino abstract serial (you don't need to install this one as the required files are included in the src/SerialPort folder)
- ESP32 RMT peripheral VAN bus reader (can be installed from the library manager from the Arduino IDE)
- TSS463C VAN interface library (can be installed from the library manager from the Arduino IDE)