Table of Contents

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:

WoL is designed for use with wired Ethernet connections, but there are wireless NICs which may support Wake-on-Wireless (WoW). This article assumes you are using a standard wired connection.

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.

Setting up the BIOS

This section can not be specific to your motherboard's BIOS configuration, so the instructions can only remain broad. With that said, here are the options you must generally set:

When done, save and reboot to apply.

You may be wondering if you also need to enable the Wake-on-LAN feature in the NIC's settings as well. You don't, Batocera will automatically take care of enabling it for you.

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 by default.

It is possible to set up a dynamic DNS and port forwardings on your router to send WoL from other subnets but that is outside of the scope of this article.

To find out the unique MAC address of your Batocera system's NIC, run ip link show.

MAC address

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):

WoL client settings

Most utilities require the following information (or similar enough to it):

Click on Wake Up to wake the Batocera machine up.

Troubleshooting

Machine will not wake up

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):

The most important value is g. Without it being shown, the NIC does not support WoL at all.

Batocera should automatically turn on the MagicPacket™ feature when the connection is established. If that fails, in order to turn on WoL manually run the following:

ethtool -s eth0 wol g

where eth0 is the name of your network interface.

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.