[Ovmsdev] Power states clarification

Nikolay Shishkov nshishkov at yahoo.com
Sat Mar 2 00:38:31 HKT 2019

 Hi Mark, 
I am killing batteries and I think I will have some time to look into the power consumption and sleep modes. 
Where should I start?I saw that there is some mention of NetDeepSleep and other states, as well as esp_deep_sleep in the code.Are they functioning or are they there but not running yet (implemented in firmware)? Maybe I should have implemented something in the code for the Think City?
Thanks in advance,Nikolay
    On Wednesday, May 2, 2018, 2:50:50 AM GMT+2, Mark Webb-Johnson <mark at webb-johnson.net> wrote:  
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 undefinedOn Fully powered onSleep 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.)



OvmsDev mailing list
OvmsDev at lists.openvehicles.com

OvmsDev mailing list
OvmsDev at lists.openvehicles.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20190301/767515da/attachment.html>

More information about the OvmsDev mailing list