# Power Management Awareness

**URL:** <https://mangoh.discourse.group/t/power-management-awareness/395>\
**Category:** mangOH Green\
**Created:** [February 24, 2017, 6:10pm UTC](https://mangoh.discourse.group/t/power-management-awareness/395 "2017-02-24T18:10:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sabau](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@Sabau](https://mangoh.discourse.group/u/Sabau)\
**Post date:** [February 24, 2017, 6:10pm UTC](https://mangoh.discourse.group/t/power-management-awareness/395/1 "2017-02-24T18:10:28Z")

</div>

Connecting to a mangOH Green board through Ethernet cable and having it powered only of the power supply will not be enough to have a sustainable connection. In many cases, it will appear that the Ethernet port will not get enough power to stay on, but don’t worry, your board is not defective! The board was actually programmed to automatically go into power saving mode if the host decides to suspend the USB connection (in our case, we did not have an upstream machine connected to our USB hub). The simple solution to this obstacle would be to disable the auto sleep feature. There are two ways to do this:

##1) Disabling auto sleep feature manually:  
a. Open a console or ssh connection to the desired mangOH board and log in  
b. Edit _enable\_autosleep.sh_ file using _vi_ text editor tool  
**vi /etc/init.d/enable\_autosleep.sh**  
c. Scroll down the file (using the down arrow key) until you reach the following function  
**# Enable the autosleep feature**  
**if [-f /sys/power/autosleep]**  
**then**  
**echo mem \> /sys/power/autosleep**  
**true**  
**fi**  
**;;**

d. Once you have reached this function, you can now press the _i_ key (this will place you into insert mode)  
e. Edit the text so it looks like the following  
**# Enable the autosleep feature**  
**if [-f /sys/power/autosleep]**  
**then**  
**# stop autosleep**  
**#echo mem \> /sys/power/autosleep**  
**echo "Disable Autosleep"**  
**echo off \> /sys/power/autosleep**  
**true**  
**fi**  
**;;**

f. Press ESC key and then type _:wq!_ (this will save and then quit the file)  
The next time you reboot the manhOH board, the auto sleep on USB suspend function will be disabled.

##2) Disabling auto sleep feature using an automated script:  
a. Download [DisableUsbSleep.sh.gz](https://www.littlesliceofmangoh.com/tips/downloads/DisableUsbSleep.sh.gz)  
b. Unpack the script (using _gunzip_ on Linux or _7zip_ on Windows)  
c. Copy the [DisavleUsbSleep.sh](http://DisavleUsbSleep.sh) script to your mangOH board (_scp_ on Linux, _WinSCP_ on Windows)  
d. Open a console or ssh connection to the desired mangOH board and log in  
e. Run the script  
**./DisableUsbSleep.sh**  
This will modify /etc/init.d/enable\_autosleep.sh to disable the auto-sleep feature. Next time the mangOH board will be rebooted, the auto sleep on USB suspend functionality will be disabled.

#Wavefront #hardware #offline # network #wp8548 #CF3

---

<div class="post-metadata">

**Author:** ![daav](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/daav/32/79_2.png) [@daav](https://mangoh.discourse.group/u/daav)\
**Post date:** [February 27, 2017, 8:06am UTC](https://mangoh.discourse.group/t/power-management-awareness/395/2 "2017-02-27T08:06:34Z")

</div>

Please note that from Legato 16.10, the new **devMode** app is handling that for you.  
Have a look at [http://legato.io/legato-docs/latest/howToDevMode.html](http://legato.io/legato-docs/latest/howToDevMode.html)

---

<div class="post-metadata">

**Author:** ![jchitty](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jchitty/32/846_2.png) [@jchitty](https://mangoh.discourse.group/u/jchitty)\
**Post date:** [March 1, 2017, 11:30pm UTC](https://mangoh.discourse.group/t/power-management-awareness/395/3 "2017-03-01T23:30:39Z")

</div>

Yes, the devMode app uses the Power Management API ([http://legato.io/legato-docs/latest/c\_pm.html](http://legato.io/legato-docs/latest/c_pm.html)) to keep the system awake. Your own custom app can do that too.

Cheers,

–Jen

---

<div class="post-metadata">

**Author:** ![dingo](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@dingo](https://mangoh.discourse.group/u/dingo)\
**Post date:** [March 13, 2018, 12:41pm UTC](https://mangoh.discourse.group/t/power-management-awareness/395/4 "2018-03-13T12:41:38Z")

</div>

right… lets try that again…

404  
File not found

The site configured at this address does not contain the requested file.

---

<div class="post-metadata">

**Author:** ![dfrey](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/dfrey/32/303_2.png) [@dfrey](https://mangoh.discourse.group/u/dfrey)\
**Post date:** [March 13, 2018, 3:11pm UTC](https://mangoh.discourse.group/t/power-management-awareness/395/5 "2018-03-13T15:11:58Z")

</div>

I’m not sure what content was at that previous URL, but this is the information I found (using the search box on [legato.io](http://legato.io)) [http://legato.io/legato-docs/latest/basicTargetDevMode.html](http://legato.io/legato-docs/latest/basicTargetDevMode.html)

---

<div class="post-metadata">

**Author:** ![dingo](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@dingo](https://mangoh.discourse.group/u/dingo)\
**Post date:** [March 13, 2018, 5:10pm UTC](https://mangoh.discourse.group/t/power-management-awareness/395/6 "2018-03-13T17:10:18Z")

</div>

Is there a way to “disable” this from being built included in Legato-Dist ? as with the custom image build it appears to be included and running by default after a new flash, while im at it the mentioned below are apps also included that we dont need

[stopped] wifi  
[stopped] wifiApTest  
[stopped] wifiClientTest  
[running] wifiService  
[stopped] wifiWebAp

---

<div class="post-metadata">

**Author:** ![dfrey](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/dfrey/32/303_2.png) [@dfrey](https://mangoh.discourse.group/u/dfrey)\
**Post date:** [March 15, 2018, 3:44pm UTC](https://mangoh.discourse.group/t/power-management-awareness/395/7 "2018-03-15T15:44:01Z")

</div>

The system definition file (.sdef) defines which apps are in the Legato system that is built. Legato’s Makefile has a variable named `SDEF_TO_USE` which controls which SDEF it uses. Within the primary `Makefile` you can see that it is set like this `SDEF_TO_USE ?= default.sdef`. This actually has no effect in the case of the WP modules because of another line earlier in the `Makefile`. That line is `include $(wildcard modules/*/moduleDefs`. That line causes `modules/WiFi/moduleDefs to be included which sets`SDEF\_TO\_USE`if it's not already set to`modules/WiFi/wifi.sdef`.

I’m not sure exactly what it is that you _do_ want in your SDEF. You can define your own and then pass `SDEF_TO_USE=path/to/your/system.sdef` if you are building with the Legato `Makefile`. Or if you’re just using `mksys`, then you just pass your sdef as the one to build.

---

<div class="post-metadata">

**Author:** ![dingo](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@dingo](https://mangoh.discourse.group/u/dingo)\
**Post date:** [March 17, 2018, 8:02am UTC](https://mangoh.discourse.group/t/power-management-awareness/395/8 "2018-03-17T08:02:39Z")

</div>

A bit confusing, there are no sdef files in Legato-Dist there are sdef files in legato

but these apps appear to be included in the custom built image in the Legato-Dist AKA Yocto tree
