[Ovmsdev] OBDII vehicle chicken-n-egg issue

Craig Leres leres at xse.com
Sun Oct 2 10:17:06 HKT 2022


I cloned the OBDII module when I started work on the C6 Corvette and 2nd 
gen CTS modules. Trying to debug my C6 Corvette canbus issues I'm not 
understanding how OBD polling works.

What I see when I look at vehicle_obdii.cpp is that there is a list of 
pids that are polled. However, OvmsVehicleOBDII::IncomingPollReply() is 
the only place that *enables* polling:

     case 0x0c:  // Engine RPM
       if (value2 == 0)
         { // Car engine is OFF
         PollSetState(0);
         StandardMetrics.ms_v_env_handbrake->SetValue(true);
         StandardMetrics.ms_v_env_on->SetValue(false);
         StandardMetrics.ms_v_pos_speed->SetValue(0);
         StandardMetrics.ms_v_env_charging12v->SetValue(false);
         }
       else
         { // Car engine is ON
         PollSetState(1);
         StandardMetrics.ms_v_env_handbrake->SetValue(false);
         StandardMetrics.ms_v_env_on->SetValue(true);
         StandardMetrics.ms_v_env_charging12v->SetValue(true);
         }
       break;

I can only assume "engine RPM" canbus frames are always sent by the 
vehicle (not unreasonable); but then I don't understand why we are 
polling for it? I guess I would expect ms_v_env_on state changes to 
happen in SOvmsVehicleOBDII::IncomingFrameCan1(). But maybe 
OvmsVehicleOBDII::IncomingPollReply() gets engine RPM frames since they 
are on the list of things we're polling for? So if we didn't handle them 
in IncomingPollReply() we'd have to add a IncomingFrameCan1() routine?

Playing around with savvycan I find it's possible to have the C6 
Corvette, with engine running, to not be "on" but still send canbus 
frames to savvycan (at least until *it* gives up and disconnects). This 
makes me think I'm getting into a situation where ovms does not detect 
that the car is on but not because the canbus is not working due to 
logic errors on my part. Certainly "can can1 status" reports a similar 
number of tx fails when compared to my working vehicle (2nd gen Cadillac).

		Craig


More information about the OvmsDev mailing list