Remote PC Restarter is a Raspberry Pi based rescue switch for a hung desktop PC.
When your PC is completely unresponsive (no RDP/SSH/ping, frozen UI, no remote control), this project lets you trigger a physical motherboard reset remotely by pulsing a relay connected to the motherboard RST header pins.
The server runs on a Raspberry Pi Zero 2 W and is reachable from your devices through your Tailscale network.
If your machine hangs hard, software-only remote tools are useless.
This project gives you an out-of-band fallback by simulating a brief press of the physical reset switch.
- Raspberry Pi runs a small Streamlit web app.
- The app drives a GPIO pin (
GPIO 17by default). - GPIO toggles a relay for ~
0.7s. - Relay contacts are wired in parallel with the motherboard reset switch pins.
- Motherboard sees that pulse as a reset-button press.
The app also logs restart events and exposes a lightweight analytics page.
- Raspberry Pi Zero 2 W (or compatible Raspberry Pi with GPIO)
- 1-channel relay module (compatible with Pi GPIO logic)
- Jumper wires
- Power supply for Pi
- Access to motherboard front panel reset (
RST) header pins
Install Tailscale on:
- Raspberry Pi (host running this app)
- Target PC
- Any control device (phone/laptop/tablet)
Then all devices are on the same private tailnet, and you can open the restarter UI from any approved device.
Example URL:
http://<pi-tailscale-ip>:8501
.
├── remote-pc-restarter.service # systemd unit template
├── setup_systemd.sh # install + enable service
├── uninstall_systemd.sh # remove service
└── server/
├── app.py # main Streamlit app (restart action)
├── metrics_store.py # JSONL event logging + summaries
├── requirements.txt # base deps (streamlit)
├── requirements._rpi.txt # Pi deps (streamlit + RPi.GPIO)
├── data/
│ ├── live_events.jsonl
│ └── restart_events.jsonl
└── pages/
└── 1_Analytics.py # charts, event history, CSV export
- Linux on Raspberry Pi with
systemd python3andpython3-venvpip
The systemd setup script is Linux/systemd only and intentionally exits on macOS.
Wire the relay in a way that is electrically equivalent to momentarily shorting the motherboard reset button pins.
- Relay control side:
- Pi
GPIO 17-> relay input pin - Pi
GND-> relay ground - Relay VCC -> suitable power (per relay module spec)
- Pi
- Relay switch side:
- Use
COMandNOin parallel with motherboardRSTfront panel header pins
- Use
TAILSCALE NETWORK
Phone/Laptop/Tablet <-----> Raspberry Pi Zero 2 W
(runs Streamlit app)
Raspberry Pi GPIO side Relay module Motherboard front panel header
---------------------- ------------ -------------------------------
GPIO17 (BCM pin used by app) -------------> IN
GND -------------> GND
3V3/5V (per relay spec) -------------> VCC
COM ---------------------> RST PIN 1
NO ---------------------> RST PIN 2
Reset switch behavior: relay closes COM<->NO briefly (~0.7s), same as pressing reset button.
Important:
- Confirm your relay module input voltage/current requirements.
- Confirm your motherboard front panel header pinout before connecting.
- Do not apply external voltage to motherboard reset header pins.
From project root:
python3 -m venv server/.venv
server/.venv/bin/pip install --upgrade pip
server/.venv/bin/pip install -r server/requirements._rpi.txt
server/.venv/bin/python -m streamlit run server/app.py --server.address 0.0.0.0 --server.port 8501 --server.headless trueOpen:
- Main page:
http://<pi-ip>:8501 - Analytics page:
http://<pi-ip>:8501/Analytics
Notes:
- If
RPi.GPIOis not available, app falls back to mock mode. - In mock mode, button clicks are logged but GPIO is not toggled.
The project includes a systemd installer script.
chmod +x setup_systemd.sh
./setup_systemd.shWhat it does:
- Creates virtual env at
server/.venv - Installs
server/requirements.txt - Renders and installs
remote-pc-restarter.serviceto/etc/systemd/system/ - Enables and starts service on boot
On Raspberry Pi hardware, install GPIO dependency into the same venv after setup:
server/.venv/bin/pip install RPi.GPIO
sudo systemctl restart remote-pc-restarter.serviceCheck status/logs:
sudo systemctl status remote-pc-restarter.service
sudo journalctl -u remote-pc-restarter.service -fchmod +x uninstall_systemd.sh
./uninstall_systemd.sh- Default relay pin:
GPIO 17(BCM) - Pulse duration:
0.7seconds - Cooldown default:
10seconds (UI configurable) - Optional webhook per restart event
- Events stored in JSONL at:
server/data/restart_events.jsonl
Analytics page provides:
- Total restarts
- Restarts today / last 24h
- Last restart timestamp
- Frequency bar chart (7-60 day window)
- Recent event table
- CSV export
- Keep this service only on trusted/private networks.
- Prefer access through Tailscale instead of open Internet port forwarding.
- Restrict tailnet access using Tailscale ACLs.
- If desired, place this behind an authenticated reverse proxy.
- Service fails to start:
- Check
sudo journalctl -u remote-pc-restarter.service -n 200 --no-pager
- Check
- Relay not switching:
- Verify wiring and GPIO pin numbering mode (BCM)
- Confirm relay input logic levels and power
- Confirm app is not in mock mode
- UI reachable but no reset:
- Recheck motherboard reset header pin mapping
- Confirm relay contacts are wired to
COM+NO
MIT. See LICENSE.
