I mean, I know it's too late to help you, but running "powercfg.exe /lastwake" after a windows computer wakes from standby will tell you exactly what woke it up, if it knows.
I've never had it return with "unknown" once in over a decade, but some people I know have.
if you can find all the things waking the computer, and fix those things, it will never wake without user intervention.
usually, for me, it's been device drivers which have permission to wake the computer from sleep by default, for some stupid reason. removing that permission on those devices has eliminated "hot bag syndrome" for me entirely.
I agree that these steps should not need to be taken. device driver authors are the source of almost all bad crap like this in windows.
Haha I should have mentioned that one as a repeat offender. After the Surface wakes up, reboots, makes noise, gets hot, and drains 20% of its battery, if I then run "powercfg.exe /lastwake" it'll pretend that it did not wake up X_X
And in my case, there wasn't any non-Microsoft drivers on the system. The issue appears to be that they do magical stuff when they spot a WiFi connection, or when my WiFi router does its daily reboot.
>The issue appears to be that they do magical stuff when they spot a WiFi connection, or when my WiFi router does its daily reboot.
I think that might've been my issue that kept waking up my desktop. I tried disabling everything I could to stop wake ups - to make it only wake up on pressing the power button, but I never got it to work properly. The desktop would just seemingly randomly decide that it wants to wake up again. I eventually stopped trying to put computers to sleep - it's either shut down or it just stays running.
I have a $300 Ubiquiti Dream Machine and that thing CANT be scheduled to reboot. doesn't matter because Ethernet dies twice a day, and I need to use my phone to get to the admin page to restart the thing. most annoying and expensive router I've ever owned.
I DO NOT understand how all routers I have ever owned are total garbage, but they all have been.
A child comment stating its sensitivity to power dips may be the cause here. I don't have a UDM, but I do have a lot of Unifi equipment and the only issues I've ever had are an AP dropping clients and refusing to pick new ones up, and a switch latching onto a bad local route and refusing to let it go. Rebooting the devices fixed it in both cases.
By far, internet connectivity has never been better at my house. I've had various Netgear, D-Link, and Linksys devices. Unifi beats everything hands-down.
I think you were right. after reading your comment, and the other you mentioned, I ordered a small UPS that will shield my modem and router from transient power problems, and while it hasn't been a full day, yet, I haven't had to reboot anything since I installed that guy.
so far I am quite glad that I mentioned my problem here.
The only router I've had not give me any gruff is the Mikrotik stuff, hot damn is it hard to configure as its very advanced at times, but once its configured. it /never/ goes down
I got a MikroTik router just a few months ago and it does run great, has anything you could want under the sun, and it was even cheap! But like you said, it is very advanced, and as a network noob I probably spent 12 hours configuring it to do everything I wanted despite considering myself pretty tech savy, and don't even know exactly what I did to make it work as I wanted. Although if it is just a single router typical home setup most people could just use a default setup and make it work.
The community also seemed pretty elitist, I went through many forum posts about people with similar setup questions and/or problems as myself and fairly often they got simply berated when they didn't understand what a certain setting actually did or didn't understand exactly what people were having them input through a 30 item terminal command. The wiki has an example of just about everything once but even that was far from comprehensive when there are 20+ different options and you don't know what they mean and the example on the wiki picks just one of them and doesn't explain why they chose that one.
I don't regret the purchase at all, however I don't think I could feel safe in randomly recommending it to anybody except the most tech savy of my tech savy friends.
Some routers (and other electronics) are very sensitive to short spikes or drips in mains power. Having some heavy duty stuff such as heating cables or water heater or tumble dryer on the same circuit is enough. Get equipment to monitor it.
I've an external Webcam on wifi that occasionally loses its connection. I also have some basic home automation for lighting and a weather station, based on a Raspberry Pi running Node-RED.
The cam is pinged every 5 mins and if it doesn't respond, Node-RED power cycles a mains switch connected to it - and sends me an email! If the camera doesn't come back, the power is cycled up to a total of 5 times before I get a final email that says I need to take a look.
Put it behind a UPS and buy one of their smart plugs. It'll detect internet outages and reset the connected device automatically.
Also, I buy and deploy a lot of Unifi/ER equipment and that doesn't happen. I think you've noticed there's a common factor in your final statement, though.
it is a bit messed up that you think it's me. I change configs on these things only enough to get them to function, and then I leave them alone.
and what exactly could I be doing to cause random DNS failures, or to cause DHCP to fail only on Ethernet ports? these things can't be configured to do that. they're consumer-grade routers and consumer-grade routers are garbage. all of them.
every enterprise router or access point I administer at work functions just fine for years at a time.
I know it's just an anecdote, but I've always had issues buying(very expensive) home routers from netgear or Linksys, super unreliable devices no matter the price - finally gave up and just started using my ISP provided router(BT whatever hub, latest one) - zero issues. Rock solid WiFi and ethernet. I can see the uptime on it right now is over 100 days and I have no reason to restart it. Yes it's not quite as configurable as some of the other routers I've had but at least it just works.
Static devices (as opposed to DHCP reservations) will just (seemingly) randomly stop working with port forwarding, as the router just forgets the device. You can shake it out of that by pinging the device from the router's diag tools, or power cycling the router resolves the issue. Not great for CCTV DVRs/NVRs.
"Smart setup" sometimes breaks stuff, especially IoT stuff.
Your device may or may not just randomly factory reset itself. (I've had one do it twice in three years, to the point where I now save the config.)
It may or may not completely ruin your Sky Q system's reliability if you have more than one box (although I generally advocate wiring them in completely and disabling all wireless functionality anyway).
The automatic channel setting for the WiFi channels is a total dice roll.
The DNS interception rubbish breaks stuff. Most recent example was I was having infuriating issues with Ubiquiti's AP guest portal... Until I switched the BT Business Hub into a dumb modem and put a cheap ER-x in front. Rock solid since.
I'm glad you're pleased, although I know that's also a relative experience. I recently helped a colleague using Free[1] in France and was blown away by... pretty much all of it.
He was paying €15/mo for 4K television plus 1/0.6Gbit fiber internet on custom hardware they'd provided. I can't help but feel something went terribly wrong in the US for us to be happy with our $80/mo cable options and dated, generic hardware.
(Computer that's always on + $2 Wi-Fi dongle (or a slightly more expensive one with an actual antenna, if required) + network namespace-specific alternate route = scriptable scheduled reboot.
Weird, my udm pro goes months with no issues.. current uptime of most UniFi devices on my network is over 70 days right now. I’d say contact support because it shouldn’t so that, but their support isn’t great
Same here - My UDM Pro is over 90 days uptime, and that last reboot was only because I did an upgrade. I have heard of some people having problems, but mine has been flawless so far.
I've ordered a UPS and I guess I'll see if that's the issue.
I use a lot of fans in my house to circulate air, and when someone uses the microwave, half of the fans slow down, and half speed up significantly. no idea how half could speed up, but they do. so, something is up with something, somewhere.
Are you sure it went to sleep? I’ve had prior issues on a Surface and a 9310 where it appeared to sleep but didn’t. I found that out through Event Viewer.
I have NEVER in my life ever gotten a useful output from `powercfg.exe /lastwake`. I'm honestly surprised to hear someone mention it as working, I thought it was the sort of thing that was just copypasted on clickfarming tech-help blogs without any sort of verification that it actually works.
In fact I just tried it again on 4 computers and every one of them said "Wake History Count - 0".
note that it won't report reasons the machine was woken from hibernate, since hibernate isn't a sleep state.
also, run the command as an administrator. not just using an account that is an administrator. use an elevated cmd prompt or PowerShell window.
if you're doing all that, idk what's going on.
You can, however, see what devices are capable of waking your machine, and then disable them, by using the commands in my other comment: https://news.ycombinator.com/item?id=28647492
¯\_(ツ)_/¯ No hibernation, yes admin, yes elevated prompt, nada. Disabling devices has never worked for me either, again I'm legitimately surprised that these things have ever worked for anyone since it's never had any effect whenever I've tried it.
I wish that were true! I'd love to know how to do that one too since back in Windows 7 Foobar2k was able to wake my PC from sleep and play my music as an alarm, and this functionality has not worked for me since then.
For a device to be able to wake a Windows system, it has to be allowed both in the BIOS and also in Windows's device manager (In the "power management" tab on a device, the checkbox on "Allow this device to wake the computer" has to be set/unset). It is available only on certain classes of devices.
Also what you are referring to as an application's capability (Foobar...) to wake a computer (from sleep or hibernation only) it most probably has to do with setting an RTC (real-time clock) alarm and the computer being allowed to resume from such an event. Again this is also a setting which can be disabled in most BIOS configurations and yours probably is.
By the way, Windows' task scheduler exposes this option to everyone so you can set your computer to wake up and run some script and then sleep again (I used to do this all the time ages ago for night downloads, etc.)
So, there are a series of switches (in BIOS and in windows device manager) that all have to be set/unset, for a computer to resume from some event;
A new wake-up reason might get installed in the future. Instead I found some powershell code ages ago, created a `nap` function in my $profile, and set the option to not allow waking it from sleep:
# load assembly System.Windows.Forms which will be used
Add-Type -AssemblyName System.Windows.Forms
# set powerstate to suspend (sleep mode)
$PowerState = [System.Windows.Forms.PowerState]::Suspend;
# do not force putting Windows to sleep
$Force = $false;
# don't allow the computer to be woken by devices or tasks (e.g. windows updates)
$DisableWake = $true;
# do it! Set computer to sleep
[System.Windows.Forms.Application]::SetSuspendState($PowerState, $Force, $DisableWake) | Out-Null;
>>I mean, I know it's too late to help you, but running "powercfg.exe /lastwake" after a windows computer wakes from standby will tell you exactly what woke it up, if it knows.
I'm one of those people - my computer kept waking up in the middle of the night and that command would always just return "wake source: unknown" for me.
are there devices which are allowed to wake your computer?
powercfg -devicequery wake_armed
if anything shows up, disable those devices with this command:
powercfg -devicedisablewake "Device Name"
I quickly googled this but I don't expect a lot of people to know what to search for, so if you've already found this and tried it, then I really am out of ideas this time.
if you haven't tried this, try it, and I really hope it helps.
I got rid of that PC a year ago :P But trust me, I tried literally every trick in the book, including the one above. No devices had the capability to wake up the PC(yes, including the mouse and the keyboard), disabled all wake timers, disabled all networking(in fact unplugged the ethernet cable).....it would still wake up in the middle of the night. It was the most confusing thing I ever dealt with in computers.
It's possible auto wakeup was enabled in the BIOS, with the wake time set to the default of 00:00.
Alternatively, if it was a different time, perhaps *that* was the default, or maybe the value accidentally got changed.
Alternatively-alternatively, maybe the BIOS had a bug in it that somehow enabled auto wake without presenting an option. To tackle this, I would've reset the BIOS settings. (I once had an ADSL2+ modem that randomly started flaking out and not connecting correctly. Changed every accessible setting I could, no dice. Factory reset = instantly back to normal.)
Windows update is one of the things that don't show up with powercfg, as far as I can recall.
My desktop used to wake itself up all the time to update and in addition to hunting down all the devices, there was a scheduled task for Office updates that I had to disable. It would wake the computer up and then Windows updates would install because the computer was awake at the scheduled time, giving me the false impression that Windows update was causing the wake.
In 8-9 years of using Surface Pros, on the other hand, I have never had one that woke from sleep to install updates or cooked itself in a bag. They have been trouble-free for me and my favorite travel computer.
Really need to look into a BSD with Windows VM for my next desktop though.
Waking the machine is a use case but having things unexpectedly wake the machine is a failure of that use case.
And easily configurable is subjective. Sure most readers here can work through it but requiring use of the CLI is not "easy" for most people. Not to mention the discoverability of that feature in the first place.
The hardware and software making the decision to wake the device isn't necessarily privy to concepts like "user" or "intent"; At that layer, it's all just signals. Someone has to design the system to interpret what those signals/events are supposed to lead to (e.g. should connecting a cable to a closed laptop wake it up? What if the thing on the other end of that cable is a mouse, or a storage device, or a charger, or a docking station? What if I jiggle my Bluetooth mouse, causing it to re-establish its connection to the laptop's Bluetooth radio? Should other state be considered before making a decision?).
The fact that such a subsystem exists isn't an indication of malice or a subversion of your will. There will be bugs in such a system, but the system still needs to be there.
But all of those cases should be governed by a very simple overarching rule: If the laptop lid is closed, assume that it is in a closed bag with no cooling available to it.
Because that is the usecase that hibernate is for. It makes laptops convenient by allowing you to just close the lid, put it in a bag, go somewhere, take it out of the bag, and then open it and continue working. If you need to tell people that they need to shut down their computers properly before putting them into bags, you have just produced a vastly inferior product.
This is an area where Microsoft desperately needs a Chief-making-it-not-suck-Officer. Someone who can just take that surface laptop, notice that some idiot actually wrote that you are supposed to shut it down instead of hibernating to put it in a bag, and yell at people until the product is fixed. Because right now it's broken.
Except your rule isn't a rule at all, it's just you assuming everyone else has the same usage pattern as you (they don't).
Pre-covid I had many co-workers who would sit down, plug their laptop into the dock, and work the whole day without ever opening the lid.
I've also spent 15+ years with a laptop connected to my TV that never has the lid open, and I definitely expect it to wake up when I sit on the couch and wiggle the Bluetooth mouse.
There are all sorts of things a machine does without user input. It is simply not possible to have a user OK each and every design decision for a machine.
And running a configuration command is in fact you telling it what to do.
So the actual issue is open-systems vs walled-gardens in system design and how it surfaces in consumer products. The only thing Windows can do is force you to review each and every device driver on install for e.g. can wake machine. A non-starter for a consumer OS.
That depends entirely on what you consider insane. MacOS for example does so many things that I consider utterly batshit insane, but here we are. Lots of people love it. It's a given that a consumer operating system will do many, many things without direct user input.
I had this problem for months with my computer booting randomly some nights, waking me because of its loud fans. Turns out it was our dog pushing my desk chair so that the armrest bumped some key on the keyboard.
This stuff previously worked correctly on windows 7, I guess they saw things like spotty headphone jack detection, 100% CPU fan blasting while lid closed, etc. and thought it was a good idea to copy it.
I've never had it return with "unknown" once in over a decade, but some people I know have.
if you can find all the things waking the computer, and fix those things, it will never wake without user intervention.
usually, for me, it's been device drivers which have permission to wake the computer from sleep by default, for some stupid reason. removing that permission on those devices has eliminated "hot bag syndrome" for me entirely.
I agree that these steps should not need to be taken. device driver authors are the source of almost all bad crap like this in windows.