Skip to content

VamsiKrishna1211/Remote-PC-Restarter

Repository files navigation

Remote PC Restarter

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.

Main Page Screenshot

Remote PC Restarter main page

Why This Exists

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.

How It Works

  1. Raspberry Pi runs a small Streamlit web app.
  2. The app drives a GPIO pin (GPIO 17 by default).
  3. GPIO toggles a relay for ~0.7s.
  4. Relay contacts are wired in parallel with the motherboard reset switch pins.
  5. Motherboard sees that pulse as a reset-button press.

The app also logs restart events and exposes a lightweight analytics page.

Hardware Required

  • 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

Network Model (Tailscale)

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

Repository Layout

.
├── 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

Software Prerequisites

  • Linux on Raspberry Pi with systemd
  • python3 and python3-venv
  • pip

The systemd setup script is Linux/systemd only and intentionally exits on macOS.

Wiring Overview

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)
  • Relay switch side:
    • Use COM and NO in parallel with motherboard RST front panel header pins
						   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.

Quick Start (Manual Run)

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 true

Open:

  • Main page: http://<pi-ip>:8501
  • Analytics page: http://<pi-ip>:8501/Analytics

Notes:

  • If RPi.GPIO is not available, app falls back to mock mode.
  • In mock mode, button clicks are logged but GPIO is not toggled.

Install as a Service (Recommended)

The project includes a systemd installer script.

chmod +x setup_systemd.sh
./setup_systemd.sh

What it does:

  • Creates virtual env at server/.venv
  • Installs server/requirements.txt
  • Renders and installs remote-pc-restarter.service to /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.service

Check status/logs:

sudo systemctl status remote-pc-restarter.service
sudo journalctl -u remote-pc-restarter.service -f

Uninstall Service

chmod +x uninstall_systemd.sh
./uninstall_systemd.sh

App Behavior

  • Default relay pin: GPIO 17 (BCM)
  • Pulse duration: 0.7 seconds
  • Cooldown default: 10 seconds (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

Security Recommendations

  • 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.

Troubleshooting

  • Service fails to start:
    • Check sudo journalctl -u remote-pc-restarter.service -n 200 --no-pager
  • 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

License

MIT. See LICENSE.

About

Basically uses Raspberry Pi and the Reset PIN of the mother board to force restart the remote PC if it ever runs into a huge issue or gets stuck.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors