[Ovmsdev] Power states clarification

Mark Webb-Johnson mark at webb-johnson.net
Wed May 2 08:50:30 HKT 2018


Greg,

Every peripheral class in the OVMS v3 system (both physical and virtual) should be derived from pcp (Power Controlled Peripheral). That base class implements the concept of a power state, as well as standardised commands to change state (and for sub-classed peripherals to implement those states).

class obd2ecu : public pcp
  {
  public:
    obd2ecu(const char* name, canbus* can);
    ~obd2ecu();

  public:
    virtual void SetPowerMode(PowerMode powermode);

At the moment, we don’t use this much. Some peripherals implement it, some don’t, and some only partially. Have a look at ::SetPowerMode() in the peripheral code itself.

In general:

Undefined	Power mode is undefined
On			Fully powered on
Sleep		Reduced power mode (but all functions expected to be fully operational)
DeepSleep	Minimal power deep sleep mode (may turn off some functions to save power)
Off			Fully powered off

This will become important later when we implement the sleep and deep sleep modes in OVMS firmware (primarily to save those little 12V batteries).

Regards, Mark.

> On 2 May 2018, at 8:10 AM, Greg D. <gregd2350 at gmail.com> wrote:
> 
> Hi folks (mostly Mark, probably),
> 
> I just noticed that there is a power command for OBD2ECU as well as
> ext12v.  I understand (or thought I did) what controlling the ext12v
> power does, but how is "power" related to OBD2ECU?  Is this related to
> firing up the opened CAN bus, or is there some tie to the ext12v power?
> 
> I have manually created scripts for vehicle.on and vehicle.off to
> explicitly control ext12v, so that an attached HUD will follow the key. 
> We talked about having this sort of thing done automatically, but I
> didn't think it was ever implemented, nor what the particulars would be
> regarding some of the device corner cases.  Is that what is happening here?
> 
> Related, what do the other states do?  (Sleep, deepsleep, etc.)
> 
> Thanks,
> 
> Greg
> 
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.openvehicles.com
> http://lists.openvehicles.com/mailman/listinfo/ovmsdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20180502/7135234f/attachment.htm>


More information about the OvmsDev mailing list