Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems if try to print a file, just after print the previous one #1421

Closed
Escrich opened this issue Apr 8, 2024 · 30 comments
Closed

Problems if try to print a file, just after print the previous one #1421

Escrich opened this issue Apr 8, 2024 · 30 comments

Comments

@Escrich
Copy link

Escrich commented Apr 8, 2024

Dear all, first of all congratulations by create Pronterface, I'm using it from years ago, and I love it.

This time I have an old issue, happening at least on versions from last three years I bet, the problem arises when you print a common gcode, in my case always generated by Prusa slicer, and just, after finish the print, made from Pronterface, (I use Pronterface to avoid using the SD card), then, just if you finish to print a part, you simply load another file on Pronterface, and click on print button, instead to print, you only get a stream of text showing you error after error, in the last three years, my procedure is so simple, I simply click on disconnect, then in connect, again, ant this manoeuvre generates a reset on my Prusa original Mk3s printer, then you can print the same gcode that was "generating" errors, without any problem, but always you need to make a reset in between files, now I'm using latest Pronterface versión, but I can get same behaviour in both versions you could see in the attached pictures:

Imagen de WhatsApp 2024-04-08 a las 21 55 09_b1c091d3

Imagen de WhatsApp 2024-04-08 a las 21 54 40_212116f5

@rockstorm101
Copy link
Collaborator

Dear all, first of all congratulations by create Pronterface, I'm using it from years ago, and I love it.

Glad you like it, thanks a lot.

[...] just if you finish to print a part, you simply load another file on Pronterface, and click on print button, instead to print, you only get a stream of text showing you error after error [...]

Could you please paste some of those errors? Also, what's your OS?

@Escrich
Copy link
Author

Escrich commented Apr 15, 2024

Sorry, for the late answer, I found your message just now, OS is Windows 10, I was sending this gcode now:
20240415 Prusa MK3s Marca de centro_0.2mm_PETG_MK3S_1m.gcode.zip

Normal status printing the first file after reset or connect:
image

Status once printed:
Imagen de WhatsApp 2024-04-15 a las 20 56 00_9f94c48b

Behaviour once printed the first file, and trying to print the second once finished the first, simply after click on print button again:
image

The messages on Pronterface are scrolling, showing same kind of error, at end nothing happens, the heating don't start, and the printer still shows the text "Finished print!"

@DivingDuck
Copy link
Collaborator

Hi,
can you please check this version of Pronterface whether the problem still exist:
https://github.com/kliment/Printrun/actions/runs/8681026406
This is the latest development version.
Best regards,
DD

@DivingDuck
Copy link
Collaborator

I can confirm this error. During my test I was able to see this as well for Smoothieware and an old Marlin version for both printing direct with Printrun and via SD card. It looks like Pronterface do not clear the buffer when it finish or cancel a print.

I haven't a solution for now. @rockstorm101, any idea's?

@rockstorm101
Copy link
Collaborator

Hi, sorry for the delayed response, I'm abroad these months so I can't really test for myself with a physical printer. I'm not able to reproduce this at the moment. Those errors sound familiar though, see #1341. It's an error sent from the firmware, hence why it can't be reproduced with a mock-up printer I guess.

Could you go in verbose mode and check that the "M110 N-1" command is being sent and received ok when the print starts and finishes?

@DivingDuck
Copy link
Collaborator

Hi,
no problem. This was the issue I was searching for. I will look on this as soon I find a little bit time this week.

@DivingDuck
Copy link
Collaborator

DivingDuck commented Aug 31, 2024

Hi @Escrich,
sorry that it took so long for a follow up.
Today I had a little bit time for digging a bit deeper to this issue and I think I identified the problem.

The problem started with the implementation of a workaround for Prusa printers and their firmware update to version 3.12.2 where they changed a behavior that was common for all firmware manufacturer in the past. I don't want to repeat the story here, you can find the discussion here: #1341 and #1378.

Anyway, with this change we introduce a compatibility issue for other firmware manufacturer than Prusa and user of older firmware, that do not support the change. I revert this change for a test with two printers that runs Marlin 1.x and Smoothieware 1.x firmware and can then repeat prints without any problems.

I have one last question: Had your printer an older firmware version from before 3.12.x when you report this issue?

@rockstorm101,
I changed in printcore.py line 419 and 678 the actual behavior ..."M110 N-1... back to the old notation ..."N-1 M110"... for my test.
It looks like we now need to break with what we had tried to avoid all the time for not dealing with special behaviors for printer manufacturer and firmware versions. I must admit I'm not really a fan of this as we can not say or test what devices (in combination of board manufacturer and their firmware versions) in the wild are now affected and cannot repeat print jobs w/o resetting and reconnecting the printer first for a next print.
A minimal workaround could be that we add a additional global setting via setup where a user can set/change the behavior manually via the config file and set the old behavior back as default 😇. I guess we need to add this in the GUI via option menu as well if we don't want to push users to modify the config file manually.
Let me know what you think about this.

@rockstorm101
Copy link
Collaborator

I revert this change for a test with two printers that runs Marlin 1.x and Smoothieware 1.x firmware and can then repeat prints without any problems.

That's weird, at least for Marlin. According to (some) documentation [1] [2] the command M110 N-1 should work Ok on all firmwares unless I'm missing something. Marlin accepts the "backwards" option, say N-1 M110 but others don't, hence why the change in #1378.

On configurations which trigger errors, if you look at the logs:

  • Can you see the M110 N-1 command being sent at the begging of the print?
  • Is it sent at the end of the print?
  • Is it being sent "as is" plain M110 N-1? or with a checksum or something else?
  • Is the printer responding ok to this command? or is not being understood?
  • When you hit print again, is it being sent?
  • Errors begin right after the M110 command is sent? On first line of next print?

Ideas that come to mind rather than trying to split the behavior based on firmware:

  • Set the line number at the end of a print as if it was a "normal" print line:

    diff --git a/printrun/printcore.py b/printrun/printcore.py
    index f0f3da8..044da4a 100644
    --- a/printrun/printcore.py
    +++ b/printrun/printcore.py
    @@ -673,9 +673,9 @@ class printcore():
                 self.printing = False
                 self.clear = True
                 if not self.paused:
    +                self._send("M110 N-1", self.lineno, True)
                     self.queueindex = 0
                     self.lineno = 0
    -                self._send("M110 N-1")
     
         def _send(self, command, lineno = 0, calcchecksum = False):
             # Only add checksums if over serial (tcp does the flow control itself)
  • This might be silly but... If the problem is in fact that old firmware do not understand the "forward" notation of M110 command, could we try to use both notations one after the other? I.e.:

            if not self.paused:
                self.queueindex = 0
                self.lineno = 0
                self._send("M110", -1, True)
                self._send("M110 N-1")
    

As you see I would avoid customizing the code for particular firmwares as much as possible, but if we get to that, I agree that a GUI toggle/checkbox does sound like the way to go.

@DivingDuck
Copy link
Collaborator

Hi @rockstorm101,

yea, I saw this as well. I don't know if I remember correct, whether that was valid for older versions of Marlin too. I had vaguely in mind that there was a discussion long time ago for this topic like e.g. here: Smoothieware/Smoothieware#1228. I found several discussions about this topic and the attempt to change the behavior, but in the past it was common understanding not to change it because of not breaking older implementations.

  • Can you see the M110 N-1 command being sent at the begging of the print?
  • Is it sent at the end of the print?

yes it will be send for both

Actual second print attempt (with M110 N-1), not working:

Show log...
SENT: M110 N-1
RECV: ok
Print started at: 21:07:17
SENT: N0 G28*19
RECV: rs N34
SENT: N1 G0 Z10 S0*16
RECV: rs N34
SENT: N2 G90*18
RECV: rs N34
SENT: N3 G21*25
RECV: rs N34
SENT: N4 G1 F1000*75
RECV: rs N34
SENT: N5 G1 X122.4164 Y129.3071*37
RECV: rs N34
SENT: N6 G4 P0*107
RECV: rs N34
SENT: N7 G0 Z0 S0*39
RECV: rs N34
SENT: N8 G4 P0*101
RECV: rs N34
SENT: N9 G1 F1000.000000*104
RECV: rs N34
SENT: N10 G1 X173.5241 Y129.3071*16
RECV: rs N34
SENT: N11 G1 X173.5241 Y64.5357*40
RECV: rs N34
SENT: N12 G1 X169.0267 Y64.5357*33
RECV: rs N34
SENT: N13 G1 X169.0267 Y68.0069*39
RECV: rs N34
SENT: N14 G1 X126.9139 Y68.0069*42
RECV: rs N34
SENT: N15 G1 X126.9139 Y64.4663*47
RECV: rs N34
SENT: N16 G1 X122.4164 Y64.4663*45
RECV: rs N34
SENT: N17 G1 X122.4164 Y129.3071*22
RECV: rs N34
SENT: N18 G4 P0*84
RECV: rs N34
SENT: N19 G0 Z10 S0*41
RECV: rs N34
SENT: N20 G1 F1000*125
RECV: rs N34
SENT: N21 G1 X108.5735 Y112.7845*27
RECV: rs N34
SENT: N22 G4 P0*93
RECV: rs N34
SENT: N23 G0 Z0 S0*17
RECV: rs N34
SENT: N24 G4 P0*91
RECV: rs N34
SENT: N25 G1 F1000.000000*86
RECV: rs N34
SENT: N26 G1 X90.642 Y112.7845*24
RECV: rs N34
SENT: N27 G1 X90.642 Y95.1511*45
RECV: rs N34
SENT: N28 G1 X108.5735 Y95.1511*38
RECV: rs N34
SENT: N29 G1 X108.5735 Y112.7845*19
RECV: rs N34
SENT: N30 G0 Z10*97
RECV: rs N34
SENT: N31 G0 X5*86
RECV: rs N34
SENT: N32 G0 Y5*84
RECV: rs N34
SENT: N33 M84*47
RECV: rs N34
SENT: M110 N-1
RECV: ok
Print ended at: 21:07:17 and took 0:00:00
SENT: M117 Finished Print
RECV: ok
SENT: M105
RECV: ok T:22.3 /0.0 @0 T1:22.0 /0.0 @0 B:21.8 /0.0 @0 B1:21.3 /0.0 @0

Modified second print attempt (with N-1 M110), working:

Show log...
SENT: N-1 M110
RECV: ok
Print started at: 21:19:04
SENT: N0 G28*19
RECV: ok
SENT: M117 2.94% Est 0.00.43
RECV: ok
SENT: M105
RECV: ok T:22.8 /0.0 @0 T1:22.0 /0.0 @0 B:21.9 /0.0 @0 B1:21.4 /0.0 @0
SENT: N1 G0 Z10 S0*16
RECV: ok
SENT: N2 G90*18
RECV: ok
SENT: N3 G21*25
RECV: ok
SENT: N4 G1 F1000*75
RECV: ok
SENT: N5 G1 X122.4164 Y129.3071*37
RECV: ok
SENT: N6 G4 P0*107
RECV: ok
SENT: M105
RECV: ok T:22.8 /0.0 @0 T1:22.0 /0.0 @0 B:21.9 /0.0 @0 B1:21.4 /0.0 @0
SENT: M117 20.59% Est 0.00.35
RECV: ok
SENT: N7 G0 Z0 S0*39
RECV: ok
SENT: N8 G4 P0*101
RECV: ok
SENT: N9 G1 F1000.000000*104
RECV: ok
SENT: N10 G1 X173.5241 Y129.3071*16
RECV: ok
SENT: N11 G1 X173.5241 Y64.5357*40
RECV: ok
SENT: M105
RECV: ok T:22.8 /0.0 @0 T1:21.9 /0.0 @0 B:21.9 /0.0 @0 B1:21.4 /0.0 @0
SENT: N12 G1 X169.0267 Y64.5357*33
RECV: ok
SENT: N13 G1 X169.0267 Y68.0069*39
RECV: ok
SENT: M105
RECV: ok T:22.7 /0.0 @0 T1:21.9 /0.0 @0 B:21.9 /0.0 @0 B1:21.4 /0.0 @0
SENT: N14 G1 X126.9139 Y68.0069*42
RECV: ok
SENT: N15 G1 X126.9139 Y64.4663*47
RECV: ok
SENT: N16 G1 X122.4164 Y64.4663*45
RECV: ok
SENT: M117 50.0% Est 0.00.21
RECV: ok
SENT: M105
RECV: ok T:22.8 /0.0 @0 T1:22.0 /0.0 @0 B:22.0 /0.0 @0 B1:21.4 /0.0 @0
SENT: N17 G1 X122.4164 Y129.3071*22
RECV: ok
SENT: N18 G4 P0*84
RECV: ok
SENT: M105
RECV: ok T:22.7 /0.0 @0 T1:21.9 /0.0 @0 B:21.9 /0.0 @0 B1:21.4 /0.0 @0
SENT: N19 G0 Z10 S0*41
RECV: ok
SENT: N20 G1 F1000*125
RECV: ok
SENT: N21 G1 X108.5735 Y112.7845*27
RECV: ok
SENT: N22 G4 P0*93
RECV: ok
SENT: N23 G0 Z0 S0*17
RECV: ok
SENT: M105
RECV: ok T:22.8 /0.0 @0 T1:22.0 /0.0 @0 B:21.8 /0.0 @0 B1:21.3 /0.0 @0
SENT: N24 G4 P0*91
RECV: ok
SENT: N25 G1 F1000.000000*86
RECV: ok
SENT: N26 G1 X90.642 Y112.7845*24
RECV: ok
SENT: N27 G1 X90.642 Y95.1511*45
RECV: ok
SENT: N28 G1 X108.5735 Y95.1511*38
RECV: ok
SENT: M105
RECV: ok T:22.8 /0.0 @0 T1:21.9 /0.0 @0 B:21.9 /0.0 @0 B1:21.3 /0.0 @0
SENT: M117 85.29% Est 0.00.05
RECV: ok
SENT: N29 G1 X108.5735 Y112.7845*19
RECV: ok
SENT: N30 G0 Z10*97
RECV: ok
SENT: N31 G0 X5*86
RECV: ok
SENT: M105
RECV: ok T:22.8 /0.0 @0 T1:21.9 /0.0 @0 B:21.9 /0.0 @0 B1:21.3 /0.0 @0
SENT: N32 G0 Y5*84
RECV: ok
SENT: M105
RECV: ok T:22.8 /0.0 @0 T1:21.9 /0.0 @0 B:21.8 /0.0 @0 B1:21.4 /0.0 @0
SENT: N33 M84*47
RECV: ok
SENT: N-1 M110
Print ended at: 21:19:52 and took 0:00:47
RECV: ok
SENT: M117 Finished Print
RECV: ok
SENT: M105
RECV: ok T:22.8 /0.0 @0 T1:21.9 /0.0 @0 B:21.9 /0.0 @0 B1:21.4 /0.0 @0
  • Is it being sent "as is" plain M110 N-1? or with a checksum or something else?

Yes, it have checksum included

  • Is the printer responding ok to this command? or is not being understood?

No for actual behavior, Yes for modified behavior (see log snippets)

  • his might be silly but... If the problem is in fact that old firmware do not understand the "forward" notation of M110 command, could we try to use both notations one after the other? I.e.:

No, this is actual a great idea. I have tested this for Smoothieware and it works fine. 👍

Show log...
Connecting...
Printer is now online.
Using tool 0.
Loading file: C:\Users\Armin\Desktop\Hypercube Test\test.gcode
Loaded C:\Users\Armin\Desktop\Hypercube Test\test.gcode, 34 lines
0.00mm of filament used in this print
Using spool 'DevilDesign PET-G Black' (1158.36m of filament will remain)
The print goes:
- from 0.00 mm to 173.52 mm in X and is 173.52 mm wide
- from 0.00 mm to 129.31 mm in Y and is 129.31 mm deep
- from 0.00 mm to 10.00 mm in Z and is 10.00 mm high
Estimated duration: 1 layers, 0:00:45
SENT: M105
RECV: ok T:22.8 /0.0 @0 T1:21.9 /0.0 @0 B:22.0 /0.0 @0 B1:21.5 /0.0 @0
SENT: M110 N-1
SENT: N-1 M110
RECV: ok
RECV: ok
Print started at: 21:45:16
SENT: N0 G28*19
RECV: ok
SENT: M117 2.94% Est 0.00.43
RECV: ok
SENT: M105
RECV: ok T:22.8 /0.0 @0 T1:21.9 /0.0 @0 B:22.0 /0.0 @0 B1:21.4 /0.0 @0
SENT: N1 G0 Z10 S0*16
RECV: ok
SENT: N2 G90*18
RECV: ok
SENT: N3 G21*25
RECV: ok
SENT: N4 G1 F1000*75
RECV: ok
SENT: N5 G1 X122.4164 Y129.3071*37
RECV: ok
SENT: N6 G4 P0*107
RECV: ok
SENT: M105
RECV: ok T:22.8 /0.0 @0 T1:21.9 /0.0 @0 B:22.0 /0.0 @0 B1:21.5 /0.0 @0
SENT: M117 20.59% Est 0.00.35
RECV: ok
SENT: N7 G0 Z0 S0*39
RECV: ok
SENT: N8 G4 P0*101
RECV: ok
SENT: N9 G1 F1000.000000*104
RECV: ok
SENT: N10 G1 X173.5241 Y129.3071*16
RECV: ok
SENT: N11 G1 X173.5241 Y64.5357*40
RECV: ok
SENT: M105
RECV: ok T:22.8 /0.0 @0 T1:21.9 /0.0 @0 B:22.0 /0.0 @0 B1:21.4 /0.0 @0
SENT: N12 G1 X169.0267 Y64.5357*33
RECV: ok
SENT: N13 G1 X169.0267 Y68.0069*39
RECV: ok
SENT: N14 G1 X126.9139 Y68.0069*42
RECV: ok
SENT: N15 G1 X126.9139 Y64.4663*47
RECV: ok
SENT: M117 47.06% Est 0.00.22
RECV: ok
SENT: M105
RECV: ok T:22.9 /0.0 @0 T1:21.9 /0.0 @0 B:22.0 /0.0 @0 B1:21.5 /0.0 @0
SENT: N16 G1 X122.4164 Y64.4663*45
RECV: ok
SENT: N17 G1 X122.4164 Y129.3071*22
RECV: ok
SENT: N18 G4 P0*84
RECV: ok
SENT: M105
RECV: ok T:22.9 /0.0 @0 T1:21.9 /0.0 @0 B:22.0 /0.0 @0 B1:21.5 /0.0 @0
SENT: N19 G0 Z10 S0*41
RECV: ok
SENT: N20 G1 F1000*125
RECV: ok
SENT: N21 G1 X108.5735 Y112.7845*27
RECV: ok
SENT: N22 G4 P0*93
RECV: ok
SENT: M105
RECV: ok T:22.8 /0.0 @0 T1:21.9 /0.0 @0 B:22.0 /0.0 @0 B1:21.5 /0.0 @0
SENT: N23 G0 Z0 S0*17
RECV: ok
SENT: M105
RECV: ok T:22.9 /0.0 @0 T1:21.9 /0.0 @0 B:22.0 /0.0 @0 B1:21.5 /0.0 @0
SENT: N24 G4 P0*91
RECV: ok
SENT: N25 G1 F1000.000000*86
RECV: ok
SENT: N26 G1 X90.642 Y112.7845*24
RECV: ok
SENT: N27 G1 X90.642 Y95.1511*45
RECV: ok
SENT: N28 G1 X108.5735 Y95.1511*38
RECV: ok
SENT: M117 85.29% Est 0.00.05
RECV: ok
SENT: M105
RECV: ok T:22.8 /0.0 @0 T1:21.9 /0.0 @0 B:22.0 /0.0 @0 B1:21.4 /0.0 @0
SENT: N29 G1 X108.5735 Y112.7845*19
RECV: ok
SENT: N30 G0 Z10*97
RECV: ok
SENT: M105
RECV: ok T:22.9 /0.0 @0 T1:21.9 /0.0 @0 B:22.1 /0.0 @0 B1:21.4 /0.0 @0
SENT: N31 G0 X5*86
RECV: ok
SENT: M105
RECV: ok T:22.8 /0.0 @0 T1:22.0 /0.0 @0 B:22.0 /0.0 @0 B1:21.5 /0.0 @0
SENT: N32 G0 Y5*84
RECV: ok
SENT: N33 M84*47
RECV: ok
SENT: M110 N-1
SENT: N-1 M110
RECV: ok
RECV: ok
Print ended at: 21:46:04 and took 0:00:47
SENT: M117 Finished Print
RECV: ok
SENT: M105
RECV: ok T:22.9 /0.0 @0 T1:21.9 /0.0 @0 B:22.1 /0.0 @0 B1:21.5 /0.0 @0
SENT: M105
RECV: ok T:22.8 /0.0 @0 T1:21.9 /0.0 @0 B:22.0 /0.0 @0 B1:21.5 /0.0 @0
SENT: M105
RECV: ok T:22.9 /0.0 @0 T1:21.9 /0.0 @0 B:22.0 /0.0 @0 B1:21.5 /0.0 @0
SENT: M110 N-1
SENT: N-1 M110
RECV: ok
RECV: ok
Print started at: 21:46:11
SENT: N0 G28*19
RECV: ok
SENT: M117 2.94% Est 0.00.43
RECV: ok
SENT: M105
RECV: ok T:22.8 /0.0 @0 T1:21.9 /0.0 @0 B:22.0 /0.0 @0 B1:21.4 /0.0 @0
SENT: N1 G0 Z10 S0*16
RECV: ok
SENT: N2 G90*18
RECV: ok
SENT: N3 G21*25
RECV: ok
SENT: N4 G1 F1000*75
RECV: ok
SENT: N5 G1 X122.4164 Y129.3071*37
RECV: ok
SENT: N6 G4 P0*107
RECV: ok
SENT: M105
RECV: ok T:22.8 /0.0 @0 T1:22.0 /0.0 @0 B:22.0 /0.0 @0 B1:21.4 /0.0 @0
SENT: M117 20.59% Est 0.00.35
RECV: ok
SENT: N7 G0 Z0 S0*39
RECV: ok
SENT: N8 G4 P0*101
RECV: ok
SENT: N9 G1 F1000.000000*104
RECV: ok
SENT: N10 G1 X173.5241 Y129.3071*16
RECV: ok
SENT: N11 G1 X173.5241 Y64.5357*40
RECV: ok
SENT: M105
RECV: ok T:22.8 /0.0 @0 T1:22.0 /0.0 @0 B:22.0 /0.0 @0 B1:21.5 /0.0 @0
SENT: N12 G1 X169.0267 Y64.5357*33
RECV: ok
SENT: N13 G1 X169.0267 Y68.0069*39
RECV: ok
SENT: N14 G1 X126.9139 Y68.0069*42
RECV: ok
SENT: N15 G1 X126.9139 Y64.4663*47
RECV: ok
SENT: N16 G1 X122.4164 Y64.4663*45
RECV: ok
SENT: M117 50.0% Est 0.00.21
RECV: ok
SENT: M105
RECV: ok T:22.8 /0.0 @0 T1:21.9 /0.0 @0 B:22.0 /0.0 @0 B1:21.4 /0.0 @0
SENT: N17 G1 X122.4164 Y129.3071*22
RECV: ok
SENT: N18 G4 P0*84
RECV: ok
SENT: M105
RECV: ok T:22.8 /0.0 @0 T1:21.9 /0.0 @0 B:22.0 /0.0 @0 B1:21.5 /0.0 @0
SENT: N19 G0 Z10 S0*41
RECV: ok
SENT: N20 G1 F1000*125
RECV: ok
SENT: N21 G1 X108.5735 Y112.7845*27
RECV: ok
SENT: N22 G4 P0*93
RECV: ok
SENT: M105
RECV: ok T:22.8 /0.0 @0 T1:21.9 /0.0 @0 B:22.0 /0.0 @0 B1:21.5 /0.0 @0
SENT: N23 G0 Z0 S0*17
RECV: ok
SENT: N24 G4 P0*91
RECV: ok
SENT: N25 G1 F1000.000000*86
RECV: ok
SENT: N26 G1 X90.642 Y112.7845*24
RECV: ok
SENT: N27 G1 X90.642 Y95.1511*45
RECV: ok
SENT: N28 G1 X108.5735 Y95.1511*38
RECV: ok
SENT: M105
RECV: ok T:22.9 /0.0 @0 T1:22.0 /0.0 @0 B:22.0 /0.0 @0 B1:21.5 /0.0 @0
SENT: M117 85.29% Est 0.00.05
RECV: ok
SENT: N29 G1 X108.5735 Y112.7845*19
RECV: ok
SENT: N30 G0 Z10*97
RECV: ok
SENT: N31 G0 X5*86
RECV: ok
SENT: M105
RECV: ok T:22.8 /0.0 @0 T1:21.9 /0.0 @0 B:22.0 /0.0 @0 B1:21.5 /0.0 @0
SENT: N32 G0 Y5*84
RECV: ok
SENT: M105
RECV: ok T:22.9 /0.0 @0 T1:21.9 /0.0 @0 B:22.0 /0.0 @0 B1:21.4 /0.0 @0
SENT: N33 M84*47
RECV: ok
SENT: M110 N-1
SENT: N-1 M110
RECV: ok
RECV: ok
Print ended at: 21:46:59 and took 0:00:47
SENT: M117 Finished Print
RECV: ok
SENT: M105
RECV: ok T:22.9 /0.0 @0 T1:21.9 /0.0 @0 B:22.0 /0.0 @0 B1:21.5 /0.0 @0

I think we should implement this as that way it will not break older firmwares. I like to test this in addition with an old Marlin firmware implementation. That printer will come back tomorrow or the day after. I will push an update for this after the test if you are ok with the change.

@DivingDuck
Copy link
Collaborator

Hi,

I need a tester with a Prusa printer and firmware >=3.12.x. Other printer firmwares for testing are as well welcome.

Long story short, I found in my test an additional firmware from Marlin v1.0.0 that behave different to newer Marlin versions.So we have now 3 variants:

  • Prusa firmware >3.12.x wants M110 N-1 for resetting the gcode line number in the printer
  • Smoothieware wants N-1 M110
  • Old Marlin firmware 1.0.0 ... x wants N-1 M110 + line checksum

My solution for this is adding back the old behavior and combine this with the actual implemented Prusa modification:
self._send("M110 N-1", -1, True)
This ends in N-1 M110 N-1*125 and both, the old firmware from Marlin and for Smoothieware are happy with the gcode. Now I need one who can test this solution for the Pusa firmware.

Link for Pronterface test version in my repository:
Windows: https://github.com/DivingDuck/Printrun/actions/runs/10839165094
MacOS: https://github.com/DivingDuck/Printrun/actions/runs/10839165224

In addition here is a little gcode file for a quick test (area needed from homing position: x78 y70 z10 mm) that will run only a half minute and prints above the print bed (z=5 mm) w/o heating and extrusion:
https://github.com/DivingDuck/Printrun/blob/issue-1421/testfiles/quicktest.gcode

Best regards,
DD

@jumaka
Copy link

jumaka commented Oct 1, 2024

Hi,

I need a tester with a Prusa printer and firmware >=3.12.x. Other printer firmwares for testing are as well welcome.

Long story short, I found in my test an additional firmware from Marlin v1.0.0 that behave different to newer Marlin versions.So we have now 3 variants:

  • Prusa firmware >3.12.x wants M110 N-1 for resetting the gcode line number in the printer
  • Smoothieware wants N-1 M110
  • Old Marlin firmware 1.0.0 ... x wants N-1 M110 + line checksum

My solution for this is adding back the old behavior and combine this with the actual implemented Prusa modification: self._send("M110 N-1", -1, True) This ends in N-1 M110 N-1*125 and both, the old firmware from Marlin and for Smoothieware are happy with the gcode. Now I need one who can test this solution for the Pusa firmware.

Link for Pronterface test version in my repository: Windows: https://github.com/DivingDuck/Printrun/actions/runs/10839165094 MacOS: https://github.com/DivingDuck/Printrun/actions/runs/10839165224

In addition here is a little gcode file for a quick test (area needed from homing position: x78 y70 z10 mm) that will run only a half minute and prints above the print bed (z=5 mm) w/o heating and extrusion: https://github.com/DivingDuck/Printrun/blob/issue-1421/testfiles/quicktest.gcode

Best regards, DD

I agree with @DivingDuck I have an old Marlin based Velleman K8200, and the change has caused issues, particularly the lack of the checksum flag being set to True which means the M110 command now errors and gets stuck in an infinite loop unless the printer has been fully powered down between prints. self._send("M110 N-1", -1, True) works perfectly for my printer.

@rockstorm101
Copy link
Collaborator

So we have now 3 variants:

  1. Prusa firmware >3.12.x wants M110 N-1 for resetting the gcode line number in the printer
  2. Smoothieware wants N-1 M110
  3. Old Marlin firmware 1.0.0 ... x wants N-1 M110 + line checksum

Hi, sorry I was AFK past weeks, let me see if I get where we stand on this. Do I understand correctly that the solution below works well for variants 2 and 3 but we still need to test if it works on variant 1?

diff --git a/printrun/printcore.py b/printrun/printcore.py
index f0f3da8..042c94e 100644
--- a/printrun/printcore.py
+++ b/printrun/printcore.py
@@ -416,7 +416,7 @@ class printcore():
             return True
 
         self.clear = False
-        self._send("M110 N-1")
+        self._send("M110 N-1", -1, True)
 
         resuming = (startindex != 0)
         self.print_thread = threading.Thread(target = self._print,
@@ -675,7 +675,7 @@ class printcore():
             if not self.paused:
                 self.queueindex = 0
                 self.lineno = 0
-                self._send("M110 N-1")
+                self._send("M110 N-1", -1, True)
 
     def _send(self, command, lineno = 0, calcchecksum = False):
         # Only add checksums if over serial (tcp does the flow control itself)

@DivingDuck
Copy link
Collaborator

DivingDuck commented Oct 5, 2024

Hi @rockstorm101,
welcome back and you are well 🙂
Yes, all what is missing so fare is a test with a Prusa printer and firmware >3.12.x which I don't own.

A test for Klipper and Reprap would be nice too. I don't expect problems there but a test would be a benefit. That's why I build and link the test version in my repository before pushing it here.

Edit: Test for Marlin 2.x is also a good idea, just in case...

@jumaka
Copy link

jumaka commented Oct 5, 2024 via email

@rockstorm101
Copy link
Collaborator

Dear @dMAC95, long story short, the change we introduced in #1378 did not play nice with older firmwares and has brought up issues like this one. Error occurs when trying to print one print right after another. So we would need someone who uses Prusa's firmware to test this change. Could you give us a hand here? Thanks in advance

@rockstorm101
Copy link
Collaborator

Why is this only call that has been introduced that does not pass True and let _send sort this out.

The issue was some firmware did not accept N-1 M110 instead of M110 N-1. Adding checksums also adds the N## bit before the command and therefore it was considered problematic and the checksum was removed.

@dMAC95
Copy link
Contributor

dMAC95 commented Oct 6, 2024

@rockstorm101 I'll see what I can do, might take a day or two.

@DivingDuck
Copy link
Collaborator

@DivingDuck
Copy link
Collaborator

@dMAC95,
had you a chance to test the changes I made? I really would appreciate a test with a Prusa machine before we merge the PR.

You can use one of the Pronterface artifacts above and "print" this file for a quick test:
https://github.com/DivingDuck/Printrun/blob/issue-1421/testfiles/quicktest.gcode.
The test should took only a minute or two for repeating the test print in the air w/o consuming any filament.

Best regards,
DD

@dMAC95
Copy link
Contributor

dMAC95 commented Oct 14, 2024

@DivingDuck apologies, work has been busy. I'll do it tomorrow and report back

@dMAC95
Copy link
Contributor

dMAC95 commented Oct 15, 2024

Everything passed on my end using the provided test file. I attached the printer output as presented in the GUI. Didn't see any concerning / related output from the terminal. Apologies again for the delay. I meant to last week but it slipped my mind & was busy.
print_log.txt

@dMAC95
Copy link
Contributor

dMAC95 commented Oct 15, 2024

Edit: I see the original issue arose with firmware 3.12 - I'll upgrade the printer firmware to 3.12 and test with that. Also will test with the most recent firmware version.

The attachment doesn't seem to be working, not sure if github takes a moment to finish processing it, but I'll paste it here:

Loading file: /home/drew/Downloads/quicktest.gcode
Loaded /home/drew/Downloads/quicktest.gcode, 40 lines
0.00mm of filament used in this print
The print goes:
- from 0.00 mm to 78.00 mm in X and is 78.00 mm wide
- from 0.00 mm to 70.00 mm in Y and is 70.00 mm deep
- from 0.00 mm to 10.00 mm in Z and is 10.00 mm high
Estimated duration: 1 layers, 0:00:22
Loading file: /home/drew/Downloads/quicktest.gcode
Loaded /home/drew/Downloads/quicktest.gcode, 40 lines
0.00mm of filament used in this print
The print goes:
- from 0.00 mm to 78.00 mm in X and is 78.00 mm wide
- from 0.00 mm to 70.00 mm in Y and is 70.00 mm deep
- from 0.00 mm to 10.00 mm in Z and is 10.00 mm high
Estimated duration: 1 layers, 0:00:22
Connecting...
start
Printer is now online.
echo: 3.11.0-4955
echo: Last Updated: Apr  7 2022 11:09:51 | Author: (none, default config)
Compiled: Apr  7 2022
echo: Free Memory: 2066  PlannerBufferBytes: 1760
echo:Stored settings retrieved
adc_init
Command not found!
Extruder fan type:
NOCTUA
CrashDetect ENABLED!
FSensor ENABLED (sensor board revision: 0.4 or newer)
echo:SD init fail
LCD status changed
Print started at: 08:30:06
tmc2130_home_enter(axes_mask=0x04)
tmc2130_home_exit tmc2130_sg_homing_axes_mask=0x04
tmc2130_home_enter(axes_mask=0x01)
  0 step=61 mscnt= 988
tmc2130_goto_step 0 29 2 1000
tmc2130_home_exit tmc2130_sg_homing_axes_mask=0x01
tmc2130_home_enter(axes_mask=0x02)
  0 step= 2 mscnt=  33
tmc2130_goto_step 1 49 2 1000
tmc2130_home_exit tmc2130_sg_homing_axes_mask=0x02
MMU not responding - DISABLED
LCD status changed
Print ended at: 08:31:00 and took 0:00:54
Print started at: 08:31:44
tmc2130_home_enter(axes_mask=0x01)
  0 step=61 mscnt= 991
tmc2130_goto_step 0 29 2 1000
tmc2130_home_exit tmc2130_sg_homing_axes_mask=0x01
tmc2130_home_enter(axes_mask=0x02)
  0 step=17 mscnt= 287
tmc2130_goto_step 1 49 2 1000
tmc2130_home_exit tmc2130_sg_homing_axes_mask=0x02
LCD status changed
Print ended at: 08:32:28 and took 0:00:44

Let me know if I should run further testing or anything additional to this. I'm running older Prusa firmware 3.11 due to issues in 3.12+

@DivingDuck
Copy link
Collaborator

Thank you very much for taking the time, @dMAC95. I do very much appreciate this.
One open question (just to be sure on this part as well), did you repeat the print after finishing the first print as well?

@dMAC95
Copy link
Contributor

dMAC95 commented Oct 15, 2024

Figured out all the testing I've done was through the pip package printrun instead of the downloaded repository printrun, so none of my tests were affecting anything (used requirements.txt command for package install)

Fixed test environment, uninstalled printrun package and working from printrun pull #1454

Recreated original error with firmware 3.12.2: (Changed M110 line strings to "N-1 M110")

  • Print 1: initial log line of "Error:Line Number is not Last Line Number+1, Last Line: -1", successful print
  • Print 2: no print action, runs through entire gcode file with output of "Line Number" error for each gcode line

Printing with restored printrun fix on 3.12.2:

  • Print 1: worked
  • Print 2: worked
  • Print 3: worked

Test with most recent Prusa firmware version 3.14.0:

  • Print 1: worked
  • Print 2: worked
  • Print 3: worked

Only modified self.loud and logging against original pull

Testing conducted on Prusa MK3S+

printcore.log
Logs using rotating handler got cutoff, unsure why - start at 3.12.2 within second error print test

@DivingDuck
Copy link
Collaborator

This looks good. I guess we can merge the change.

Again, thank you very much for your help
🙂

@dMAC95
Copy link
Contributor

dMAC95 commented Oct 15, 2024

Everything checks out on my end, if you need more Prusa testing feel free to give me a shout 👍

@dMAC95
Copy link
Contributor

dMAC95 commented Oct 15, 2024

I have an MK4 and XL available for testing as well.

@DivingDuck
Copy link
Collaborator

This is very kind. I do not expect a problem, but a quick test on those printer would be nice too 😇

@dMAC95
Copy link
Contributor

dMAC95 commented Oct 15, 2024

This is very kind. I do not expect a problem, but a quick test on those printer would be nice too 😇

Sorry, I do have to get to work now, but if you need the testing for those printers I can find time again this weekend

@DivingDuck
Copy link
Collaborator

No problem, this is life. Thank you for taking the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants