[Ovmsdev] Åter-: Re: Mitsubishi logging problem

Mark Webb-Johnson mark at webb-johnson.net
Wed Jun 11 13:31:21 HKT 2014


Spec for this is:
unsigned char car_doors1 [bit 7]

A bit used to signal whether the car is turned on or off. Set to 1 if the car ignition switch is ON, otherwise 0. 

The correct approach is to set CarOn=1 only when the ignition switch is on. There are quite a few things that use that (not just logging, but also ACC and the code to speed-up reporting if the car is driving/charging).

Regards, Mark.

On 9 Jun, 2014, at 12:15 am, Nikolay Shishkov <nshishkov at yahoo.com> wrote:

> 
> I can change the code so the CarOn=1 only when that particular message (the 412) is received.  But I still need to set it to 0 when the car is not on and charging. 
> The current code is setting the CarOn=0 when CANBUS communication is missing for 60 seconds, so If I park the car, and plug it without switching off the CarOn is going to stay 1. 
> Maybe a timer on the 412 message? So if not received within 10 seconds I can set CarOn to 0?
> 
> Nikolay
> 
> 
> 
> ------------------------------
> Den sön 8 jun 2014 10:44 EEST skrev Thomas Bergo:
> 
> >From what i remember this should be a easy fix.
> >
> >The car_speed and car_odometer @ PID 412 is only updated when ignition is
> >ON.
> >So setting the car_doors1bits.CarOn = 1 when PID 412 is received should fix
> >this issue. Setting car_doors1bits.CarOn = 0 when no CANBUS activity is
> >already implemented in the code.
> >
> >Regards, Thomas
> >
> >
> >2014-06-08 7:51 GMT+02:00 Tom Saxton <tom at idleloop.com>:
> >
> >> It sounds like the Mitsubishi code is setting the car_doors1bits.CarON
> >> incorrectly. That bit should only be set if the car is turned on. Perhaps
> >> it needs to be more discerning as to which CAN messages indicate the car is
> >> on.
> >>
> >>    Tom
> >>
> >> On 6/7/14, 2:32 PM, "Nikolay Shishkov" <nshishkov at yahoo.com> wrote:
> >>
> >> I have been testing the logging for the mitsubishi and noticed a problem
> >> with it - no matter if I was charging or driving the log was always showing
> >> driving.
> >> I have been looking at the code and I think I found the problem. If I
> >> understand this correctly in vehicle_mitsubishi_ticker1 function
> >> in vehicle_mitsubishi.c file the car_doors1bits.CarON is set depending on
> >> wheather there is CAN bus communication. This is unfortunate since
> >> the car_doors1bits.CarON (via CAR_IS_ON) is used in the logging.c to
> >> determine if the car is "driving"... and if it is, then it is not
> >> "charging".
> >>
> >> I am not sure what the best solution would be:
> >>  - to set the car_doors1bits.CarON to 0 if the car is charging or
> >>  - to refactore the logging code to prefer the CAR_IS_CHARGING and test
> >> for it first in the various if/else statements.
> >>
> >> I have not been able to build and test any of this yet.
> >>
> >> Any comments, ideas, suggestions on how to solve this?
> >>
> >> Nikolay
> >>
> >>
> >> _______________________________________________ OvmsDev mailing list
> >> OvmsDev at lists.teslaclub.hk
> >> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
> >>
> >> _______________________________________________
> >> OvmsDev mailing list
> >> OvmsDev at lists.teslaclub.hk
> >> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
> >>
> >>
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.teslaclub.hk
> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20140611/90e0006b/attachment.htm>


More information about the OvmsDev mailing list