Wake on LAN (WoL)
The Wake-on-LAN (WoL) feature was implemented in Batocera v33 where it is enabled on any WoL capable system by default (if you want to disable WoL for your system for whatever reason, then just disable WoL in your system's BIOS). With WoL it is possible to turn on/off your Batocera machine by sending a “magic packet” (or something else, more info later) from a remote WoL client via a network cable. This could be used for automation purposes, for example to turn on your Batocera system at a specific time at night to backup all your userdata and games to a NAS and then shutdown again. And many other things!
Requirements
On the Batocera machine, the functionality of WoL is dependent on two components supporting it:
- BIOS: The system's BIOS must support WoL (you may have to enable WoL within your system's BIOS settings).
- NIC: The system's network adapter must support WoL to stay “awake” while the system is powered off.
If you are dual-booting with Windows on the same machine, you may need to also tell Windows to not disable the WoL shutdown procedure in its drivers.
Wake up your Batocera device remotely
Note: It is important to have your WoL client and your Batocera system within the same Layer 2 subnet of your network, otherwise WoL will not work as WoL packages cannot be routed over different subnets.
To find out the unique MAC address of your Batocera system's NIC, run ip link show
.
The MAC address for this NIC (eth0
) is f0:1f:af:25:dc:8b
.
You can now use the given MAC address to wake the Batocera machine up remotely from another device (e.g. PC, Smartphone, …) which is within the same Layer 2 subnet and has a WoL client (GUI based or command line based WoL client) installed.
Example of a WoL client for Windows (Depicus Wake on Lan for Windows GUI):
Most utilities require the following information (or similar enough to it):
- Mac Address ⇒ MAC address of your NIC on the Batocera machine.
- Internet Address ⇒ The IP of the NIC on the Batocera machine (if only one NIC is present on the WoL client, you can leave this empty).
- Subnet Mask ⇒ Netmask of the network's subnet.
- Send options ⇒ Choose
Local Subnet
. - Remote Port Number ⇒ The port to send the traffic on. Acceptable values are generally 9 (default) or 7.
Click on Wake Up to wake the Batocera machine up.
Troubleshooting
Machine will not wake up
- Try changing the port number from 9 to 7. If the machine uses an esoteric port this will usually be noted in its documentation.
- Try sending the packet via Internet instead of Local Subnet if you are using the GUI based WoL client mentioned above.
- Check if your system does even support WoL by running
ifconfig
which helps you to identify the network interface name of your according connection (e.g.eth0
), and then run the appropriateethtool eth0
command. It should give you an output similar to this:
Settings for eth0: Supported ports: [ TP ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Supported pause frame use: No Supports auto-negotiation: Yes Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Advertised pause frame use: No Advertised auto-negotiation: Yes Speed: 1000Mb/s Duplex: Full Port: Twisted Pair PHYAD: 1 Transceiver: internal Auto-negotiation: on MDI-X: on (auto) Supports Wake-on: pumbg Wake-on: g Current message level: 0x00000007 (7) drv probe link Link detected: yes
The important two parts for getting information about your NIC's WoL capability are:
Property | Notes |
---|---|
Supports Wake-on: | Shows which hardware WoL capabilities the NIC supports (these values cannot be changed by the user) |
Wake-on: | Shows which software WoL capabilities are currently enabled (these can be turned on/off by the user) |
The value g
means that your NIC supports receiving magic packets and therefore is WoL capable. Note that your NIC could also support multiple WoL functions and therefore you would get multiple output values as shown above, e.g. Supports Wake-on: pumbg
.
Here is a full list of output possibilities (more info at https://linux.die.net/man/8/ethtool or the man ethtool
command):
p
⇒ Wake on PHY activityu
⇒ Wake on unicast messagesm
⇒ Wake on multicast messagesb
⇒ Wake on broadcast messagesa
⇒ Wake on ARPg
⇒ Wake on MagicPacket™s
⇒ Enable SecureOn™ password for MagicPacket™d
⇒ Disable (wake on nothing). This option clears all previous options.
The most important value is g
. Without it being shown, the NIC does not support WoL at all.
It works great the first time! But not any time after...
If dual booting, the cause is most likely the second operating system turning WoL back off. On Windows, turn off the shutdown WoL feature.
Machine will not wake up anymore
If you were successfully using WoL but suddenly it does not work anymore, a power outage of your Batocera system could be the issue. Since WoL functionality relies on a “sleeping” NIC state issued when shutting down the system, the NIC will not be in “sleeping” state anymore after power outage. Therefore you can only make WoL work again by manually booting and then shutdown the system once.
- wake_on_lan.txt
- Last modified: 6 months ago
- by grandmabetty