• Wake on USB event

    From Don Y@21:1/5 to All on Thu Jan 30 19:25:51 2025
    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 (?).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sylvia Else@21:1/5 to Don Y on Sat Feb 1 00:22:17 2025
    On 31-Jan-25 10:25 am, Don Y wrote:
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jasen Betts@21:1/5 to Don Y on Fri Jan 31 23:10:46 2025
    On 2025-01-31, Don Y <[email protected]d> wrote:
    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.

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


    --
    Jasen.
    🇺🇦 Слава Україні

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From john larkin@21:1/5 to [email protected] on Fri Jan 31 16:25:59 2025
    On Thu, 30 Jan 2025 19:25:51 -0700, Don Y
    <[email protected]d> wrote:

    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 (?).

    Do you have a cat?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Don Y@21:1/5 to Sylvia Else on Fri Jan 31 17:36:38 2025
    On 1/31/2025 9:22 AM, Sylvia Else wrote:
    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.

    Said another way, does the exchange contain "data" (a keystroke) or
    is it purely for notification?

    I.e., if the exchange *contained* a keystroke, then that would
    suggest that I should see spurious keystrokes during normal
    operation (?) -- which I don't.

    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.

    Yes. I rely on the keyboard to (eventually) wake the machine
    /when I want to/ (accessing the power button is tedious).

    You could try plugging something else into that port instead.

    I tried a different keyboard (same make/model -- all of my keyboards
    are intentionally the same make/model). This worked correctly.
    Note the offending keyboard ALSO worked correctly -- until recently.

    Also plugging the keyboard in via a separate usb hub.

    The results may hint at what to look at next.

    The *right* way to do it, of course, would be to actually
    look at the interface signals. But, that's not particularly
    convenient. (Note to self: build a USB breakout box)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Don Y@21:1/5 to Jasen Betts on Fri Jan 31 17:38:22 2025
    On 1/31/2025 4:10 PM, Jasen Betts wrote:
    *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.

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

    But then I wouldn't be able to use it to wake the workstation
    when desired.

    Note, this *was* working correctly. And, an identical keyboard
    plugged into the same physical port STILL works correctly.
    I.e., something has changed *in* the keyboard.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jasen Betts@21:1/5 to Don Y on Sat Feb 1 04:15:03 2025
    On 2025-02-01, Don Y <[email protected]d> wrote:
    On 1/31/2025 4:10 PM, Jasen Betts wrote:
    *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.

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

    But then I wouldn't be able to use it to wake the workstation
    when desired.

    Note, this *was* working correctly. And, an identical keyboard
    plugged into the same physical port STILL works correctly.
    I.e., something has changed *in* the keyboard.

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

    --
    Jasen.
    🇺🇦 Слава Україні

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sylvia Else@21:1/5 to Don Y on Sat Feb 1 16:22:21 2025
    On 01-Feb-25 8:36 am, Don Y wrote:
    On 1/31/2025 9:22 AM, Sylvia Else wrote:
    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.

    Said another way, does the exchange contain "data" (a keystroke) or
    is it purely for notification?

    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Don Y@21:1/5 to Sylvia Else on Sat Feb 1 04:25:26 2025
    On 2/1/2025 1:22 AM, Sylvia Else wrote:
    On 01-Feb-25 8:36 am, Don Y wrote:
    On 1/31/2025 9:22 AM, Sylvia Else wrote:
    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.

    Said another way, does the exchange contain "data" (a keystroke) or
    is it purely for notification?

    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.

    That is not contradictory to my observations.

    The keyboard doesn't seem to generate any "bogus" keystrokes (like a
    key being stuck). I have made a crude attempt at verifying this by
    creating a Notepad document with contents similar to:

    ..................
    ........X.........
    ..................

    and positioned the cursor just after the 'X' with the 'X' highlighted as "selected text"; the thinking being that any keystrokes will either cause
    the X to be replaced, deleted or "moved", depending on their nature.

    No change (with the good *or* bad keyboard).

    If things are as you suggest, then the keyboard may be *continuously* signalling for attention and Windows simply notes "no data" -- as if
    this was a "spurious interrupt".

    OTOH, if the PC was sleeping, it would be awakened to query the keyboard
    and would THEN discover "no data", as above. But, having been awakened,
    it would be foolish to return to sleep (imagine the sort of loop this
    could create).

    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.

    Yup. I wanted a theory to pursue rather than just poking around and
    hoping to stumble on something. I'll have a look at the power distribution *inside* the keyboard (as the working keyboard suggests what's coming
    from the PC is "nominal" -- at least in the case of the mouse, keyboard
    and other USB peripherals)

    Thanks!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dave Platt@21:1/5 to [email protected] on Sat Feb 1 17:12:20 2025
    In article <vnjqe8$3ojnb$[email protected]>,
    Don Y <[email protected]d> wrote:

    Note, this *was* working correctly. And, an identical keyboard
    plugged into the same physical port STILL works correctly.
    I.e., something has changed *in* the keyboard.

    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Don Y@21:1/5 to Dave Platt on Sat Feb 1 22:05:51 2025
    On 2/1/2025 6:12 PM, Dave Platt wrote:
    In article <vnjqe8$3ojnb$[email protected]>,
    Don Y <[email protected]d> wrote:

    Note, this *was* working correctly. And, an identical keyboard
    plugged into the same physical port STILL works correctly.
    I.e., something has changed *in* the keyboard.

    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.

    No. And, any sort of "action event" would also leave side-effects
    visible on the screen.

    E.g., it would "type" a letter/number/symbol into the Notepad
    document that I described elsewhere. Or, would move the text cursor.
    Or, the MOUSE cursor. Or, enable/disable caps/scroll/num -lock
    indicators. Or, invoke HELP (F1), Find Next (F3), time/date (F5),
    move to the beginning of the line (HOME), end of line (END), previous
    page (PGUP), next page (PGDN), etc.

    I.e., *most* keystrokes would leave visible evidence of their
    occurrence.

    AND, would occur while the machine was NOT sleeping, as well.

    So, any event either has to be something that has no visible
    consequences (e.g., a shift/control key spontaneously claiming
    to be active -- but, why not visible WHILE in normal use???)
    OR, as Sylvia suggested, just some spurious notification
    that serves to awaken the PC and, when *it* polls the keyboard,
    it sees "nothing to report".

    If it can so reliably awaken the machine EACH time it is commanded
    to sleep, then you would assume it would manifest while I was actively
    using the machine!

    [The "spurious notification" fits the bill; I would never notice if the keyboard was routinely saying "look at me!" -- if, when the PC
    actually "looked", it saw NOTHING! Just some extra bus activity...]

    (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!)

    The keyboards on my first two Compaqs would (over time) exhibit
    flakey behavior due to high impedance implementation. I would
    periodically disassemble the keyboards -- including removing the PCB
    behind the keys -- and wipe everything down with alcohol to
    restore reliable operation.

    These don't seem to have a similar problem (I have 6 or 7 of these
    in service, presently).

    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

    No. And, I don't smoke (smokers' keyboards are the pits!)

    it a good flush-out with an electronics-compatible cleaner,
    a distilled water rinse, and a final rinse with isopropyl
    might eliminate the problem.

    I periodically clean all of the keyboards as the keycaps inevitably
    collect the oils/dirt from fingers. Remove keycaps and soak in
    soapy water. Vacuum keyboard assembly (dust and crud that get
    "behind" the keycaps -- nothing can get *into* the keyboard as the
    keycaps cover the only points into the mechanisms). Wipe down with
    alcohol (soapy water would migrate into the keyboard but the alcohol
    will evaporate quickly).

    Keyboards end up looking "like new" :>

    (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.

    But I *want* the wake-on-USB feature. I just want it to work as
    intended; not as if invisible actors were at play!

    I leave my workstations on 24/7/365. I count on them "sleeping"
    when I turn my attention away from them (to other activities).
    Then, expect them to come back online quickly when I click mouse
    or press a key (MOVING the mouse doesn't seem to cause a wake event).

    It took me some time to notice this "problem" because I can never
    be sure when I've been "away" long enough for a machine to sleep.
    So, if it is awake when I return, I assume I've returned quicker
    than the sleep timer. If it's asleep, I figure I was "away"
    for longer.

    Sleeping is a costly event as all of memory has to be flushed
    out to disk. With 100MB/s disks, it takes a while to flush
    100+GB! (it's really annoying to find myself waiting for it
    to finish GOING to sleep before I can wake it back up! :< )

    [Some apps apparently disable this inactivity reporting. And,
    some apps have other timeouts -- e.g., I can have a TELNET
    session active and the machine can sleep but the session
    won't automatically close unless the machine has been asleep
    longer than the keepalive interval for the session]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)