https://github.com/mirsella/powercontrol
control your PC power with a mobile app
https://github.com/mirsella/powercontrol
capacitor grub raspberry-pi relay relay-board remote-control serial smarthome vite vuejs
Last synced: 2 months ago
JSON representation
control your PC power with a mobile app
- Host: GitHub
- URL: https://github.com/mirsella/powercontrol
- Owner: mirsella
- Created: 2022-01-25T10:16:10.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-02-28T13:09:18.000Z (over 1 year ago)
- Last Synced: 2025-02-28T19:09:59.170Z (over 1 year ago)
- Topics: capacitor, grub, raspberry-pi, relay, relay-board, remote-control, serial, smarthome, vite, vuejs
- Language: TypeScript
- Homepage:
- Size: 9.85 MB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# powercontrol
PC power/reset controller built around a Raspberry Pi, a relay board, and a Vue/Capacitor client.
It can also send serial key presses to the motherboard so the app can select the next GRUB entry before boot.
## How It Works
The server is a small Express API running on the Raspberry Pi. It controls GPIO pins connected to a relay board for power and reset, and it can also write HID key presses to `/dev/hidg0` to drive the GRUB menu before the PC starts.
The client is a Vue 3 + Capacitor app that discovers the server, stores connection details locally, and exposes actions such as power, reset, reboot, next-boot selection, and host online status.
In practice the hardware chain is:
`motherboard front-panel pins <-> relay board <-> Raspberry Pi <-> client app`
## Quick start
1. Copy `server/config.example.json` to `server/config.json`.
2. Adjust the GPIO pins, `host_ip`, and `token`.
3. Start the server with `cd server && npm install && npm run dev`.
4. Start the client with `cd client && npm install && npm run dev`.
## Android build
```bash
cd client
npm run android
```
## Config Notes
- `shutdownTime` controls the delay used for reboot-style flows.
- `menuTime` controls when GRUB key presses are sent.
- `nextboot` is the boot-menu key sequence to send.
- Authentication is a single shared bearer token.
## Pictures