aws / aws-iot-fleetwise-edge

Reference Implementation for AWS IoT FleetWise
https://aws.amazon.com/iot-fleetwise/
Apache License 2.0
62 stars 43 forks source link

Fix the wrong pid on EngineCoolantTemperature #6

Closed waynehuangplus closed 2 years ago

waynehuangplus commented 2 years ago

According to ./datamanagement/types/include/OBDDataTypes.h definition, the pid of EngineCoolantTemperature should be 0X05.

150 enum class EmissionPIDs
151 {
152     PIDS_SUPPORTED_01_20                                                           = 0X00,
153     FUEL_SYSTEM_STATUS                                                             = 0X03,
154     ENGINE_LOAD                                                                    = 0X04,
155     ENGINE_COOLANT_TEMPERATURE                                                     = 0X05,
156     SHORT_TERM_FUEL_TRIM_BANK_1                                                    = 0X06,
157     LONG_TERM_FUEL_TRIM_BANK_1                                                     = 0X07,
158     SHORT_TERM_FUEL_TRIM_BANK_2                                                    = 0X08,

When the campaign is triggered on the demo script, it will use obd-decoders.json as the decoder manifest with OBD signals, however, the pid definition on the obd-decoders.json is different to the OBDDataTypes.h defined. It causes the issue that the Vehicle.OBD.EngineCoolantTemperature data can't be collected on FleetWise.

1298     {
1299         "fullyQualifiedName": "Vehicle.OBD.EngineCoolantTemperature",
1300         "interfaceId": "0",
1301         "type": "OBD_SIGNAL",
1302         "obdSignal": {
1303             "byteLength": 1,
1304             "offset": 0,
1305             "pid": 103,
1306             "pidResponseLength": 3,
1307             "scaling": 1,
1308             "serviceMode": 1,
1309             "startByte": 0,
1310             "bitMaskLength": 8,
1311             "bitRightShift": 0
1312         }
1313     },

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

ruhland commented 2 years ago

Thank you for reaching out. In the J1979DA standard there are two different PIDs about Engine Coolant Temperature The one with PID 0x5 is already in the json: https://github.com/aws/aws-iot-fleetwise-edge/blob/v0.1.3/tools/cloud/obd-decoders.json#L51 but because the names inside the json must be unique we called it Vehicle.OBD.CoolantTemperature. This might be indeed confusing.

The PID 103 (0x67) consists of 3 signals (3 bytes). The first EngineCoolantTemperature (that you modified here) is a bit mask and tells you if ECT1 or ECT2 are present then the following two EngineCoolantTemperature1 and EngineCoolantTemperature2 give the temperature from the corresponding sensor.

So i close this CR. If you have problem reading PID 0x5 Vehicle.OBD.CoolantTemperature from your car please reach out again.