Kodi Community Forum
XBMCBuntu Wake-On-Lan not working from S3 Suspend - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228)
+---- Thread: XBMCBuntu Wake-On-Lan not working from S3 Suspend (/showthread.php?tid=192778)



XBMCBuntu Wake-On-Lan not working from S3 Suspend - praet0ri4n - 2014-04-21

Hi all,

long story short.
I switched from a regular Ubuntu 12.04 to XBMCbuntu because....

Everything seems to work fine or even better.
But I am struggling to get the Wake-on-Lan working together with Suspend to RAM (S3).
WOL is working fine after shutdown (S5) and system gets back on after receiving magic packet. On Ubuntu 12.04 it is working with suspend flawlessly.
All I have to do in Ubuntu 12.04 is:
Code:
echo SLAN > /proc/acpi/wakeup
echo enabled > /sys/bus/pci/devices/my_network_card/power/wakeup
echo enabled > /sys/class/net/eth0/device/power/wakeup
and eventually set up a script for
Code:
ethtool -s eth0 wol g
because it is "d" by default on every boot

For some reason XMBCBuntu is already pre-equiped with ethtool and ethtool eth0 reports "g" without any further script of my own.
As mentioned, if I do sudo poweroff, magic packet works. But it won't work after pm-suspend (LAN leds still blinking).
I know how to set up WOL on Ubuntu but I don't know what is the difference in XBMCBuntu distro and why it won't work there.
Is it managing suspending actions differently? Is it maybe some script overriding the ethtool wol setting? Do I have to unload network before suspend somehow?
I have already tried all the suggested ways like adding STOP, WHITELIST, etc.. entries in
Code:
/etc/default/acpi-support
or
Code:
service network stop
or
Code:
ifconfig eth0 down
or commenting out lines in
Code:
/usr/lib/pm-utils/...
Are there any other scripts in xbmcbuntu compared to ubuntu that take care of suspending? I know for sure that BIOS is fine. Network driver is via_rhine and current XMBCBuntu kernel is 3.5.0.48.

Here are the outputs:
Code:
iqon@iqon-MS-7387:~$ cat /proc/acpi/wakeup
Device    S-state      Status   Sysfs node
NPGS      S4    *disabled  pci:0000:02:00.0
NP0S      S4    *disabled  
USB1      S3    *enabled   pci:0000:00:10.0
USB2      S3    *enabled   pci:0000:00:10.1
USB3      S3    *enabled   pci:0000:00:10.2
USB4      S3    *enabled   pci:0000:00:10.3
EHCI      S3    *enabled   pci:0000:00:10.4
SLT1      S4    *disabled  
SLT2      S4    *disabled  
SLAN      S4    *enabled   pci:0000:00:12.0
SLPB      S4    *enabled  
PWRB      S3    *enabled

Code:
iqon@iqon-MS-7387:~$ for i in /sys/bus/pci/devices/*/power/wakeup; do echo $i && cat $i; done
/sys/bus/pci/devices/0000:00:02.0/power/wakeup
enabled
/sys/bus/pci/devices/0000:00:03.0/power/wakeup
enabled
/sys/bus/pci/devices/0000:00:10.0/power/wakeup
enabled
/sys/bus/pci/devices/0000:00:10.1/power/wakeup
enabled
/sys/bus/pci/devices/0000:00:10.2/power/wakeup
enabled
/sys/bus/pci/devices/0000:00:10.3/power/wakeup
enabled
/sys/bus/pci/devices/0000:00:10.4/power/wakeup
enabled
/sys/bus/pci/devices/0000:00:12.0/power/wakeup
enabled
/sys/bus/pci/devices/0000:02:00.0/power/wakeup
disabled

Code:
iqon@iqon-MS-7387:~$ cat /sys/class/net/eth0/device/power/wakeup
enabled
Code:
iqon@iqon-MS-7387:~$ uname -a
Linux iqon-MS-7387 3.5.0-48-generic #72-Ubuntu SMP Mon Mar 10 23:20:26 UTC 2014 i686 i686 i686 GNU/Linux
Code:
iqon@iqon-MS-7387:~$ sudo lshw -C network
  *-network              
       description: Ethernet interface
       product: VT6102 [Rhine-II]
       vendor: VIA Technologies, Inc.
       physical id: 12
       bus info: pci@0000:00:12.0
       logical name: eth0
       version: 7c
       serial: 00:1d:92:7e:df:7f
       size: 100Mbit/s
       capacity: 100Mbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=via-rhine driverversion=1.5.1 duplex=full ip=192.168.1.143 latency=64 maxlatency=8 mingnt=3 multicast=yes port=MII speed=100Mbit/s
       resources: irq:23 ioport:c000(size=256) memory:fcfff800-fcfff8ff
Code:
iqon@iqon-MS-7387:~$ sudo ethtool eth0
Settings for eth0:
    Supported ports: [ TP MII ]
    Supported link modes:   10baseT/Half 10baseT/Full
                            100baseT/Half 100baseT/Full
    Supported pause frame use: No
    Supports auto-negotiation: Yes
    Advertised link modes:  10baseT/Half 10baseT/Full
                            100baseT/Half 100baseT/Full
    Advertised pause frame use: No
    Advertised auto-negotiation: Yes
    Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                         100baseT/Half 100baseT/Full
    Link partner advertised pause frame use: Symmetric
    Link partner advertised auto-negotiation: Yes
    Speed: 100Mb/s
    Duplex: Full
    Port: MII
    PHYAD: 1
    Transceiver: internal
    Auto-negotiation: on
    Supports Wake-on: pumbg
    Wake-on: g
    Current message level: 0x00000000 (0)
                  
    Link detected: yes
It's not that dramatic, but I used to WOL from suspend pretty often.
Thanks alot!


RE: XBMCBuntu Wake-On-Lan not working from S3 Suspend - praet0ri4n - 2014-04-22

...just found another thread that could have to do with it.
http://forum.xbmc.org/showthread.php?tid=159514

This led me to do a little research.
I booted into my previous Ubuntu 12.04, istalled xbmc and tried the WOL functionality from Suspend:

When calling
Code:
pm-suspend
from command line (over ssh), I can bring it up with wakeonlan magic packet.

But when I suspend from XBMC with its build in XBMC.Suspend() command, it somehow disables and brings down the networking (i guess).
Can this be worked around?
This seems like a dead end Sad


RE: XBMCBuntu Wake-On-Lan not working from S3 Suspend - praet0ri4n - 2014-04-23

Maybe the questions should only be:

What method does XBMC.Suspend() use to suspend the system? I think it is not "pm-suspend"..
Can that function be overriden? Can I assign another command to this function? I think this would involve rewriting the source and compiling, which I am not a friend of Sad
What about using the XBMC.System.Exec together with the pm-suspend? I have come up with something like XBMC.System.Exec("sudo pm-suspend"), added my user to sudoers to not to prompt for password, but it is not suspending..
Can the bringing down of network be set up by some XBMC settings (GUI or console), or is it hardcoded?

I just need to do ONLY pm-suspend, as with this command the WOL is working.
Any respond is much appreciated!