Add UCC with volume for further debugging, because not EXTFRAME request gets processed

This commit is contained in:
Carsten Schmiemann 2022-04-12 20:37:40 +02:00
parent 2ea9645a3a
commit 087b39197b
2 changed files with 25 additions and 1 deletions

View file

@ -55,6 +55,7 @@ static const char *TAG = "v-zoe-ph2";
// Pollstate 2 - POLLSTATE_RUNNING - car is driving
// Pollstate 3 - POLLSTATE_CHARGING - car is charging
static const OvmsVehicle::poll_pid_t renault_zoe_polls[] = {
//***TX-ID, ***RX-ID, ***SID, ***PID, { Polltime (seconds) for Pollstate 0, 1, 2, 3}, ***CAN BUS Interface, ***FRAMETYPE
//LBC
{ 0x18dadbf1, 0x18daf1db, VEHICLE_POLL_TYPE_OBDIISESSION, SESSION_EXTDIAG, { 60, 60, 60, 60 }, 0, ISOTP_EXTFRAME }, // OBD Extended Diagnostic Session
{ 0x18dadbf1, 0x18daf1db, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x9001, { 0, 10, 10, 10 }, 0, ISOTP_EXTFRAME }, // SOC
@ -64,7 +65,7 @@ static const OvmsVehicle::poll_pid_t renault_zoe_polls[] = {
{ 0x18dadbf1, 0x18daf1db, VEHICLE_POLL_TYPE_OBDIIGROUP, 0x9062, { 0, 60, 600, 60 }, 0, ISOTP_EXTFRAME }, // Cell Bat Module 63-96
{ 0x18dadbf1, 0x18daf1db, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x20B6, { 0, 10, 10, 10 }, 0, ISOTP_EXTFRAME }, // Battery Voltage
{ 0x18dadbf1, 0x18daf1db, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x900D, { 0, 10, 10, 10 }, 0, ISOTP_EXTFRAME }, // Battery Current
{ 0x18dadbf1, 0x18daf1db, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x291C8, { 0, 10, 10, 10 }, 0, ISOTP_EXTFRAME }, // Battery Available Energy kWh
{ 0x18dadbf1, 0x18daf1db, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x91C8, { 0, 10, 10, 10 }, 0, ISOTP_EXTFRAME }, // Battery Available Energy kWh
{ 0x18dadbf1, 0x18daf1db, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x9243, { 0, 10, 10, 10 }, 0, ISOTP_EXTFRAME }, // Energy charged kWh
{ 0x18dadbf1, 0x18daf1db, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x9244, { 0, 10, 10, 10 }, 0, ISOTP_EXTFRAME }, // Energy discharged kWh
{ 0x18dadbf1, 0x18daf1db, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x9246, { 0, 10, 10, 10 }, 0, ISOTP_EXTFRAME }, // Energy regenerated kWh
@ -84,6 +85,10 @@ static const OvmsVehicle::poll_pid_t renault_zoe_polls[] = {
{ 0x18dadff1, 0x18daf1df, VEHICLE_POLL_TYPE_OBDIISESSION, SESSION_EXTDIAG, { 60, 60, 60, 60 }, 0, ISOTP_EXTFRAME }, // OBD Extended Diagnostic Session
{ 0x18dadff1, 0x18daf1df, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x700F, { 0, 10, 10, 10 }, 0, ISOTP_EXTFRAME }, // Stator Temperature 1
{ 0x18dadff1, 0x18daf1df, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x7010, { 0, 10, 10, 10 }, 0, ISOTP_EXTFRAME }, // Stator Temperature 2
//Navigation-UCC-ITM
{ 0x747, 0x767, VEHICLE_POLL_TYPE_OBDIISESSION, SESSION_EXTDIAG, { 60, 60, 60, 60 }, 0, ISOTP_STD }, // OBD Extended Diagnostic Session
{ 0x747, 0x767, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x2109, { 0, 10, 10, 10 }, 0, ISOTP_STD }, // Volume Setting (for debug only)
POLL_LIST_END
};
@ -124,6 +129,7 @@ OvmsVehicleRenaultZoePh2::OvmsVehicleRenaultZoePh2() {
mt_bus_awake = MyMetrics.InitBool("zph2.v.bus.awake", SM_STALE_MIN, true);
mt_available_energy = MyMetrics.InitFloat("zph2.v.avail.energy", SM_STALE_MID, 0, kWh);
mt_main_power_consumed = MyMetrics.InitFloat("zph2.c.main.power.consumed", SM_STALE_MID, 0, kWh);
mt_navi_volume = MyMetrics.InitFloat("zph2.c.radio.volume", SM_STALE_MID, 0, Percentage);
// init commands:
cmd_zoe = MyCommandApp.RegisterCommand("zoe-ph2", "Renault Zoe Ph2");
@ -218,6 +224,10 @@ void OvmsVehicleRenaultZoePh2::IncomingPollReply(canbus* bus, uint16_t type, uin
// ****** PEB *****
case 0x77e:
IncomingPEB(type, pid, rxbuf.data(), rxbuf.size());
break;
// ****** Navigation-UCC-ITM *****
case 0x747:
IncomingUCC(type, pid, rxbuf.data(), rxbuf.size());
break;
}
}
@ -428,6 +438,18 @@ void OvmsVehicleRenaultZoePh2::IncomingPEB(uint16_t type, uint16_t pid, const ch
}
}
/**
* Handle incoming polls from the navigation cluster
*/
void OvmsVehicleRenaultZoePh2::IncomingUCC(uint16_t type, uint16_t pid, const char* data, uint16_t len) {
switch (pid) {
case 0x2109: { // Motor temperature
mt_navi_volume->SetValue((float(CAN_UINT(0))));
break;
}
}
}
/**
* Takes care of setting all the state appropriate when the car is on

View file

@ -83,6 +83,7 @@ class OvmsVehicleRenaultZoePh2 : public OvmsVehicle {
void IncomingLBC(uint16_t type, uint16_t pid, const char* data, uint16_t len);
void IncomingUCH(uint16_t type, uint16_t pid, const char* data, uint16_t len);
void IncomingPEB(uint16_t type, uint16_t pid, const char* data, uint16_t len);
void IncomingUCC(uint16_t type, uint16_t pid, const char* data, uint16_t len);
void car_on(bool isOn);
virtual void Ticker1(uint32_t ticker);
virtual void Ticker10(uint32_t ticker);
@ -98,6 +99,7 @@ class OvmsVehicleRenaultZoePh2 : public OvmsVehicle {
OvmsMetricBool *mt_bus_awake; // can-bus awake status
OvmsMetricFloat *mt_available_energy; // Available Energy
OvmsMetricFloat *mt_main_power_consumed; // Mains active power consumed
OvmsMetricFloat *mt_navi_volume; //Radio volume for debug only
public:
void WebInit();