BUG: Prevent Computer from Sleeping
Closed, ResolvedPublic

Description

We need to document the need to prevent the computer from sleeping while printing from USB. This can shut down communication over USB, and cause the print to halt.

karrad created this task.Apr 20 2018, 9:13 AM
karrad triaged this task as High priority.
karrad created this object with edit policy "Cura LulzBot Edition (Project)".

Great catch! this seems like an important one

T2011 for information on MAC power settings

Also would be good to recommend printing via SD on long prints

alexei removed glatti as the assignee of this task.Apr 20 2018, 4:01 PM
alexei added a subscriber: glatti.
Yahuba added a comment.May 4 2018, 6:18 PM

The best way to keep a mac awake and never go to sleep:
Apple menu > System Preferences, then click Energy Saver.
Then push both of the sliders (Computer Sleep & Display Sleep) all the way to the right to "Never".

Yesterday I left a print running on 3.2.20 on Debian Stretch. I returned to a completed print but Cura is unresponsive now. You can see in the log, P47, the last line:

2018-05-16 13:09:49,257 - DEBUG - [(140579888596736)-Thread-5] UM.Qt.QtApplication.preventComputerFromSleeping [563]: Prevent computer from sleeping? False
karrad reassigned this task from benmalouf to TKostennov.EditedMay 17 2018, 8:09 AM
karrad added subscribers: TKostennov, benmalouf.

@TKostennov Can you look into preventing this from sleeping?

@benmalouf We would still like to document and recommend disabling power saving settings as good practice. We will try to get it fixed before release, but don't want to rely on it.

karrad renamed this task from Prevent Computer from Sleeping to BUG: Prevent Computer from Sleeping.May 17 2018, 8:10 AM

@Orias Adding Claudio so we can make sure to get this into documentation.

Orias added a comment.May 17 2018, 9:28 AM

We can add this step in each OS-specific install guide.

TKostennov added a comment.EditedMay 18 2018, 5:27 AM

@karrad I'm not able to replicate this on dev version (on debian stretch). "Prevent computer from sleeping" works correctly. I will try to found why it may break.

@karrad Can somebody test it again, please?

@TKostennov We have been running 3.2.21 all last week, and 3.2.20 for about 2 weeks before that internally. We have not had any more reports on Debian of the issue.

@Yahuba Have you run into any issues with your win or mac testing stations?

karrad reassigned this task from TKostennov to Yahuba.Jun 12 2018, 8:58 AM

@karrad we had a print freeze on a Windows work station we set up for our staff to use for personal prints. One our staff members was able to successfully print a file twice but on his 3rd time printing the same file, the print froze. This was on a Windows 10 Pro (1803)
i7-4790 @ 3.60 GHz
RAM: 16 GB

I pulled the instance of this print from the log because the file was very large at this point.
This seems to be repeating at the end of the log over and over:
2018-06-08 18:36:15,712 - INFO - [(7560)-MainThread] USBPrinting.USBPrinterOutputDevice._log [53]: Error:checksum mismatch, Last Line: 841191
2018-06-08 18:36:15,729 - INFO - [(7560)-MainThread] USBPrinting.USBPrinterOutputDevice._log [53]: USBPrinterOutputDevice: Resending from: 841192
2018-06-08 18:36:34,222 - INFO - [(7560)-MainThread] USBPrinting.USBPrinterOutputDevice._log [53]: Error:checksum mismatch, Last Line: 842119
2018-06-08 18:36:34,238 - INFO - [(7560)-MainThread] USBPrinting.USBPrinterOutputDevice._log [53]: USBPrinterOutputDevice: Resending from: 842120

@Yahuba The checksums we made improvements to with USB communication which greatly reduced the occurance. The machine this is printing on has had all previous versions uninstalled, and cache cleared?

karrad removed Yahuba as the assignee of this task.Jul 12 2018, 7:09 AM
jebba added a subscriber: jebba.Oct 11 2018, 6:14 AM

I saw this on another workstation (dove) which is a Sytem76 Meerkat running Debian Stretch. Cura version 3.2.27. The system appears to disconnect USB when going to sleep:

syslog.3.gz:Oct 8 09:41:06 dove kernel: [372851.045809] usb 1-1: USB disconnect, device number 2
syslog.3.gz:Oct 8 09:41:06 dove kernel: [372851.046022] cdc_acm 1-1:1.0: failed to set dtr/rts
syslog.3.gz:Oct 8 09:41:06 dove ModemManager[350]: <info> (tty/ttyACM0): released by modem /sys/devices/pci0000:00/0000:00:14.0/usb1/1-1
syslog.3.gz:Oct 8 09:41:06 dove /usr/lib/gdm3/gdm-x-session[514]: 2018-10-08 09:41:06,735 - ERROR - [(140603472286976)-MainThread] USBPrinting.USBPrinterOutputDevice._log [53]: Unexpected error while accessing serial port. read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
syslog.3.gz:Oct 8 09:41:06 dove /usr/lib/gdm3/gdm-x-session[514]: 2018-10-08 09:41:06,742 - DEBUG - [(140601083700992)-Thread-30] UM.Qt.QtApplication.preventComputerFromSleeping [563]: Prevent computer from sleeping? False
syslog.3.gz:Oct 8 09:41:06 dove /usr/lib/gdm3/gdm-x-session[514]: 2018-10-08 09:41:06,781 - DEBUG - [(140603472286976)-MainThread] USBPrinting.USBPrinterOutputDevice._log [53]: Closing the USB printer connection.
syslog.3.gz:Oct 8 09:41:06 dove /usr/lib/gdm3/gdm-x-session[514]: 2018-10-08 09:41:06,972 - INFO - [(140603472286976)-MainThread] USBPrinting.USBPrinterOutputDevice._log [53]: Printer connection listen thread stopped for None

syslog.3.gz:Oct 8 09:41:10 dove /usr/lib/gdm3/gdm-x-session[514]: 2018-10-08 09:41:10,095 - DEBUG - [(140602789021440)-Thread-1] UM.Qt.QtApplication.preventComputerFromSleeping [563]: Prevent computer from sleeping? False
syslog.3.gz:Oct 8 09:41:10 dove /usr/lib/gdm3/gdm-x-session[514]: 2018-10-08 09:41:10,111 - DEBUG - [(140603472286976)-MainThread] USBPrinting.USBPrinterOutputDevice._log [53]: Closing the USB printer connection.
syslog.3.gz:Oct 8 09:41:15 dove /usr/lib/gdm3/gdm-x-session[514]: 2018-10-08 09:41:15,175 - WARNING - [(140602789021440)-Thread-1] UM.OutputDevice.OutputDeviceManager.removeOutputDevice [126]: Could not find output device with id Autodetect to remove
syslog.3.gz:Oct 8 09:41:20 dove /usr/lib/gdm3/gdm-x-session[514]: 2018-10-08 09:41:20,187 - WARNING - [(140602789021440)-Thread-1] UM.OutputDevice.OutputDeviceManager.removeOutputDevice [126]: Could not find output device with id Autodetect to remove

jebba added a comment.Oct 11 2018, 6:26 AM

Also note, the dove computer mentioned above I think is the same model as Steven's. I haven't seen this on other machines.

jebba added a comment.Oct 11 2018, 6:33 AM

On Debian, this command should work. I'll test it on dove:

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

https://wiki.debian.org/Suspend

karrad reopened this task as Open.Oct 11 2018, 1:15 PM

@jebba Thanks for finding and testing that, how did it go?

jebba added a subscriber: Grant.Oct 11 2018, 1:49 PM

It is on @Grant 's machine, I'll ask him to test.

karrad assigned this task to Orias.Oct 23 2018, 10:02 AM
Orias added a comment.Oct 30 2018, 8:02 AM
In T2397#43945, @Yahuba wrote:

The best way to keep a mac awake and never go to sleep:
Apple menu > System Preferences, then click Energy Saver.
Then push both of the sliders (Computer Sleep & Display Sleep) all the way to the right to "Never".

This has been added to the Mac install docs.

Orias lowered the priority of this task from High to Normal.Mon, Dec 3, 1:04 PM
Orias reassigned this task from Orias to karrad.

Has this been addressed with Cura 3.2.32?

T4356
Disabled "AppNap" feature on MacOS that would interrupt USB printing when Cura LE was minimized

@Orias Yes, this was fixed for 3.2.32. From out testing, it also fixes the need to disable screen saver on Mac OS as well.

karrad closed this task as Resolved.Tue, Dec 4, 10:23 AM