Skip to content

Wakes up my beefy desktop computer from my Raspberry Pi with a Wake-on-LAN packet.

License

Notifications You must be signed in to change notification settings

va-li/wakeup-service

Repository files navigation

Wakeup Service

Wakes up my beefy desktop computer from my Raspberry Pi with a Wake-on-LAN packet.

User interface screenshot

Why? The desktop computer has an idle load of ~80W. The Raspberry Pi has an idle load of less than 5W. Quick calculation: 80 Watts * 24 hours * 365 days = (80/1000) * 24 * 365 kWh = 700,8 kWh per year. That would be lot of electricity wasted.

Usage

Goto http://10.64.0.4:8000/ to ping or wake up the computer.

Notes

  • The Raspberry Pi is connected to the same home network as the desktop computer.
  • The Raspberry Pi is also in a wiregurad VPN network (hence the 10.64.0.4 IP address).

Setup

  1. Create a new user for the service on the Raspberry Pi

    sudo useradd -r -s /bin/false wakeup_service
  2. Create a directory for the service, but make it owned by your user (here: gir)

    sudo mkdir /usr/local/lib/wakeup-service
    sudo chown gir:gir /usr/local/lib/wakeup-service/
  3. Create a virtual environment for the service

    python3 -m venv /usr/local/lib/wakeup-service/venv
  4. Install the dependencies from requirements.txt

    /usr/local/lib/wakeup-service/venv/bin/pip install -r requirements.txt
  5. Install the wakeup service

    sudo cp wakeup.service /etc/systemd/system/
    sudo systemctl enable wakeup.service
    sudo systemctl start wakeup.service

About

Wakes up my beefy desktop computer from my Raspberry Pi with a Wake-on-LAN packet.

Topics

Resources

License

Stars

Watchers

Forks