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.shusing vivi /etc/init.d/enable_autosleep.shscroll 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/autosleeppress the
ikey (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
ESCkey to get out of Insert modePress
:wto save the filePress
:qto 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
gunzipon Linux or7zipon Windows)copy the
DisableUsbSleep.shscript to your mangOH board (scpon Linux,WinSCPon Windows)open a console or ssh connection to your mangOH board and log in.
run the script
./DisableUsbSleep.shThis will modify
/etc/init.d/enable_autosleep.shto 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