Skip to main content
Topic: Possible to turn a pc on? (Read 10439 times) previous topic - next topic

Possible to turn a pc on?

Hi Guys!

I Have a USB IR Toy v2 and its working great for over half a year.
i'm realy excited about this!

But now I'm wondering if it is possible to turn a PC on, if it is completely shut down?
Have some Guys of you already figured that out?
Can it be done by Wake on USB?

Thanks for any advice!

Owel

Re: Possible to turn a pc on?

Reply #1
Well, if the PC is completely shut down, there's no waking it via USB. Only perhaps WakeOnLan but that's not for the USBIRToy.
As far as wake from sleep/low power I have seen some hints of how it is supposed to function when implementing the usb stack.

But I haven't investigated further that setting the option to "False" or equivalent in the usb descriptor.
There is no code to support it, and at least I don't know how to do it.

Perhaps JTR knows, it could be a good additional feature to the stack.
I have regrettably too little time to code, I haven't even been able to keep up with the continued development of the stack I started.

Re: Possible to turn a pc on?

Reply #2
Yeah, I doubt your USB is powered when the PC is off. I have not heard of a turn PC via USB. I have seen wake, but I think thats only for when your PC is in standby or whatever.

I did this for my xbox a long time ago; I took an attiny45 I think it was; a IR reciveing de-modulator type, and an LED. I hooked it up to the power button; so when you press and hold you can program the power and eject buttons; so it could be used with any remote control.. Basically it just mimicked somone pressing the power button. Infact I dont have the xbox anymore (well i do have its power supply) but I do still have that little board; thinking about making it to do the same with my PC.. and add a 'breathing' LED effect when the PC is off. The board was etched myself; prolly the best etched board I have ever made... now I dont do etching.

What was funny about it was it was very early in my MCU experience; so I wasnt very good and didnt know how to use timers and so on, like I do now.. So how it worked was it simply:

Code: [Select]
sudo code:
WaitTillHigh()
WhileHigh() {
  count++;
}
// dropped low
keycode[1] = count;
count=0;
WhileLow() {
  count++;
}
// went high again
keycode[2] = count;
....

(ulong32) RealCode = count[3] & count[6] & count[7]


and did this like 14 times... and by throwing out most of the counts; it was quite reliable and each code (power or eject) would actaully be stored 3 times; so each IR send would be compared to 6 stored codes in the EEPROM to control two functions :D

it still works :D
Somday I will get around to it.

Re: Possible to turn a pc on?

Reply #3
Yep.
Your PC can be turned on if it's in low-power state like S3. If your motherboard have Selectable jumpers for the USB port's supply (+5V or +5VSB) then you can hook the standby 5A power rail to the USB and do it.
Still learning
-Arup

Re: Possible to turn a pc on?

Reply #4
Well, hardware modifications aside, most modern motherboards support some sort of waking up from usb activity from sleep state.
In sleep state there is still voltage on the USB connector and some rudimentary communication still present, but how exactly the device is supposed to alter its state to notify the host that it should wake up is not known to me.

The best bet is going to the source and read the USB specs, they are not too difficult.

Re: Possible to turn a pc on?

Reply #5
so i've done some research.

Some modern mainboards have the oppertunity to turn a PC on by USB. Therefore USB power supliy (5V) is needed while the PC is off. This can mostly be done by jumper settings. My mainboard supports that feature and i will try it, if it works with the USB IR Toy.
Hopefully it will :)

Owel

Re: Possible to turn a pc on?

Reply #6
I think the wake fromj USB may be protocol specific. HID (mouse, keyboard) yes, but you need to make sure that applies to USB CDC-ASCM (virtual serial port) too.
Got a question? Please ask in the forum for the fastest answers.

Re: Possible to turn a pc on?

Reply #7
I found http://http://www.simerec.com/PCS-2.html when looking through the xbmc forums. It allows you to power on/off the PC via IR. Some simple drilling and splicing is required, but it looks pretty easy.  It could be used on its own, but I wonder it or something similar could be used to power the IR Toy.

Re: Possible to turn a pc on?

Reply #8
I think the IR Toy could be powered that way, tapping the 5volt standby supply of the ATX connector. The main difference is that the IR TOy doesn't currently have any firmware to store and recognize codes without a PC attached.
Got a question? Please ask in the forum for the fastest answers.

Re: Possible to turn a pc on?

Reply #9
I actually consulted the documentations...

If the (windows) computer is is sleep mode and it has REMOTE WAKEUP devices connected it will go into S1 instead of S3 due to the common fact that older motherboards don't power VUSB in S3. And the usb device is set in suspended mode.

When/If the device signals resume the host wakes up and starts sending START OF FRAME packets, enabling communication again.

What lacks for IRtoy is only software.
First bit 5 (REMOTE WAKEUP) in bmAttributes of the configuration descriptor needs to be set.
Then the wakeup signaling needs to be implemented. That could perhaps be some interrupt on pin change of the IR receiver, then the pic could be put in sleep as well (max allowed power consumption in suspended mode is something like 2.5mA) and any IR signal, correctly modulated, will wake the PC.

I assume Mac/Linux/BSD/Solaris/BeOS/DOS/OS2 et al works in the same manner, perhaps with the ability to go into S3 on newer motherboards.

Re: Possible to turn a pc on?

Reply #10
Actually, looking at the code it is already implemented. Except for some sanity checking.
To signal the host REMOTE WAKEUP, just make a call to
Code: [Select]
void SignalResume( void )

I don't know how the SIE will handle this if it isn't in suspended mode, but it might work.
Oh, and there's some callbacks as well. By defining a macro usb_low_power_request() to a function you will get a callback when the host orders suspend mode and by defining usb_low_power_resume() you get a callback on the resume.
Both defines should go into usb_config.h but it might be that they do not take effect, depending on order of evaluation...

And of course set the remote wakeup bit in configuration descriptor bmAttributes (0xA0)

It's crazy, I apparently wrote this in automatic mode without fully understanding it.

Re: Possible to turn a pc on?

Reply #11
Although using the USB to wake up from sleep is cleaner , not all system  work satisfactorily doing this.  A cold start simulation the power button is the only option.  I therefore suggest to following

Since the signal to "turn on " an ATX style power supply is a simple TTL compatible signal spec'ed as follows 
VIL, Input Low Voltage 0.0 V 0.8 V
IIL, Input Low Current (Vin = 0.4 V) -1.6 mA
VIH, Input High Voltage (Iin = -200 μA) 2.0 V
VIH open circuit, Iin = 0 5.25 V
A software  mod to drive this a spare pin should be straight forward .  To address Ian comment about no memory to record the remote codes  they would first have to be determined with a connection to a PC then hard codded in the firmware.

Power connection  and the spare pin can all obtain on the JP1 header.

So Yes, it is possible, but woulds take some programming. Along with wiring to the ATX power supply

Re: Possible to turn a pc on?

Reply #12
perhaps it's not necessary to wire directly to the psu, you could wire it to the power button in parallel...you'd only have to connect one wire since the gnd is shared through usb..
best regards FIlip.

Re: Possible to turn a pc on?

Reply #13
interessting.
My MB provides power, even if the pc is shut down. so extra Powering over the ATX isnt necessary.
As far as is understand the last posts, is to update the firmware so that an IR code is stored in the Toy on which the Toy will react and send a Signal over USB to Power the PC on. right?

Re: Possible to turn a pc on?

Reply #14
Hi Owel,

Yes, that is correct.
Got a question? Please ask in the forum for the fastest answers.