Knock knock... wake up! A Wake-on-LAN controller with web UI, designed for Raspberry Pi.
Turn on your PCs remotely from a browser — works over your LAN or via a direct Ethernet cable between the Pi and your machine.
- Web-based device management — add, edit, remove target PCs from the browser
- Multi-method WOL — sends magic packets via multiple broadcast addresses for reliability
- Direct Ethernet support — wake a PC connected directly to the Pi with no router needed
- Zero Python dependencies — uses only the standard library
- Single file server — one Python file, easy to deploy and maintain
- REST API — automate with
curlor scripts - Responsive UI — works on desktop and mobile
PiKnock runs a lightweight HTTP server on your Raspberry Pi. When you click "Wake" in the web UI, it sends Wake-on-LAN magic packets to the target PC's network card, which powers on the machine.
Two network scenarios are supported:
Scenario 1: LAN (via router) Scenario 2: Direct Ethernet
┌──────────┐ ┌────────┐ ┌────┐ ┌──────────┐ ethernet ┌────────┐
│ Browser │───→│ Router │───→│ Pi │ │ Pi │═══════════│ PC │
└──────────┘ └────────┘ └────┘ │ 10.0.0.1 │ │10.0.0.2│
│ └──────────┘ └────────┘
magic packet
↓
┌────┐
│ PC │
└────┘
- Raspberry Pi (any model) with Python 3.7+
wakeonlanpackage:sudo apt install wakeonlan- Target PC with WOL enabled in BIOS
git clone https://github.com/SynapticaSolution/piknock.git
cd piknock
sudo ./install.shThe installer will:
- Install
wakeonlan - Deploy PiKnock to
/opt/piknock - Set up a systemd service (auto-start on boot)
- Optionally configure a direct Ethernet connection
# Install dependency
sudo apt install wakeonlan
# Copy files
sudo mkdir -p /opt/piknock
sudo cp piknock.py /opt/piknock/
sudo cp config.example.json /opt/piknock/config.json
# Run
python3 /opt/piknock/piknock.pycd piknock
git pull
sudo cp piknock.py /opt/piknock/
sudo systemctl restart piknockcp config.example.json config.json
python3 piknock.py
# Open http://localhost:8080Devices are stored in config.json:
{
"devices": [
{
"id": "abc123",
"name": "My Desktop",
"mac": "AA:BB:CC:DD:EE:FF",
"broadcast": "192.168.1.255",
"description": "Main PC on LAN"
}
],
"server": {
"port": 8080,
"host": "0.0.0.0"
}
}You can edit this file directly or use the web UI.
To wake a PC connected directly to the Pi (no router):
On the Raspberry Pi (handled by install.sh):
- Set
eth0to static IP10.0.0.1/24
On the target PC:
- Set the Ethernet interface to static IP
10.0.0.2, subnet255.255.255.0, no gateway
Then add the device in PiKnock with broadcast address 10.0.0.255.
Enable these in your target PC's BIOS:
- Wake on LAN: Enabled
- Wake on PCIe/PCI: Enabled
- ERP Support: Disabled
- Deep Sleep: Disabled
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/devices |
List all devices |
POST |
/api/devices |
Add a device |
PUT |
/api/devices/{id} |
Update a device |
DELETE |
/api/devices/{id} |
Remove a device |
POST |
/api/wake/{id} |
Send WOL to device |
GET |
/api/status |
Server info |
Example:
# Wake a device
curl -X POST http://raspberrypi:8080/api/wake/abc123
# Add a device
curl -X POST http://raspberrypi:8080/api/devices \
-H "Content-Type: application/json" \
-d '{"name":"Server","mac":"AA:BB:CC:DD:EE:FF","broadcast":"192.168.1.255"}'MIT - See LICENSE
Made by Synaptica Solution — AI & Process Automation for Italian SMEs
- Synaptica Solution — Custom software and AI automation for Italian SMEs
- Process Automation Solutions — Our approach to automation