<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Greg,<div class=""><br class=""></div><div class="">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).</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">class obd2ecu : public pcp</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class=""> {</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class=""> public:</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class=""> obd2ecu(const char* name, canbus* can);</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class=""> ~obd2ecu();</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class=""><br class=""></span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class=""> public:</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class=""> virtual void SetPowerMode(PowerMode powermode);</span></font></div></div></blockquote><div class=""><br class=""></div><div class="">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.</div><div class=""><br class=""></div><div class="">In general:</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class="">Undefined<span class="Apple-tab-span" style="white-space:pre"> </span>Power mode is undefined</div><div class="">On<span class="Apple-tab-span" style="white-space:pre"> </span>Fully powered on</div><div class="">Sleep<span class="Apple-tab-span" style="white-space:pre"> </span>Reduced power mode (but all functions expected to be fully operational)</div><div class="">DeepSleep<span class="Apple-tab-span" style="white-space:pre"> </span>Minimal power deep sleep mode (may turn off some functions to save power)</div><div class="">Off<span class="Apple-tab-span" style="white-space:pre"> </span>Fully powered off</div></blockquote><div class=""><div><br class=""></div><div>This will become important later when we implement the sleep and deep sleep modes in OVMS firmware (primarily to save those little 12V batteries).</div><div><br class=""></div><div>Regards, Mark.</div><div><br class=""><blockquote type="cite" class=""><div class="">On 2 May 2018, at 8:10 AM, Greg D. <<a href="mailto:gregd2350@gmail.com" class="">gregd2350@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hi folks (mostly Mark, probably),<br class=""><br class="">I just noticed that there is a power command for OBD2ECU as well as<br class="">ext12v. I understand (or thought I did) what controlling the ext12v<br class="">power does, but how is "power" related to OBD2ECU? Is this related to<br class="">firing up the opened CAN bus, or is there some tie to the ext12v power?<br class=""><br class="">I have manually created scripts for vehicle.on and vehicle.off to<br class="">explicitly control ext12v, so that an attached HUD will follow the key. <br class="">We talked about having this sort of thing done automatically, but I<br class="">didn't think it was ever implemented, nor what the particulars would be<br class="">regarding some of the device corner cases. Is that what is happening here?<br class=""><br class="">Related, what do the other states do? (Sleep, deepsleep, etc.)<br class=""><br class="">Thanks,<br class=""><br class="">Greg<br class=""><br class="">_______________________________________________<br class="">OvmsDev mailing list<br class=""><a href="mailto:OvmsDev@lists.openvehicles.com" class="">OvmsDev@lists.openvehicles.com</a><br class="">http://lists.openvehicles.com/mailman/listinfo/ovmsdev<br class=""></div></div></blockquote></div><br class=""></div></body></html>