Renaud11232 / OctoPrint-Resource-Monitor

An OctoPrint plugin to view current CPU and RAM usage
MIT License
39 stars 9 forks source link

[BUG] Print Job Intermittently Paused Then Continues #37

Closed sarf2k4 closed 2 years ago

sarf2k4 commented 2 years ago

During print job, with a lot of g-code command that has to be sent to the printer, printer intermittently pauses a bit and then continues the print job. Leaving a small blob on where it pauses. This has been confirmed with after I removed a lot of other plugins I suspected of such problems but the issue still persists. Octoprint in safe mode didn't have any of this issues

Before this problem arise, I did update and upgrade command on my octopi to keep it updated

To Reproduce

  1. Enable this plugin with stock settings of 1 seconds interval (I think).
  2. Any gcode that has intricate or very minimal movement.

Expected behavior

This plugin shouldn't interfere or has higher priority than sending commands over serial

Version of OctoPrint-Resource-Monitor

0.3.6

Server configuration image image

OctoPrint logs with octoprint.plugins.resource_monitor set to DEBUG

I am not sure if this intermittent pauses will appear on the logs

sarf2k4 commented 2 years ago

@Renaud11232 , can you confirm your raspberry pi's kernel version as what has been investigated by @don-willingham at https://github.com/Renaud11232/OctoPrint-Resource-Monitor/issues/37#issuecomment-1269217941 as what you stated that you're unable to reproduce such issues https://github.com/Renaud11232/OctoPrint-Resource-Monitor/issues/37#issuecomment-1100877692

Renaud11232 commented 2 years ago

Hello,

Thanks for investigating this. I don't use a Raspberry Pi on my own 3D printer but an Orange Pi Zero running armbian (kernel 5.4.0-126) Unfortunately, I cannot check the kernel version of the RPi I used for testing anymore. However, if this actually turns out to be an issue with the kernel version, I won't be able to do anything to fix that. The best I can do is to stop calling the function that is affected by the kernel version changes. 2 people confirmed that the changes made on the dev branch (https://github.com/Renaud11232/OctoPrint-Resource-Monitor/archive/refs/heads/dev.zip) solved the issue. I'll try to release this in the near future.

The only side effect of this fix is that the speed of the network interface (100Mb/s, 1Gb/s, ...) won't be displayed anymore in Resource Monitor (by default). For the users that weren't affected by this issue and still want to have this information displayed, I'll add a configuration option that re-enables it.

I don't think I can do anything else.

Renaud11232 commented 2 years ago

Version 0.3.9 (released just now) contains the changes previously mentionned and should fix the pausing/freezing issue.

Thanks for your help with this issue

don-willingham commented 2 years ago

Thanks @Renaud11232 👍 The release works, and if I enable Display network interface speed, the freeze returns. Since I'm on wifi, I tried to add Network exceptions for "eth0", then "eth0 and lo", and finally "eth0, lo, and wlan0"; the pauses come back in all 3 cases. It didn't occur to me until today to try that. Unfortunately according to https://psutil.readthedocs.io/en/latest/, psutil.net_if_stats() provides: isup, duplex, speed, mtu, and flags. If the implementation of "speed" is this plugin cares about, but one of the others is causing the slow down, it might be worthwhile requesting the addition of an argument to specify what. It also enumerates all network interfaces, if this plugin could request for specific interfaces, based on the exception list; it might also avoid the pausing. (or submitting a PR or two to add that flexibility) Thoughts?

don-willingham commented 2 years ago

I now see the discussion in https://github.com/giampaolo/psutil/issues/2133 already. If the problem is in psutil._psutil_linux.net_if_duplex_speed, then asking only for duplex and speed isn't going to help.