Fix tpms, fix double phrases

This commit is contained in:
Carsten Schmiemann 2022-04-17 01:16:40 +02:00
parent 6c5bbda6a0
commit 2b4d5f5294
2 changed files with 4 additions and 5 deletions

View File

@ -28,7 +28,7 @@
void OvmsVehicleRenaultZoePh2::IncomingBCM(uint16_t type, uint16_t pid, const char* data, uint16_t len) {
switch (pid) {
case 0x4204: {
StandardMetrics.ms_v_tpms_pressure->SetElemValue(MS_V_TPMS_IDX_FL, (float)CAN_UINT(0)));
StandardMetrics.ms_v_tpms_pressure->SetElemValue(MS_V_TPMS_IDX_FL, (float)CAN_UINT(0));
ESP_LOGD(TAG, "4204 BCM tpms pressure FL: %f", float(CAN_UINT(0)));
break;
}

View File

@ -106,7 +106,6 @@ void OvmsVehicleRenaultZoePh2::IncomingFrameCan1(CAN_frame_t* p_frame) {
if (mt_bus_awake->AsBool() && data[0] == 0x83 && data[1] == 0xc0) {
ESP_LOGI(TAG,"Zoe has gone to sleep (CAN Gateway NAK response)");
mt_bus_awake->SetValue(false);
StandardMetrics.ms_v_env_awake->SetValue(false);
StandardMetrics.ms_v_env_on->SetValue(false);
StandardMetrics.ms_v_env_awake->SetValue(false);
StandardMetrics.ms_v_env_charging12v->SetValue(false);
@ -116,8 +115,7 @@ void OvmsVehicleRenaultZoePh2::IncomingFrameCan1(CAN_frame_t* p_frame) {
//There are some free frames on wakeup and start and stop charging.... I try to use them to see if Car is awake and charging, see /Reference/ZOE_Ph2_xxx text files
if (!mt_bus_awake->AsBool() && (data[0] == 0x05 || data[0] == 0x06 || data[0] == 0x07)) { //listen for SingleFrames (0x0) with length of 5-7
ESP_LOGI(TAG,"Zoe woke up (CAN Bus activity detected)");
mt_bus_awake->SetValue(true);
StandardMetrics.ms_v_env_awake->SetValue(true);
mt_bus_awake->SetValue(true);;
StandardMetrics.ms_v_env_on->SetValue(true);
StandardMetrics.ms_v_env_awake->SetValue(true);
StandardMetrics.ms_v_env_charging12v->SetValue(true);
@ -126,11 +124,12 @@ void OvmsVehicleRenaultZoePh2::IncomingFrameCan1(CAN_frame_t* p_frame) {
if (mt_bus_awake->AsBool() && !CarIsDriving && StandardMetrics.ms_v_pos_gpsspeed->AsFloat() > 5) { //If GPS speed bigger than 5km/h then assume Vehicle driving, later I used OBD speed for that
ESP_LOGI(TAG,"Zoe is driving");
StandardMetrics.ms_v_env_on->SetValue(false);
StandardMetrics.ms_v_env_on->SetValue(true);
POLLSTATE_RUNNING;
CarIsDriving = true;
} else if (mt_bus_awake->AsBool() && CarIsDriving && StandardMetrics.ms_v_pos_gpsspeed->AsFloat() < 5) {
ESP_LOGI(TAG,"Zoe stopped driving");
StandardMetrics.ms_v_env_on->SetValue(false);
POLLSTATE_ON;
}
}