kliment / Printrun

Pronterface, Pronsole, and Printcore - Pure Python 3d printing host software
GNU General Public License v3.0
2.36k stars 995 forks source link

Pronterface GUI becomes unresponsive while printing, need to kill the app #1302

Closed hroncok closed 1 year ago

hroncok commented 1 year ago

Hey folks. I've finally dusted off my Lulzbot Mini and decided to use the Fedora-packaged Pronterface on Fedora 37 (2.0.0rc8 with #1224 and #1262, Python 3.11.1, wxpython 4.2.0, pyserial 3.5, Xfce and hence X11 and not Wayland).

Pronterface allows me to connect to the printer, manually control it and start the print. After several minutes of printing, while working on other stuff when the Pronterface window is not visible on my desktop when I switch back, the GUI is unresponsive -- in fact, the window is "empty" (it keeps the content of whatever was on the screen before I switched to it). The print however goes on. When the print is finished, the app remains unresponsive.

The terminal I used to start the Pronterface is riddled with Attempted to write invalid text to console, which could be due to an invalid baudrate (but my baudrate is OK).

Considering this is printed on any exception, I suspect something is happening there:

https://github.com/kliment/Printrun/blob/8fd9b8b6dab86ee0c238016f9a0ed7b0c5abea73/printrun/pronterface.py#L778-L779

I will log the actual exception and see if I debug this further. I have a strong suspicion this will turn out to be yet another float/int issue.

My cat looking at the ongoing print (not really relevant) ![_](https://user-images.githubusercontent.com/2401856/214805738-6d70cee2-4103-4fd7-8765-d0e1039c3b44.jpg)
hroncok commented 1 year ago

As expected:

Traceback (most recent call last):
  File "/usr/lib64/python3.11/site-packages/printrun/pronterface.py", line 763, in addtexttolog
    self.logbox.Remove(0, current_length / 10)
TypeError: TextEntry.Remove(): argument 2 has unexpected type 'float'
DivingDuck commented 1 year ago

Interesting, I don't see it for Python 3.10 on windows. I plan to switch to Python 3.11, so I should better look for it too.

hroncok commented 1 year ago

The console needs to be visible and the number of lines (?) already printed must be > 20000.

My Luzbot Mini spams the console with messages like:

ok N16224 P0 B3

...a lot.

I don't think this happens often.