Just been running a sketch in an UNO powered by the Pc, 5 meters away.
The UNO job is handling a stepper motor. Locally, near the UNO are 2 buttons ordering forward or backward of a stepper. That works fine.
Going back to the Pc in order to alter some parameters in the UNO the Pc has powered down, blackened the screen. Waking the Pc up, trying to send data from serial monitor, there's no contact with the UNO.
Closing the serial monitor, clicking on Port5 and clicking on serial monitor wakes the setup up.
Rather annoying...
How to make the Pc serve serial monitor and not power down?
The issue looks like being the Pc disregarding the living serial monitor and i's powering down.
I deliberately left out schematics and code. They have have been tested thoroughly, at short distance near the Pc, during a long time.
Check your power management settings on the PC. Sounds like it's gone to sleep, and shut down peripherals is often part of that procedure. There should be settings to keep peripherals alive, but you might just have to disable power management.
I'll have to dive into Windows and see what I can find. The cloose down was a surprice as the UNO sends status reports every some minutes. Clearly that's not enough to keep the Pc being present.
No, it generally isn't. Windows doesn't seem to care for general USB items, though the HID items (mice, keyboards) are usually an exception. I've fought this particular PITA before, in my old day job, where we had devices monitoring critical experiment data 24/7. You can't just bring on an extra tech every shift to walk around and keep the equipment awake, after all.
download and install a program called caffeine. It is a small program that will move your mouse 1 pixel every X minutes to keep the PC alive. I have found that much easier than messing with windows power settings.. I have used it in situations like this many times.
Really? Luckily mains failure is very rare here. Living in the city, all mains lines under ground.
If the mains fails the stepper motor has no power......
Scenario: old i7 notebook has OK battery; so, I set lid-closing to "do nothing" and sleep/hibernate to "never on AC." Brownout causes PC to switch to battery... but the power policy flips to "battery" and switching back to AC does not fully reset the battery "slept after" policy.
I can (should) dig into registry settings to hack. But, issue may be corrected at anytime by MS, or not: Windows-11 Pro 64-bit.
Anyway, the PC now is on a pure-sine wave 1200 Watt backup with new gelcells... same UPS handles cable modem, router, and access points.
I use the power down mode when ending the session. I estimat the previous laptop managed a week. This one I haven't checked the battery when starting up after some 15 hours of sleeping.
After posting this topic yesterday the rotating table jamed up. A locking screw needed to be tighten harder. Assembling the mechanics the hole for the stepper axis doesn't match the coupling to the table. Head scratching and investigation is needed....