Remote Power Switch for my PC using a Raspberry Pi - Overclock.net - An Overclocking Community

Forum Jump: 

Remote Power Switch for my PC using a Raspberry Pi

Reply
 
Thread Tools
post #1 of 32 (permalink) Old 09-26-2013, 11:04 AM - Thread Starter
Retired Staff
 
IEATFISH's Avatar
 
Join Date: Jul 2008
Location: Phoenix, AZ
Posts: 14,316
Rep: 501 (Unique: 394)
The Problem: my PC doesn't like to sleep (the fans never turn off) and Wake-On-Lan can be really touchy, usually turning on my PC when I didn't ask it to and after only 2-3 minutes of sleep. Also, sometimes I forget to turn on my computer when I am at work or school so I can't access any of my files or services.

The Solution: I'm going to buy a Raspberry Pi. The Pi will host a web server (via wireless) which will have a single web page with a single button to Power On or Off my PC. When I click the button, I will use the GPIO pins on the Raspberry Pi to switch a relay connected to the power pins on my PC. This will all fit nicely inside my PC case.

So, I need to set up a web server on Linux, which I can do. I need to wire up a relay circuit which I can sorta do but my EE roommate can help me with. Then I need to code the web page to actually switch the relay which I have no idea how to do but my roommate says he does.

All in all I'm not sure how I'm going to fit this project into my time but I hope to get it done in the next month or so. Anyone done this sort of thing before?


EDIT: Final update here: https://www.overclock.net/t/1429479/remote-power-switch-for-my-pc-using-a-raspberry-pi/0_50#post_21592386


IEATFISH is offline  
Sponsored Links
Advertisement
 
post #2 of 32 (permalink) Old 09-26-2013, 08:13 PM
~Dum Vivimus Bibamus~
 
ILOVEPOTtery's Avatar
 
Join Date: Jul 2007
Location: PNW
Posts: 938
Rep: 82 (Unique: 70)
Sub'd. Good luck man, this sounds like a cool project.

µHammer
(8 items)
CPU
i5-4690k - 4.6GHz @ 1.250V
Motherboard
ASRock Z97M OC Formula
GPU
Sapphire R9 290
RAM
G.SKILL TridentX (2 x 4GB) DDR3 2400
Power Supply
Corsair AX760
Cooling
2x H105s: CPU and 290 (via NZXT G10)
Case
Thermaltake Core V21
Monitor
The Tube (39" LG LED)
▲ hide details ▲


ILOVEPOTtery is offline  
post #3 of 32 (permalink) Old 09-30-2013, 05:18 PM - Thread Starter
Retired Staff
 
IEATFISH's Avatar
 
Join Date: Jul 2008
Location: Phoenix, AZ
Posts: 14,316
Rep: 501 (Unique: 394)
Alright, I ordered the Pi and wifi adapter today. It should show up on Wednesday and I hope to be able to get started this weekend. My first steps will be to get the PI set up and stable.


IEATFISH is offline  
Sponsored Links
Advertisement
 
post #4 of 32 (permalink) Old 10-03-2013, 12:27 AM - Thread Starter
Retired Staff
 
IEATFISH's Avatar
 
Join Date: Jul 2008
Location: Phoenix, AZ
Posts: 14,316
Rep: 501 (Unique: 394)
Look what showed up today!



Raspberry Pi, USB power brick, Wireless N adapter, and an old 4GB SD card I had lying around.


Installing the OS was extremely easy. Download the image, format the card, copy the files, and let it do its thing.



Setup was a breeze. I had to edit a few lines of text for my wifi settings and one or two clicks to enable SSH. I'm installing the web server components now and then I need to start reading up on coding for the GPIO pins and how to get my webpage to send a command there.


IEATFISH is offline  
post #5 of 32 (permalink) Old 10-03-2013, 12:51 PM - Thread Starter
Retired Staff
 
IEATFISH's Avatar
 
Join Date: Jul 2008
Location: Phoenix, AZ
Posts: 14,316
Rep: 501 (Unique: 394)
Last night I was also able to get the python libraries for the GPIO installed as well as messing around with the Pi a bit. If anyone wants a cheap way to play with Linux, this is a pretty amazing option.


IEATFISH is offline  
post #6 of 32 (permalink) Old 10-03-2013, 08:07 PM
Retired Staff
 
KarmaKiller's Avatar
 
Join Date: Nov 2007
Location: Springfield
Posts: 4,214
Rep: 123 (Unique: 103)
As long as the button on the web page is a giant red one that says "DO NOT PRESS THIS BUTTON", I approve. thumb.gif

Learn how to use the new features of the site:


Currently Playing: H1Z1:KOTK, Overwatch, World of Tanks, Project Cars


KarmaKiller is offline  
post #7 of 32 (permalink) Old 10-03-2013, 09:28 PM - Thread Starter
Retired Staff
 
IEATFISH's Avatar
 
Join Date: Jul 2008
Location: Phoenix, AZ
Posts: 14,316
Rep: 501 (Unique: 394)
Quote:
Originally Posted by KarmaKiller View Post

As long as the button on the web page is a giant red one that says "DO NOT PRESS THIS BUTTON", I approve. thumb.gif

Ha, that's exactly what I was planning. Or maybe the Staples easy button.


IEATFISH is offline  
post #8 of 32 (permalink) Old 10-03-2013, 10:22 PM
Retired Staff
 
XiCynx's Avatar
 
Join Date: Oct 2007
Location: Elyria, Ohio
Posts: 2,309
Rep: 128 (Unique: 111)
Call me old school. But I am just a fan of the good old power button! One to power it on, the other to power it off. smile.gif
Warning: Spoiler! (Click to show)
00-vt.jpg

Overclock What!? (Click to show)
Quote:
Originally Posted by 10acjed 
I get 7 trillion frames per nanosecond in BC2
Quote:
Originally Posted by Ecchi-BANZAII!!! 
Did you OC the floppy drive?wink.gif
Quote:
Originally Posted by WaterMelnKidd 
He must have, I remember seeing this performance increase after overlocking my memory card reader to allow me to dual boot / play BFBC2 off a 4GB MicroSD.
Quote:
Originally Posted by jellis142 
How did you fit BC2 on a 4Gb drive?!?!?! eek.gif
Quote:
Originally Posted by WaterMelnKidd 
I just simply overclocked it to 40GB.
Contact Details (Click to show)
Google Talk: [email protected]
Twitter: XiCynx


XiCynx is offline  
post #9 of 32 (permalink) Old 10-04-2013, 08:32 AM
_02
Retired Staff
 
Join Date: Aug 2009
Location: USA
Posts: 7,860
Rep: 195 (Unique: 157)
Cool project!

I've been meaning to play around with a raspberry pi for a while.

Strongly recommend securing that page via htaccess or other means - is there a web based API you're using to interface the site with the hardware?
_02 is offline  
post #10 of 32 (permalink) Old 10-04-2013, 01:11 PM - Thread Starter
Retired Staff
 
IEATFISH's Avatar
 
Join Date: Jul 2008
Location: Phoenix, AZ
Posts: 14,316
Rep: 501 (Unique: 394)
Quote:
Originally Posted by _02 View Post

Cool project!

I've been meaning to play around with a raspberry pi for a while.

Strongly recommend securing that page via htaccess or other means - is there a web based API you're using to interface the site with the hardware?

I was thinking about that. I'll do some simple security and might move it to an isolated VLAN so I don't have to worry about and intrusions. The web page will run on a non-standard port which will help.

As for interfacing the site with the hardware, I found that you can run terminal commands via php and so I should be able to run the python API triggers directly. I may wire up the reset button as well and then have the power button ping the PC first so it doesn't switch if the PC is already on, if that makes sense.


IEATFISH is offline  
Reply

Quick Reply
Message:
Options

Register Now

In order to be able to post messages on the Overclock.net - An Overclocking Community forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.
User Name:
If you do not want to register, fill this field only and the name will be used as user name for your post.
Password
Please enter a password for your user account. Note that passwords are case-sensitive.
Password:
Confirm Password:
Email Address
Please enter a valid email address for yourself.
Email Address:

Log-in



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page


Forum Jump: 

Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off