# Disable autosleep

**URL:** <https://mangoh.discourse.group/t/disable-autosleep/236>\
**Category:** mangOH Green\
**Created:** [October 10, 2016, 5:10pm UTC](https://mangoh.discourse.group/t/disable-autosleep/236 "2016-10-10T17:10:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tobyjaffey](https://avatars.discourse-cdn.com/v4/letter/t/6f9a4e/32.png) [@tobyjaffey](https://mangoh.discourse.group/u/tobyjaffey)\
**Post date:** [October 10, 2016, 5:10pm UTC](https://mangoh.discourse.group/t/disable-autosleep/236/1 "2016-10-10T17:10:06Z")

</div>

Without the USB cable plugged into a PC, the MangOH goes to sleep.  
This can be disabled with:

`echo off > /sys/power/autosleep`

However, doing this in a script from my application’s `.adef` does not happen early enough in boot to prevent sleeping.

What is the recommended way to disable sleep?

`CONFIG_PM_AUTOSLEEP`?

Editing an init script?

---

<div class="post-metadata">

**Author:** ![davidc](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@davidc](https://mangoh.discourse.group/u/davidc)\
**Post date:** [October 11, 2016, 12:51am UTC](https://mangoh.discourse.group/t/disable-autosleep/236/2 "2016-10-11T00:51:36Z")

</div>

Hiya,

I got annoyed with this too, and initially was editing the init file.

But I ended up writing a script to do it for me.

I’ve posted instructions and the script [here](http://mangoh.discourse.group/t/script-to-disable-usb-autosleep/238) on the forum.

ciao, Dave

---

<div class="post-metadata">

**Author:** ![tobyjaffey](https://avatars.discourse-cdn.com/v4/letter/t/6f9a4e/32.png) [@tobyjaffey](https://mangoh.discourse.group/u/tobyjaffey)\
**Post date:** [October 11, 2016, 10:57am UTC](https://mangoh.discourse.group/t/disable-autosleep/236/3 "2016-10-11T10:57:09Z")

</div>

Thanks for this. I can also confirm that adding “CONFIG\_PM\_AUTOSLEEP=n” to the kernel config resolves the issue.
