How to Create a New Vehicle Profile
A vehicle profile is a JSON file that tells WiCAN how to communicate with the vehicle. It uses the ELM327 protocol instead of sending raw CAN frames, making it as user-friendly as possible. ELM327 is an AT command-based protocol used by all OBD apps and software. This is also important for creating a profile since most EVs have non-standard PIDs to request data, such as EV battery state of health and other vehicle-specific parameters. These PIDs are not publicly available; however, apps like Car Scanner and Torque have a huge database of these PIDs.
To create a profile for a new vehicle, you should use the Car Scanner app and export the logs to get the correct initializations and try to guess the formula or expression for calculating the parameter.
For this tutorial, we will see how to create a new profile for VW MEB (ID.3) to get the State of Charge (SoC) and Range.
Steps to Create a Profile
- Plug in WiCAN into the OBD port.
- Connect to WiCAN and go to the device configuration page.
- Select the ELM327 protocol and disable MQTT if enabled.
- Submit the changes and reboot.
- In Car Scanner, click on
Settings -> Adapter OBDII ELM327
and select WiFi. - Fill in the WiCAN IP address:
192.168.80.1
and Port:3333
. - On the same page, scroll down and click on Advanced settings.
- Select the ECU protocol. Usually, it is CAN (11 bit ID, 500 Kbaud), but sometimes it can be a different protocol. Try different protocols until you are able to connect to the ECU. Note that the supported protocols are only CAN:
6) ISO 15765-4 CAN (11 bit ID, 500 Kbaud) 7) ISO 15765-4 CAN (29 bit ID, 500 Kbaud) 8) ISO 15765-4 CAN (11 bit ID, 250 Kbaud) 9) ISO 15765-4 CAN (29 bit ID, 250 Kbaud)
- Once you are able to connect and Car Scanner is reading data, press on the SoC sensor and let it read for a few seconds.
- Unplug WiCAN from the OBD adapter so that the last data read by Car Scanner is the SoC data. This will make it easier to find the correct PID.
- In Car Scanner, go to
Settings -> Adapter OBDII ELM327 -> Export log
.
The AT commands will usually look like this. Notice that it first starts by sending some initialization commands. You can refer to the ELM327 datasheet to understand what these commands mean. Note that some commands, such as ATD0
and ATH1
, will be ignored by WiCAN, so there is no need to include them in the initialization string. The most important command here is ATSP6
, which tells WiCAN to set the protocol to 11 bit ID, 500 Kbaud.
ATD
OK
>ATD0
ATD0
OK
>ATE0
ATE0
OK
>ATH1
OK
>ATSP0
OK
>ATE0
OK
>ATH1
OK
>ATM0
OK
>ATS0
OK
>ATAT1
OK
>ATAL
OK
>ATST32
OK
- Now in the logs, scroll down to the end of the log. You will find that
22028C1
is repeated until disconnection, indicating that this is the SoC. You should also note the value of the SoC during logging. - If you scroll up a little, you'll find that some AT commands were sent to set up for the SoC read:
>ATSHFC007B OK >ATCP17 OK >ATCRA17FE007B OK >ATFCSH17FC007B OK >ATFCSD300000 OK >ATFCSM1 OK
- These are the PID initialization commands (
pid_init
).