diff --git a/index.html b/index.html index c615a23..2068a7c 100644 --- a/index.html +++ b/index.html @@ -133,14 +133,26 @@

Coolant Temperature - + + Coolant Temperature Sensor + - + Air Temperature - + + Air Temperature Sensor + - + EGR Differential Pressure - + + EGR Duty Cycle + - + Lambda - @@ -150,8 +162,8 @@

- - Injection Pulse - - + Injection Pulse (Fuel Pulsewidth) + - Ignition Timing @@ -161,6 +173,14 @@

Speed - + + Normalized air charge value + - + + + Speed Unfiltered + - + Barometric Pressure - @@ -173,6 +193,110 @@

Transmission Oil Temperature - + + Idle Speed Control Duty Cycle + - + + + SCAP Sensor Frequency + - + + + Adaptive fuel correction + - + + + Desired RPM + - + + + Lowest filtered throttle position + - + + + Time since Startup + - + + + OCC Input Level + - + + + Neutral / Drive Input + - + + + Converter Clutch + - + + + Command Gear + - + + + ETV Monitor Voltage + - + + + EPC Pressure + - + + + Transmission Oil Temperature + - + + + PRNDL Position + - + + + Unknown (0x0A) + - + + + Unknown (0x14) + - + + + Unknown (0x16) + - + + + Unknown (0x19) + - + + + Unknown (0x1C) + - + + + Unknown (0x1D) + - + + + Unknown (0x26) + - + + + Unknown (0x29) + - + + + Unknown (0x2C) + - + + + Unknown (0x31) + - + + + Unknown (0x33) + - + + + Unknown (0x34) + - + @@ -196,4 +320,4 @@

- \ No newline at end of file + diff --git a/lib/eec-iv.js b/lib/eec-iv.js index 8603616..b279fe1 100644 --- a/lib/eec-iv.js +++ b/lib/eec-iv.js @@ -240,6 +240,13 @@ class EecIvDecoder { return ((word[1] & 0xF) << 8) | word[0] } + toByte(word) { + if (!this.validWord(word) || !this.validChecksum(word)) { + return null; + } + return word[0]; + } + toRpm(word) { if (!this.validWord(word) || !this.validChecksum(word)) { return null; @@ -247,6 +254,13 @@ class EecIvDecoder { return this.toDec(word)*4 } + toDesiredRpm(word) { + if (!this.validWord(word) || !this.validChecksum(word)) { + return null; + } + return this.toDec(word)*16 + } + toLambda(word) { if (!this.validWord(word) || !this.validChecksum(word)) { return null; @@ -359,11 +373,18 @@ class EecIvDecoder { return word[0] / 4; } - toSpeedDec(word) { + toSpeedUnfilteredMph(word) { if (!this.validWord(word) || !this.validChecksum(word)) { return null; } - return this.toDec(word); + return this.toDec(word) * 0.03125; + } + + toSpeedUnfilteredKmh(word) { + if (!this.validWord(word) || !this.validChecksum(word)) { + return null; + } + return this.toSpeedUnfilteredMph(word) * 1.60934; } toSpeedMph(word) { @@ -486,7 +507,7 @@ class EecIvDecoder { liveData.calibrationInputVoltage = this.toDec(word); break case 0x0C: - liveData.fuelPulsewith = this.toInjectionPulseClk(word); + liveData.fuelPulsewidth = this.toInjectionPulseClk(word); break case 0x0D: @@ -519,13 +540,13 @@ class EecIvDecoder { liveData.idleSpeedDutyCycle = this.toDec(word); break case 0x16: - liveData.airflowMeter = this.toDec(word); + liveData.notUsed16 = this.toDec(word); break case 0x17: liveData.speed = this.toSpeedKmh(word); break case 0x18: - liveData.speedUnfiltered = this.toHexString(word); + liveData.speedUnfiltered = this.toSpeedUnfilteredKmh(word); break case 0x19: @@ -541,24 +562,24 @@ class EecIvDecoder { liveData.notUsed1C = this.toHexString(word); break - case 0x1C: - liveData.notUsed1C = this.toHexString(word); + case 0x1D: + liveData.notUsed1D = this.toHexString(word); break case 0x26: liveData.notUsed26 = this.toHexString(word); break case 0x27: - liveData.airCharge = this.toHexString(word); + liveData.airCharge = this.toDec(word) * 0.0488; break case 0x28: - liveData.adaptiveFuelCorrection = this.toHexString(word); + liveData.adaptiveFuelCorrection = this.toDec(word) * 0.0625; break case 0x29: liveData.notUsed29 = this.toHexString(word); break case 0x2A: - liveData.desiredRpm = this.toHexString(word); + liveData.desiredRpm = this.toDesiredRpm(word); break case 0x2B: liveData.ratch = this.toRatch(word); @@ -568,23 +589,23 @@ class EecIvDecoder { break case 0x2D: - liveData.timeSinceStartup = this.toHexString(word); + liveData.timeSinceStartup = this.toDec(word); break case 0x2E: - liveData.occ = this.toHexString(word); + liveData.occ = this.toDec(word); break case 0x2F: - liveData.neutralDriveInput = this.toHexString(word); + liveData.neutralDriveInput = this.toDec(word); break case 0x30: - liveData.converterClutch = this.toHexString(word); + liveData.converterClutch = this.toDec(word) * 0.0488; break case 0x31: liveData.notUsed31 = this.toHexString(word); break case 0x32: - liveData.commandGear = this.toHexString(word); + liveData.commandGear = this.toByte(word); break case 0x33: liveData.notUsed33 = this.toHexString(word); @@ -597,17 +618,17 @@ class EecIvDecoder { liveData.etvMonitorVoltage = this.toDec(word) / 4; break case 0x36: - liveData.epcPressure = this.toHexString(word); + liveData.epcPressure = this.toByte(word) / 2; break case 0x37: liveData.transmissionOilTemperature = this.toDec(word); break case 0x38: - liveData.prndlPosition = this.toHexString(word); + liveData.prndlPosition = this.toByte(word); break } } return liveData; } -} \ No newline at end of file +} diff --git a/renderer.js b/renderer.js index 3a51826..b140c54 100644 --- a/renderer.js +++ b/renderer.js @@ -50,16 +50,47 @@ const liveDataSupplyVoltage = document.getElementById('data-supply-voltage'); const liveDataThrottle = document.getElementById('data-throttle'); const liveDataThrottleMode = document.getElementById('data-throttle-mode'); const liveDataCoolantTemp = document.getElementById('data-coolant-temp'); +const liveDataCoolantTempSensor = document.getElementById('data-coolant-temp-sensor'); const liveDataAirTemp = document.getElementById('data-air-temp'); +const liveDataAirTempSensor = document.getElementById('data-air-temp-sensor'); const liveDataEgr = document.getElementById('data-egr'); +const liveDataEgrDutyCycle = document.getElementById('data-egr-duty-cycle'); const liveDataLambda = document.getElementById('data-lambda'); const liveDataEgo = document.getElementById('data-ego'); -const liveDataInjectionPulse = document.getElementById('data-injection-pulse'); +const liveDataFuelPulsewidth = document.getElementById('data-fuel-pulsewidth'); const liveDataIgnitionTiming = document.getElementById('data-ignition-timing'); const liveDataSpeed = document.getElementById('data-speed'); +const liveDataSpeedUnfiltered = document.getElementById('data-speed-unfiltered'); +const liveDataAirCharge = document.getElementById('data-air-charge'); const liveDataBarometricPressure = document.getElementById('data-bp'); const liveDataCalibrationVoltage = document.getElementById('data-calibration-voltage'); const liveDataTransmissionOil = document.getElementById('data-transmission-oil'); +const liveDataScap = document.getElementById('data-scap'); +const liveDataAdaptiveFuelCorrection = document.getElementById('data-adaptive-fuel-correction'); +const liveDataIdleSpeed = document.getElementById('data-idle-speed'); +const liveDataDesiredRpm = document.getElementById('data-desired-rpm'); +const liveDataRatch = document.getElementById('data-ratch'); +const liveDataTimeSinceStartup = document.getElementById('data-time-since-startup'); +const liveDataOcc = document.getElementById('data-occ'); +const liveDataNeutralDriveInput = document.getElementById('data-neutral-drive-input'); +const liveDataConverterClutch = document.getElementById('data-converter-clutch'); +const liveDataCommandGear = document.getElementById('data-command-gear'); +const liveDataEtvMonitorVoltage = document.getElementById('data-etv-monitor-voltage'); +const liveDataEpcPressure = document.getElementById('data-epc-pressure'); +const liveDataTransmissionOilTemperature = document.getElementById('data-transmission-oil-temperature'); +const liveDataPrndlPosition = document.getElementById('data-prndl-position'); +const liveDataNotUsed0A = document.getElementById('data-not-used-0A'); +const liveDataNotUsed14 = document.getElementById('data-not-used-14'); +const liveDataNotUsed16 = document.getElementById('data-not-used-16'); +const liveDataNotUsed19 = document.getElementById('data-not-used-19'); +const liveDataNotUsed1C = document.getElementById('data-not-used-1C'); +const liveDataNotUsed1D = document.getElementById('data-not-used-1D'); +const liveDataNotUsed26 = document.getElementById('data-not-used-26'); +const liveDataNotUsed29 = document.getElementById('data-not-used-29'); +const liveDataNotUsed2C = document.getElementById('data-not-used-2C'); +const liveDataNotUsed31 = document.getElementById('data-not-used-31'); +const liveDataNotUsed33 = document.getElementById('data-not-used-33'); +const liveDataNotUsed34 = document.getElementById('data-not-used-34'); connectButton.addEventListener('click', serialConnect); disconnectButton.addEventListener('click', serialDisconnect); @@ -202,7 +233,7 @@ async function serialConnect() { }); } - function updateGui(value, updateHandler) { + function updateGuiValue(value, updateHandler) { if (value !== undefined && value !== null) { updateHandler(value); } @@ -241,21 +272,53 @@ async function serialConnect() { console.log(liveDataDump); - updateGui(liveData.rpm, (rpm) => liveDataRpm.innerHTML = rpm); - updateGui(liveData.supplyVoltage, (supplyVoltage) => liveDataSupplyVoltage.innerHTML = supplyVoltage.toFixed(2) + " V"); - updateGui(liveData.throttlePosition, (throttlePosition) => liveDataThrottle.innerHTML = throttlePosition + " A/D count"); - updateGui(liveData.throttleMode, (throttleMode) => liveDataThrottleMode.innerHTML = throttleMode); - updateGui(liveData.actCelsius, (actCelsius) => liveDataAirTemp.innerHTML = actCelsius.toFixed(2) + " °C"); - updateGui(liveData.ectCelsius, (ectCelsius) => liveDataCoolantTemp.innerHTML = ectCelsius.toFixed(2) + " °C"); - updateGui(liveData.egr, (egr) => liveDataEgr.innerHTML = egr + " A/D count"); - updateGui(liveData.fuelPulsewith, (fuelPulsewith) => liveDataInjectionPulse.innerHTML = fuelPulsewith + " clock ticks"); - updateGui(liveData.totalSparkAdvance, (totalSparkAdvance) => liveDataIgnitionTiming.innerHTML = totalSparkAdvance + "°"); - updateGui(liveData.speed, (speed) => liveDataSpeed.innerHTML = speed + " km/h"); - updateGui(liveData.lambda1, (lambda) => liveDataLambda.innerHTML = lambda); - updateGui(liveData.ego1, (ego) => liveDataEgo.innerHTML = ego + " A/D count"); - updateGui(liveData.barometricPressure, (bp) => liveDataBarometricPressure.innerHTML = bp + " inHg"); - updateGui(liveData.calibrationInputVoltage, (voltage) => liveDataCalibrationVoltage.innerHTML = voltage + " A/D count"); - updateGui(liveData.transmissionOilTemperature, (temp) => liveDataTransmissionOil.innerHTML = temp + " A/D count"); + updateGuiValue(liveData.rpm, (rpm) => liveDataRpm.innerHTML = rpm); + updateGuiValue(liveData.supplyVoltage, (supplyVoltage) => liveDataSupplyVoltage.innerHTML = supplyVoltage.toFixed(2) + " V"); + updateGuiValue(liveData.throttlePosition, (throttlePosition) => liveDataThrottle.innerHTML = throttlePosition + " A/D count"); + updateGuiValue(liveData.throttleMode, (throttleMode) => liveDataThrottleMode.innerHTML = throttleMode); + updateGuiValue(liveData.actCelsius, (actCelsius) => liveDataAirTemp.innerHTML = actCelsius.toFixed(2) + " °C"); + updateGuiValue(liveData.act, (act) => liveDataAirTempSensor.innerHTML = act + " A/D count"); + updateGuiValue(liveData.ectCelsius, (ectCelsius) => liveDataCoolantTemp.innerHTML = ectCelsius.toFixed(2) + " °C"); + updateGuiValue(liveData.ect, (ect) => liveDataCoolantTempSensor.innerHTML = ect + " A/D count"); + updateGuiValue(liveData.egr, (egr) => liveDataEgr.innerHTML = egr + " A/D count"); + updateGuiValue(liveData.egrDutyCycle, (egr) => liveDataEgrDutyCycle.innerHTML = egr + " A/D count"); + updateGuiValue(liveData.fuelPulsewidth, (fuelPulsewidth) => liveDataFuelPulsewidth.innerHTML = fuelPulsewidth + " clock ticks"); + updateGuiValue(liveData.totalSparkAdvance, (totalSparkAdvance) => liveDataIgnitionTiming.innerHTML = totalSparkAdvance + "°"); + updateGuiValue(liveData.speed, (speed) => liveDataSpeed.innerHTML = speed + " km/h"); + updateGuiValue(liveData.speedUnfiltered, (speed) => liveDataSpeedUnfiltered.innerHTML = speed + " km/h"); + updateGuiValue(liveData.airCharge, (airCharge) => liveDataAirCharge.innerHTML = airCharge + " %"); + updateGuiValue(liveData.lambda1, (lambda) => liveDataLambda.innerHTML = lambda); + updateGuiValue(liveData.ego1, (ego) => liveDataEgo.innerHTML = ego + " A/D count"); + updateGuiValue(liveData.barometricPressure, (bp) => liveDataBarometricPressure.innerHTML = bp + " inHg"); + updateGuiValue(liveData.calibrationInputVoltage, (voltage) => liveDataCalibrationVoltage.innerHTML = voltage + " A/D count"); + updateGuiValue(liveData.transmissionOilTemperature, (temp) => liveDataTransmissionOil.innerHTML = temp + " A/D count"); + updateGuiValue(liveData.scap, (scap) => liveDataScap.innerHTML = scap + " A/D count"); + updateGuiValue(liveData.idleSpeedDutyCycle, (dutyCycle) => liveDataIdleSpeed.innerHTML = dutyCycle + " A/D count"); + updateGuiValue(liveData.adaptiveFuelCorrection, (correction) => liveDataAdaptiveFuelCorrection.innerHTML = correction + " A/F"); + updateGuiValue(liveData.desiredRpm, (rpm) => liveDataDesiredRpm.innerHTML = rpm); + updateGuiValue(liveData.ratch, (ratch) => liveDataRatch.innerHTML = ratch); + updateGuiValue(liveData.timeSinceStartup, (time) => liveDataTimeSinceStartup.innerHTML = time + " s"); + updateGuiValue(liveData.occ, (occ) => liveDataOcc.innerHTML = occ + " A/D Count"); + updateGuiValue(liveData.neutralDriveInput, (input) => liveDataNeutralDriveInput.innerHTML = input + " A/D Count"); + updateGuiValue(liveData.converterClutch, (clutch) => liveDataConverterClutch.innerHTML = clutch + " %"); + updateGuiValue(liveData.commandGear, (gear) => liveDataCommandGear.innerHTML = gear); + updateGuiValue(liveData.etvMonitorVoltage, (voltage) => liveDataEtvMonitorVoltage.innerHTML = voltage + " V"); + updateGuiValue(liveData.epcPressure, (pressure) => liveDataEpcPressure.innerHTML = pressure + " p.s.i"); + updateGuiValue(liveData.transmissionOilTemperature, (temperature) => liveDataTransmissionOilTemperature.innerHTML = temperature); + updateGuiValue(liveData.prndlPosition, (position) => liveDataPrndlPosition.innerHTML = position); + updateGuiValue(liveData.notUsed0A , (notUsed) => liveDataNotUsed0A.innerHTML = notUsed); + updateGuiValue(liveData.notUsed14 , (notUsed) => liveDataNotUsed14.innerHTML = notUsed); + updateGuiValue(liveData.notUsed16 , (notUsed) => liveDataNotUsed16.innerHTML = notUsed); + updateGuiValue(liveData.notUsed19 , (notUsed) => liveDataNotUsed19.innerHTML = notUsed); + updateGuiValue(liveData.notUsed1C , (notUsed) => liveDataNotUsed1C.innerHTML = notUsed); + updateGuiValue(liveData.notUsed1D , (notUsed) => liveDataNotUsed1D.innerHTML = notUsed); + updateGuiValue(liveData.notUsed26 , (notUsed) => liveDataNotUsed26.innerHTML = notUsed); + updateGuiValue(liveData.notUsed29 , (notUsed) => liveDataNotUsed29.innerHTML = notUsed); + updateGuiValue(liveData.notUsed2C , (notUsed) => liveDataNotUsed2C.innerHTML = notUsed); + updateGuiValue(liveData.notUsed31 , (notUsed) => liveDataNotUsed31.innerHTML = notUsed); + updateGuiValue(liveData.notUsed33 , (notUsed) => liveDataNotUsed33.innerHTML = notUsed); + updateGuiValue(liveData.notUsed34 , (notUsed) => liveDataNotUsed34.innerHTML = notUsed); + return;