Using a Raspberry Pi to control a togglable power strip that a laptop-server is plugged in to.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kiichan 9edf31d3d0 Update 'README.md' 1 year ago
LICENSE Initial commit 1 year ago
README.md Update 'README.md' 1 year ago
client.py Add 'client.py' 1 year ago
server.py Add 'server.py' 1 year ago

README.md

serv-power

Using a Raspberry Pi to control a togglable power strip that a laptop-server is plugged in to. This is completely tailored to my own needs and is not necessarily meant to be something anyone can download and run. I've put it here to serve as some inspiration for others who may have similar needs or situations.

The power strip I use is one of these

Usage

Put server.py on the Raspberry Pi and run the script on boot with sufficient privileges to control the GPIO pins. The script is set up to use pin 36 to toggle the power strip, so update that if you don't want to use that pin.

Put client.py on your server and run it every X minutes using cron or similar. Change the server_ip variable in client.py to have your server's IP address.