pm-suspend does not work properly

I’m using JetPack3.1 in my TX2
I want to change tx2 into sleep mode through the command line.
sudo pm-suspend does not work
but I use mouse to click the system menu suspend button, every thing is OK
Can someone help me?
thanks

here is the pm-suspend log

Initial commandline parameters: 
Mon May 21 08:16:00 UTC 2018: Running hooks for suspend.
Running hook /usr/lib/pm-utils/sleep.d/000kernel-change suspend suspend:
/usr/lib/pm-utils/sleep.d/000kernel-change suspend suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/000record-status suspend suspend:
/usr/lib/pm-utils/sleep.d/000record-status suspend suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/00logging suspend suspend:
Linux tegra-ubuntu 4.4.38-tegra #1 SMP PREEMPT Thu Jul 20 00:49:07 PDT 2017 aarch64 aarch64 aarch64 GNU/Linux
Module                  Size  Used by
fuse                   89008  2
bcmdhd               7625819  0
pci_tegra              74691  0
bluedroid_pm           13564  0
              total        used        free      shared  buff/cache   available
Mem:        8039124      358092     7259068       15304      421964     7590596
Swap:             0           0           0
/usr/lib/pm-utils/sleep.d/00logging suspend suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/00powersave suspend suspend:
/usr/lib/pm-utils/sleep.d/00powersave suspend suspend: success.

Running hook /etc/pm/sleep.d/10_unattended-upgrades-hibernate suspend suspend:
/etc/pm/sleep.d/10_unattended-upgrades-hibernate suspend suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/40inputattach suspend suspend:
/usr/lib/pm-utils/sleep.d/40inputattach suspend suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/50unload_alx suspend suspend:
/usr/lib/pm-utils/sleep.d/50unload_alx suspend suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/60_wpa_supplicant suspend suspend:
Selected interface 'p2p-dev-wlan0'
OK
/usr/lib/pm-utils/sleep.d/60_wpa_supplicant suspend suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/75modules suspend suspend:
/usr/lib/pm-utils/sleep.d/75modules suspend suspend: not applicable.

Running hook /usr/lib/pm-utils/sleep.d/90clock suspend suspend:
/usr/lib/pm-utils/sleep.d/90clock suspend suspend: not applicable.

Running hook /usr/lib/pm-utils/sleep.d/94cpufreq suspend suspend:
/usr/lib/pm-utils/sleep.d/94cpufreq suspend suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/95anacron suspend suspend:
/usr/lib/pm-utils/sleep.d/95anacron suspend suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/95hdparm-apm suspend suspend:
/usr/lib/pm-utils/sleep.d/95hdparm-apm suspend suspend: not applicable.

Running hook /usr/lib/pm-utils/sleep.d/95led suspend suspend:
/usr/lib/pm-utils/sleep.d/95led suspend suspend: not applicable.

Running hook /usr/lib/pm-utils/sleep.d/98video-quirk-db-handler suspend suspend:
/usr/lib/pm-utils/sleep.d/98video-quirk-db-handler suspend suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/99video suspend suspend:
/usr/lib/pm-utils/sleep.d/99video suspend suspend: success.

Mon May 21 08:16:00 UTC 2018: performing suspend
sh: echo: I/O error
Mon May 21 08:16:03 UTC 2018: Awake.
Mon May 21 08:16:03 UTC 2018: Running hooks for resume
Running hook /usr/lib/pm-utils/sleep.d/99video resume suspend:
/usr/lib/pm-utils/sleep.d/99video resume suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/98video-quirk-db-handler resume suspend:
/usr/lib/pm-utils/sleep.d/98video-quirk-db-handler resume suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/95led resume suspend:
/usr/lib/pm-utils/sleep.d/95led resume suspend: not applicable.

Running hook /usr/lib/pm-utils/sleep.d/95hdparm-apm resume suspend:
/usr/lib/pm-utils/sleep.d/95hdparm-apm resume suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/95anacron resume suspend:
/usr/lib/pm-utils/sleep.d/95anacron resume suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/94cpufreq resume suspend:
/usr/lib/pm-utils/sleep.d/94cpufreq resume suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/90clock resume suspend:
/usr/lib/pm-utils/sleep.d/90clock resume suspend: not applicable.

Running hook /usr/lib/pm-utils/sleep.d/75modules resume suspend:
Reloaded unloaded modules.
/usr/lib/pm-utils/sleep.d/75modules resume suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/60_wpa_supplicant resume suspend:
Selected interface 'p2p-dev-wlan0'
OK
/usr/lib/pm-utils/sleep.d/60_wpa_supplicant resume suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/50unload_alx resume suspend:
/usr/lib/pm-utils/sleep.d/50unload_alx resume suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/40inputattach resume suspend:
/usr/lib/pm-utils/sleep.d/40inputattach resume suspend: success.

Running hook /etc/pm/sleep.d/10_unattended-upgrades-hibernate resume suspend:
/etc/pm/sleep.d/10_unattended-upgrades-hibernate resume suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/00powersave resume suspend:
/usr/lib/pm-utils/sleep.d/00powersave resume suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/00logging resume suspend:
/usr/lib/pm-utils/sleep.d/00logging resume suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/000record-status resume suspend:
/usr/lib/pm-utils/sleep.d/000record-status resume suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/000kernel-change resume suspend:
/usr/lib/pm-utils/sleep.d/000kernel-change resume suspend: success.

Mon May 21 08:16:03 UTC 2018: Finished.

You may check this topic.

Thanks Honey.
“sudo systemctl suspend” it worked for me.

But,when I try “sudo bash -c ‘echo -n mem > /sys/power/state’” and freeze

bash: line 0: echo: write error: Device or resource busy

Can you tell me what could make this error, or how to check it?

No idea what is going wrong…It works fine for me on R28.2-DP.
From the error message, it looks the sysfs node is busy, maybe another software is using it.
Just a few thoughts as they come:
Does it happen after boot before running any application ?
Do you have a custom kernel or changed permissions on sysfs ?
Or some extra settings for bash ?
Have you run sudo with other/extra options (such as -i) ?
You may also try to sudo su, and then just access sysfs node without bash.

Hi Honey

Many times I try to run sudo pm-suspend, sometimes it works, sometimes not, even just boot the board. It’s weird.
But use systemctl, always good.
I use the original kernel from JetPack3.1.

Thanks for your help!

I have checked on a TX2 with R28.1:

head -n 1 /etc/nv_tegra_release
# R28 (release), REVISION: 1.0, GCID: 9436269, BOARD: t186ref, EABI: aarch64, DATE: Fri Jul 28 17:04:29 UTC 2017

, it works fine.

If another software is using it (do you have startup scripts?), you may try to see it with something like:

watch -n0.1 lsof /sys/power/state

but this would only catch if that software uses the pseudo file for more than 100 ms.

If it shows no process, then it may be a permission issue.
What gives

groups

Does it works if you log in as user ubuntu ?

Another possible cause may be with bash…Do you have custom settings for bash or are you using a different shell ?

Not sure I can help more, no idea how much your TX2 is customized from standard R28.1.
If you restart from scratch by flashing it should work with bash or pm-suspend.
Then customizing/adding your own software you may see where it gets wrong.