Published Nov 27, 2026, 3:30 PM EST Ayush Pande is a PC hardware and gaming writer. When he's not working on a new article, you can find him with his head stuck inside a PC or tinkering with a server operating system. Besides computing, his interests include spending hours in long RPGs, yelling at his friends in co-op games, and practicing guitar. As much as I love combining my ESP32 boards with quirky sensor modules, DIY smart home gadgets aren’t the only projects I’ve built with my microcontroller arsenal. Over the last couple of months, I’ve put together a bunch of experiments to use my ESP32 boards with my home lab. These range from custom macro pads, Wi-Fi strength scanners, PC monitoring dashboards, and other utility gizmos to wacky setups like an automated ESP32 pipeline that turns on my home lab nodes every time I punch the table. This time, I figured I could try pairing my ESP32 with my gaming workstation. You see, my productivity and coding tasks typically require the llama-server instance I’ve put together on my RTX 3080 Ti-powered system. But if I were to leave my PC fully awake at all times, I’d risk spiking my energy bill. So, I decided to build an ESP32-powered chain that wakes my PC up at the press of a button. Wake-on-LAN is the heart of this pipeline Thankfully, my PC’s mobo supports WoL Keeping my PC powered off most of the time, and only turning it on for my inference (and remote gaming) tasks is a great way to cut the idle wattage of my tower-sized system. But heading down to my tinkering cave and powering my PC every time I need to harness its processing capabilities can get tedious pretty quick – and that’s where my Wake-on-LAN setup comes in handy. For the uninitiated, WoL sends a special “magic packet” to a system’s network card, which checks the contents of this packet for a specific pattern (and I’ll go over this in a bit) and spurs the PC back to life upon spotting it. But before I could start programming my ESP32, I had to enable WoL on my PC. First, I headed to my motherboard’s BIOS by mashing the Delete key during the startup sequence. Then, I disabled the ErP setting from the Platform Power menu, so my Ethernet port would continue to receive power even when my PC is turned off. On my mobo, I found the Wake-on-LAN settings within the IO Ports section of the Settings tab. Depending on your motherboard’s manufacturer, you may find this option inside the Wake Up Event Setup/ACPI Configuration tab of the Advanced BIOS menu. I also wanted to double-check whether my NIC supports Wake-on-LAN. So, I opened Device Manager, opened the Properties window of the Network Adapter associated with the NIC, and scrolled down to the Wake on Pattern Match option. Sure enough, WoL was already enabled on my PC, so it was time to switch to my ESP32. I use a KY-023 button connected to my ESP32 to trigger the Wake-on-LAN workflow Good ol’ Arduino IDE helped me flash the code onto the ESP32 Since I wanted to use a button-press event as the trigger for my WoL pipeline, I grabbed a KY-023 joystick module and connected it to my ESP32 using this table as reference. ESP32 KY-023 GND GND 3.3V 5V D18 VRx D5 VRy D4 SW I could technically go for a Home Assistant-powered configuration – one that uses the uber-simple ESPHome to fire the Wake-on-LAN packet. But I wanted to reduce this workflow’s dependency on other services, so I went with Arduino IDE instead. First, I created some constants for the Wi-Fi SSID, password, subnet broadcast IP, and my PC’s MAC address. Speaking of which, the MAC address groups each pair of hexadecimal characters by prefixing them with 0x, with a comma acting as the separator for each pair. I also entered some code for the GPIO pin connected to the KY-023 button, including a cooldown time to ensure I don’t spam too many WoL signals when pressing down on the analog stick. const char* WIFI_SSID = "ayush-homelab-main"; const char* WIFI_PASS = "a-random-password"; const uint8_t PC_MAC[6] = {0x42, 0xBE, 0x10, 0xA3, 0xE2, 0xBC}; const IPAddress BROADCAST_IP(192, 168, 0, 255); const int BUTTON_PIN = 4; After that, I began working on the functions driving this pipeline. The first one, connectWiFi(), uses the credentials I’d created in the last step to pair my ESP32 to the same network as my PC. void connectWiFi() { WiFi.mode(WIFI_STA); WiFi.begin(WIFI_SSID, WIFI_PASS); Serial.print("Connecting"); while (WiFi.status() != WL_CONNECTED) { delay(300); Serial.print("."); } Serial.print("\nConnected, IP: "); Serial.println(WiFi.localIP()); } The sendMagicPacket() function, on the other hand, creates the WoL packet and pushes it to my PC. A magic packet typically has 6 bytes containing 0xFF, followed by 16 repetitions of my PC’s MAC address, and that’s precisely what the for loop within the function creates. void sendMagicPacket() { uint8_t packet[102]; memset(packet, 0xFF, 6); for (int i = 0; i COOLDOWN_MS) { sendMagicPacket(); lastSend = millis(); } while (digitalRead(BUTTON_PIN) == LOW) delay(10); } } delay(10); } The overall code looks something like this: There’s still more I can do with my WoL device So far, I’ve only added one PC to my Wake-on-LAN configuration, but there are plenty of ways I can extend this project. For example, I could try the MAC addresses of three other PCs into the Arduino IDE code and map each system to the four directional inputs on my KY-023 analog stick. Toss in a simple touchscreen module, and my ESP32-powered WoL server would become even more beginner-friendly. Really, the sky’s the limit when it comes to custom ESP32 gadgets. Brand AITRIP Connectivity Features UART, USB
I built an ESP32 Wake-on-LAN button, and I stopped leaving my gaming PC on all day
Full Article
Original Source
Read the full article at Xda-developers →KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.