Re: Wake on USB event

Jan 31, 2025 Last reply: 1 year ago 5 Replies


One of my workstations refuses to stay asleep.  Often,


> just after being COMMANDED to sleep, it would reawaken.
> Sometimes, a short while later (i.e., just long enough
> for me to leave the room and return to find it running,
> again).
>
> Windows logs suck.  But, I was able to trace the cause
> of the wake-up to "USB root hub" (I think there are
> six things with this name in the device tree!).
>
> I narrowed it down to the keyboard; unplug keyboard,
> command it to sleep and it stays asleep.
>
> [N.B. The keyboard works completely as expected when powered on!] >
> Fine.  Replace keyboard, problem solved.
>
> *BUT*, I can't EASILY get any more of this particular model
> of keyboard (eBay-roulette?) so I would like to salvage it
> given that the "problem" is likely a hardware issue.
>
> First question is what *might* (likely) Windows be seeing that
> makes it think that a valid USB event has been detected?
> I.e., is it a "smart" pattern recognizer (like a WoL packet)?
> Or, just "any activity" on the data lines to the i/f?
>
> It seems that power conditioning on the keyboard should be a good
> starting place (it's ALWAYS power-related!).
>
> It also seems like Windows only leaves USB ports powered up
> during sleep *if* they were active while the machine was awake (?). >

It appears to me that the device drives a 'K' state onto the data lines for between 1 and 15ms. The 'K' state is the opposite of the idle state.


It's not necessarily the keyboard's fault - unplugging it prevents it from waking the system up, if that's what it's doing, but it also means that it's not plugged in. It could be the latter fact that makes the spurious wake-ups go away.


You could try plugging something else into that port instead.


Also plugging the keyboard in via a separate usb hub.


The results may hint at what to look at next.


Sylvia.

plug it into a port that doesn't have standby power.

Other than posting INCOPMPLETE requirements on usenet what have you tried?

If I appear to be double posting, it's because some of my postings seem to be vanishing.

On my reading of the spec, it just swaps the data line levels for a period, and then swaps them back. I wouldn't expect any data transfer, because USB devices do not spontaneously send data, they respond only when polled.

I suspect it's going to come down to the voltage levels on the data+ and data- lines. Data+ should stay high (above 3V), and data- should stay low. Time to build that USB breakout box.

Sylvia.

Three thoughts:

(1) Does this keyboard have an integral touch-pad or joystick? If so, possibly some spurious touch or motion detection in the electronics there might cause the keyboard to send in a motion event when polled.

(2) I once had a problem with a Macintosh II which would spontaneously power up (not just come out of idle). This would happen in the mornings, not long after my wife and I got up and started our days. The chain of events turned out to be (cold house), (hot shower), (steam and moisture traveling down the hall and down into the den), (moisture condensing on the cold keyboard PC-board), (very slight current leak between ground and the ADB "power on!" button pads), (BONG!)

Cleaning the PC board in the area of the power-on key's pads, and then dabbing the traces with some clear nail polish, sealed the high-impedance area away from moisture and the problem went away.

Any chance you've had a fluid spill in the keyboard? Giving it a good flush-out with an electronics-compatible cleaner, a distilled water rinse, and a final rinse with isopropyl might eliminate the problem.

(3) Every time I've used a PC with a "wake up from sleep" capability, its BIOS let me set which sorts of events were and were not allowed to bring it out of hibernation. If you check your BIOS you may be able to disable the "wake up on keyboard/mouse activity" feature.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required