From Legato version 16.07, the mangOH board goes to sleep when the host suspends the USB connection. This is by design - but can be annoying if you're powering your board from the external power supply or simply don't want the board to go to sleep when your USB host does.
Here's how to disable this feature.
Edit by hand
The basic way to disable the autosleep feature is to manually edit the appropriate startup script - /etc/init.d/enable_autosleep.sh
using the vi
editor.
- Open a console or ssh connection to your mangOH board and log in.
edit
/etc/init.d/enable_autosleep.sh
using vivi /etc/init.d/enable_autosleep.sh
scroll down through the file (using the up and down arrow keys) until the following is in the middle of the screen:
# Enable the autosleep feature if [ -f /sys/power/autosleep ] then echo mem > /sys/power/autosleep true fi ;;
move the cursor to the start of the line
echo mem > /sys/power/autosleep
press the
i
key (change to Insert mode)edit the file so that 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 ;;
Press the
ESC
key to get out of Insert modePress
:w
to save the filePress
:q
to quit vi
Next time you reboot your mangOH board, the auto sleep on USB suspend functionality will be disabled.
Use an automated script
Manually editing this file becomes a bit tedious after a while, so there is a script available that automates the changes to /etc/init.d/enable_autosleep.sh
.
To install
download DisableUsbSleep.sh.gz
unpack the script (using
gunzip
on Linux or7zip
on Windows)copy the
DisableUsbSleep.sh
script to your mangOH board (scp
on Linux,WinSCP
on Windows)open a console or ssh connection to your mangOH board and log in.
run the script
./DisableUsbSleep.sh
This will modify
/etc/init.d/enable_autosleep.sh
to disable the auto-sleep feature.
Next time you reboot your mangOH board, the auto sleep on USB suspend functionality will be disabled.
To uninstall
Edit /etc/init.d/enable_autosleep.sh
and follow the instructions in the comment lines starting with
## modified by DisableUsbSleep.sh (c)Renfell Engineering P/L 2016