This project turns a wifi enabled ESP32 device into a small server that forwards Wake-On-Lan packets to a device on the internal network.
It is meant to bypass routers that have no way of passing magic packets from the outside network. You will still need router credentials for this to work.
- WakeOnLan: Using a pre-existing library to format magic packets
The basic tutorial is meant for people using Arduino IDE. You sohuld install it to follow the tutorial or adapt accordingly.
-
Install board manager.
-
In the Arduino IDE go to
File > Preferences
and paste the following url in the "Additional Boards Manager URLs":https://dl.espressif.com/dl/package_esp32_index.json
-
Then go to
Tools > Board > Boards Manager...
and installesp32
manager. -
In
Tools > Board > ESP32 Arduino
select your ESP32 device from the list
-
-
Install WakeOnLan library. The easiest way to install it is through
Sketch > Include Libary > Manage Libraries...
and searching for WakeOnLan. -
Write esp_server to the board.
-
Clone this repository to your machine and open it through your IDE.
-
Change the following lines with your wifi network information and the computer's you want to wake up MAC address.
const char* ssid = "WiFi name"; const char* password = "WiFi password"; const char* MACAddress = "MAC address of the device to be woken up";
-
Connect your ESP32 board to the computer and press Upload.
-
-
Add port forwarding through your router.
Find out how to connect to your router console and add a forwarding rule from TCP port 80 to your ESP device. The device prints its MAC address through serial on startup to help you identify it.