ESP32 Power Switch
Turn on your home computer from your phone, anywhere in the world — and shut it down when it is no longer needed. The only thing running at home around the clock is a $2 ESP32 board.
Get a consultation → Download firmware and sources ↓- Format
- Device + agent + panelUSB-powered ESP32, PowerShell agent on the PC, web panel on a VPS
- Status
- Working
- Stack
- ESP32 (Arduino) · Wake-on-LAN · MQTT · PowerShell · n8n · Telegram
- Direction
- Robotics Lab
About the product
ESP32 Power Switch is an alarm clock for a computer that should not run 24/7. You tap a button in a web panel on your phone, and about a minute later the machine at home is on: an ESP32 board inside the local network sends it a Wake-on-LAN magic packet and keeps retrying until the computer answers. Once Windows is up, the PC listens for commands — shut down, reboot, run a script and send the output to Telegram. Every step is reported: “waking the PC”, “PC is on”, “command executed”.
It is built for a powerful machine at home or in the office that is needed only occasionally: a GPU workstation for local models, a home server, a lab rig. Instead of keeping it on for weeks or renting a cloud GPU for what you already own, the computer runs only for the duration of a task and shuts itself down if you forget about it.
Phone
A button in a password-protected panel
VPS
Panel leaves a command; MQTT broker
ESP32
Reads the command over HTTPS every 5 min
Wake-on-LAN
Packets repeat until the PC answers
Windows agent
Executes commands from MQTT
Telegram
Every step reported via n8n
The key decision: power-on and control are separate channels. Wake-on-LAN is needed when the PC is off and no agent exists; commands are needed once Windows is running. So the ESP32 inside the home network acts as the alarm clock, and an agent on the computer itself acts as the remote. Nothing is exposed to the internet: both the board and the agent reach out to the panel and broker on the VPS, never the other way round.
Who it is for
GPU workstations
Wake the machine for a task — a local model, video processing, an experiment — and power it down afterwards. The GPU runs exactly as long as the job.
Home and office servers
Power on from anywhere without IPMI or server-grade hardware. No port forwarding into the home network.
Labs and test rigs
The same stack drives power for rigs, outlets and sensors — the first step towards controlling physical objects in Robotics Lab.
How it works
- 1
Tap the button
“Power on” in the password-protected web panel on the VPS. The panel leaves a short command on the server for the board.
- 2
The ESP32 wakes up and reads it
The board spends almost all its time in deep sleep; every five minutes (or on the physical button) it brings up Wi-Fi and fetches the command over HTTPS.
- 3
Wake-on-LAN until the PC answers
The magic packet goes to both broadcast addresses. The board repeats the cycle until it sees the agent on the PC, then reports “PC is on” to Telegram.
- 4
Windows is up — the agent is online
Startup launches HTTP and MQTT agents in PowerShell. The panel now offers shutdown, reboot, lock, arbitrary commands and script launches.
- 5
Shutdown — manual or automatic
A “shut down” command from the panel, or the idle agent: 60 minutes without keyboard or mouse — a Telegram warning, then shutdown with a one-minute cancel window.
What the product does
Wake-on-LAN with confirmation
The ESP32 sends the magic packet to 255.255.255.255 and to the subnet's directed broadcast — some routers pass only one of them. The “PC must be on” goal lives in the board's RTC memory and survives its own deep sleep: packets repeat until the agent on the PC answers, then a report with uptime goes to Telegram.
Deep sleep and microamps
Between checks the board sleeps with the radio off; the CPU clock is lowered to 80 MHz, Wi-Fi uses modem sleep and reduced transmit power. It runs off an ordinary USB phone charger, stays cool and lasts for years.
Windows commands over MQTT
Keywords shutdown, restart, lock, sleep, hibernate; arbitrary cmd.exe and PowerShell commands with output returned to Telegram; launching exe, bat, ps1 and Python scripts by path. The agent connects to the broker on the VPS itself — no inbound ports on the router.
Idle agent
A separate script in the user session watches the time of last input. 60 minutes without mouse or keyboard — a Telegram warning, then a clean shutdown with a 60-second cancel window. It ignores the first five minutes after boot so the system can come up.
Telegram reports via n8n
All notifications — from the board, the agents and the idle script — go through a single n8n webhook on the VPS. Delivery logic and message format change by editing the workflow, with no reflashing; Telegram does not need to be reachable directly from the home network.
Board diagnostics
The ping_esp32 command returns a report: SSID and signal level, chip temperature, PC agent reachability, last reset reason and wake counter. The BOOT button on the case triggers a manual check; shutdown_esp32 puts the board into deep sleep until the button is pressed.
Home AI without the cloud
After powering on from the phone, a reverse SSH tunnel goes up and the local model on the home GPU becomes reachable from outside like a cloud endpoint. The machine runs only while the job lasts, then the idle agent shuts it down.
Extends to relays and sensors
The same board and command channel drive relays, smart outlets and sensors. Next on the ladder: a smart outlet for the case when Windows hangs and a clean shutdown is not available.
Want to see the product on your data?
We will show a demo, walk through your scenario and suggest a deployment format.