Wake up Windows and the draw frame dies a horrible death

I’ve been having problems with my Processing sketch crashing. The IDE remains if its running via the IDE but draw window(s) disappear. If running as an exe crashes as well. I thought (still might be) some coding problem. The production version never crashed while I watched and played with it but coming back later and waking up the (Windows 10) monitor it would sometimes would be gone. (Not always and usually not but at least once a day.) This sketch is connected through a serial (USB) port to an Arduino and collecting and displaying HVAC data which only changes states minutes/hours apart. The graphical display is rudimentary and I only have the frame rate set at 15 frames a second which is overkill as it is. Another troubling thing was that the IDE didn’t give a reason for the crash. So I got a processor monitor to record when the process crashed and was surprised to see that when it crashed its when I wake up the windows monitor. (Shake the mouse and/or unlock the monitor.) In retrospect it occurs to me that this behavior (crashing) started happening with one of the recent Windows 10 updates. Anybody see this happening? I’m still not sure what’s going on but if windows wakeup (not wake up as in waking up the CPU but waking up access to Windows) is somehow killing the Processing frames I’m not sure why it’s not killing the Processing IDE or for that matter other running windows processing. Oh and to be clear I know that until I wake up the keyboard/monitor its working while the monitor is dark because I log all the HVAC data and that’s current until the moment I wake things up. Hope this makes sense. Thx.

If you strip everything except serial out of the application, does it still crash on wakeup? Might be a good first step to triage. Or even check with an empty application that does nothing – see if this wakeup crashing affects any exported Processing app on your system, no matter what.

if you want to LOG data the PC should never sleep:

also it is normal practice that the arduino just send data to USB ( at power ON/boot )
you could program a handshake, means you make the processing app
to ask the arduino for sending data
but only for low speed apps,
you talk about 15FPS, ( that is processing draw() takt )
but not about datalines / per sec and db rate of communication.

That’s a great suggestion. I’ll concurrently run some trivial sketches and see if they are nuked too.

Sorry I didn’t mean the computer goes to sleep. It is necessary to be kept always on. I meant that when I wake up the display. Yeah I initiate handshakes to establish the initial connection and then send heartbeat messages to make sure the connection is still contained. All the data is getting logged up until it (sometimes) dies when the display is wakes up. I’ve even sneak in with remotely via Chrome Remote Desktop and the same thing happens. (When it happens.) Thx.