Introduction

OBDII Service 0x22 queries have the potential to provide direct RAM Address polling for any module connected to any of the CAN busses serviced by the Central Gateway Module (ZGM). To facilitate this level of access, BMW OBDII Service 0x22 queries and responses utilize extended addressing as specified by ISO 15765-2 (ISO-TP). For more detail refer to our BMW CAN Bus Data Page.

After reviewing the last opensource release v.2.19.0 (available from  github), of the device firmware, it was determined that the RaceCapture firmware OBDII implementation did not provide the configuration options necessary to accommodate ISO-TP extended addressing. Therefore, a Lua script was developed to perform these queries. This script was developed and tested on the BMW G29/J29 vehicle platform. Although the testing to this point has been limited to the DME (ECU Address 0x12) it should work with any valid ECU Address and PID combination.

This is a general guide to preparing your RaceCapture device to run the Lua script. The prepared and minimized Script is available as a community script preset in the RaceCapture app. The full script with comments and documentation is available as a github repository rcp_bmw_service_0x22.

Race Capture OBDII Mapping

The BMW Central Gateway Module (ZGM) will not process OBD queries from the script while also processing OBD queries that are generated by the RaceCapture device configuration. Make sure to Disable OBDII Mapping in the device configuration settings.

Battery Voltage Threshold

It was discovered that engaging the vehicle security system (locking the doors) while Service 0x22 Data was actively being queried would trigger the vehicle alarm. To mitigate this behavior a Battery Voltage Threshold was implemented as a means to determine if the vehicle engine was running. Battery Voltage was selected because it is an internal analog sensor present by default in the device. Through trial and error a value of 13.5 Volts has seemed to work well. Adjustment may be needed if battery voltages are different on your vehicle.

PID Statistics Logging

A PID Statistic logging feature is provided to help “tune” PID queries, and PID list configurations. It is recommended to leave logging disabled unless you are attempting to adjust PID update rates.

Can Bus Logging

A CAN Bus logging feature is present to help diagnose communication issues. It is recommended to leave logging disabled unless you are attempting to diagnose a communication problem.

BMW OBD Service 0x22 CAN ID

During development and testing, it was determined that the ODB Service 0x22 Broadcast CAN ID was not the OBD standard ID (0x7DF). These options were implemented to allow for configuration of the Broadcast and Response ID. This should only be changed if your vehicle uses a different Broadcast CAN ID.

BMW OBD Service 0x22 PIDs and Channels

The script uses Virtual Channels created and configured during script initialization. The information needed to create the Virtual Channels and manage messaging is stored in a set of Lua Key-Value pairs. The Key is the 16-Bit PID (in hexadecimal). The associated Value is a Lua Table containing the configuration values for the Virtual Channel. Shown Below is a small sample of the Key-Value Pairs followed by a description of the table structure.

PID Maps

OBD Service 0x22 PIDs are manufacturer and even platform specific. Maps for the B48, B58, N55, S55, N63 and S63 are currently available. PID Maps for other platforms are currently being researched.