Problem: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24

What is the problem? With a JGAurora A5s Nueva, I have released 3 different files and all three have failed in it, the same files with my other JGAurora in another Raspberry with the Octoprint too installed does not fail

What did you already try to solve it?

Logs

Changing monitoring state from "Operational" to "Starting"
Send: N0 M110 N0*125
Recv: ok
Changing monitoring state from "Starting" to "Printing"
Send: N1 G90*17
Recv: ok
Send: N2 M82*27
Recv: ok
Send: N3 M106 S0*100
Recv: ok
Send: N4 M140 S60*87
Recv: ok
Send: N5 M190 S60*91
Recv: ok
Send: N6 M104 S225 T0*34
Recv: ok
Send: N7 M109 S225 T0*46
Recv: T:225.2 E:0 W:8
Recv: T:225.3 E:0 W:7
Recv: T:225.1 E:0 W:6
Recv: T:225.1 E:0 W:5
Recv: T:225.0 E:0 W:4
Recv: T:225.1 E:0 W:3
Recv: T:225.1 E:0 W:2
Recv: T:225.2 E:0 W:1
Recv: T:225.3 E:0 W:0
Recv: ok
Send: N8 G28*27
Recv: ok
Send: N9 G1 Z0.2 F3000*18
Recv: ok
Recv: ok
Send: N10 G92 E0*118
Send: N11 G1 X160 E15 F600*102
Recv: ok
Recv: ok
Send: N12 G1 X180 F5000*57
Send: N13 T0*8
Recv: ok
Send: N14 G92 E0.0000*92
Recv: ok
Send: N15 G1 E-5.0000 F3000*42
Recv: ok
Send: N16 G1 Z0.240 F1000*42
Recv: echo:Active Extruder: 0
Recv: ok
Send: N17 G1 X52.970 Y84.300 F4800*115
Recv: ok
Recv: ok
Send: N18 G1 E0.0000 F3000*15
Send: N19 G92 E0.0000*81
Recv: ok
Send: N20 G1 X152.030 Y84.300 E5.3375 F1500*63
Recv: ok
Send: N21 G1 X152.500 Y84.770 E5.3733*95
Recv: ok
Send: N22 G1 X152.970 Y84.300 E5.4091*92
Recv: ok
Send: N23 G1 X252.030 Y84.300 E10.7466*104
Recv: ok
Send: N24 G1 X254.900 Y87.170 E10.9653*111
Recv: ok
Recv: ok
Recv: ok
Recv: ok
Send: N25 G1 X254.900 Y94.513 E11.3609*105
Send: N26 G1 X253.587 Y96.787 E11.5024*108
Send: N27 G1 X219.900 Y116.236 E13.5983*80
Send: N28 G1 X219.900 Y188.764 E17.5062*88
Recv: ok
Send: N29 G1 X253.587 Y208.213 E19.6021*80
Recv: ok
Recv: ok
Send: N30 G1 X254.900 Y210.487 E19.7436*93
Recv: ok
Send: N31 G1 X254.900 Y217.830 E20.1392*94
Send: N32 G1 X252.030 Y220.700 E20.3580*94
Recv: ok
Send: N33 M105*23
Recv: Error:checksum mismatch, Last Line:  checksum: 74
Recv: 23Resend: 24
Recv: ok
Send: N34 G1 X152.970 Y220.700 E25.6954*83
Recv: ok
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Send: N35 G1 X152.500 Y220.230 E25.7313*87
Recv: ok
Send: N36 G1 X152.030 Y220.700 E25.7671*85
Recv: ok
Send: N37 G1 X52.970 Y220.700 E31.1045*106
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N38 G1 X50.100 Y217.830 E31.3233*97
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N39 G1 X50.100 Y210.487 E31.7189*97
Recv: Error:No Line Number with checksum, Last Line: 23Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Send: N40 G1 X51.413 Y208.213 E31.8604*102
Recv: ok
Send: N41 G1 X85.100 Y188.764 E33.9563*102
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N42 G1 X85.100 Y116.236 E37.8642*101
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N43 G1 X51.413 Y96.787 E39.9601*84
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N44 G1 X50.100 Y94.513 E40.1016*94
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N45 G1 X50.100 Y87.170 E40.4972*82
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N46 G1 X52.970 Y84.300 E40.7159*88
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N47 G92 E0.0000*90
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N48 G1 E-5.0000 F3000*34
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N49 G1 X53.219 Y84.900 F4800*119
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N50 G1 E0.0000 F3000*3
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N51 G92 E0.0000*93
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N52 G1 X151.781 Y84.900 E5.3107 F1500*57
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N53 G1 X152.500 Y85.619 E5.3655*84
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N54 G1 X153.219 Y84.900 E5.4202*90
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N55 G1 X251.781 Y84.900 E10.7309*99
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N56 G1 X254.300 Y87.419 E10.9228*98
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N57 G1 X254.300 Y94.352 E11.2964*96
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N58 G1 X253.148 Y96.348 E11.4206*102
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N59 G1 X219.300 Y115.890 E13.5265*85
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N60 G1 X219.300 Y189.110 E17.4717*94
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N61 G1 X253.148 Y208.652 E19.5776*92
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N62 G1 X254.300 Y210.648 E19.7018*89
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N63 G1 X254.300 Y217.581 E20.0753*92
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N64 G1 X251.781 Y220.100 E20.2673*91
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N65 G1 X153.219 Y220.100 E25.5780*80
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N66 G1 X152.500 Y219.381 E25.6327*86
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N67 G1 X151.781 Y220.100 E25.6875*82
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N68 G1 X53.219 Y220.100 E30.9982*104
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N69 G1 X50.700 Y217.581 E31.1901*108
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N70 G1 X50.700 Y210.648 E31.5637*107
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N71 G1 X51.852 Y208.652 E31.6879*102
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N72 G1 X85.700 Y189.110 E33.7938*104
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N73 G1 X85.700 Y115.890 E37.7390*97
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N74 M105*20
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N75 G1 X51.852 Y96.348 E39.8449*80
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N76 G1 X50.700 Y94.352 E39.9690*84
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N77 G1 X50.700 Y87.419 E40.3426*84
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok

[...]

Send: N334 G1 X146.613 Y90.610 E146.5405*104
Changing monitoring state from "Printing" to "Cancelling"
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Send: N335 M108*47
Recv: ok
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N336 M84*25
Send: N337 M104 T0 S0*38
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N338 M140 S0*109
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Send: N339 M106 S0*110
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok
Changing monitoring state from "Cancelling" to "Operational"
Recv: Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24
Recv: ok

**Additional information about your setup ** ( OctoPrint : 1.3.11, OctoPi 0.16.0, JGAurora A5S, firmware, ...)

Ignore my previous post, just saw this:

If your printer is actually sending the resend request as shown there:

Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24

then your printer's firmware is buggy. This should be two lines, not one, and the Resend on its own line is crucial:

Error:Line Number is not Last Line Number+1, Last Line: 23
Resend: 24

The way the printer is sending it - without newlines - it is not recognizable as a resend request and hence OctoPrint can't react to it and doesnt even identify it as a resend request or anything it should handle in the first hand.

tldr: Firmware broken, needs to be fixed, not OctoPrint's fault.

Thank You very much, I will try to contact to the printer manufacturer, I will post the manufacturer solution and if he send me a new firmware to update the JGAurora A5s I will share it

In the meantime, I think this problem can be fixed with the simple plugin below if @foosel can help me turn one line into two lines :grin:

Edit: @foosel and @OutsourcedGuru did help so I have corrected the code below so it's all in one place.

(Modified from https://community.octoprint.org/t/octopi-not-reading-sd-card-or-print-progress-from-ender-3-solved/9821)

# coding=utf-8
from __future__ import absolute_import

def Fix_Bad_Resend(comm, line, *args, **kwargs):
    if "Error:Line Number is not Last Line Number+1" not in line:
        return line
    goodline = line.replace(".*Resend:","Resend:")
    return goodline

__plugin_name__ = "Fix Bad Resend"
__plugin_version__ = "1.0.0"
__plugin_description__ = "Fix Bad Resend in printer responses (add newline)"
__plugin_hooks__ = {
    "octoprint.comm.protocol.gcode.received": Fix_Bad_Resend
}

which should be named Fix_Bad_Resend.py and placed it in ~/.octoprint/plugins .

Actually that won't work since that hook only allows to return one line, at least according to the docs (which I'm fairly sure are correct).

You might be able to just reduce the whole line to the resend itself, I think that should work until the firmware is fixed, though it's suboptimal.

You need to swallow everything before that...

 goodline = line.replace(".*Resend:","Resend:")

Give it a try, you might be surprised.

From this:

Error:Line Number is not Last Line Number+1, Last Line: 23Resend: 24 

...to this:

Resend: 24 

I'm not going to argue with the documentation :crazy_face:

I can do that. I'll edit my post to incorporate his fix.

What would be nice is a cookiecutter version of these quick-and-simple sort of fixes. You just answer some prompts and it generates one of these sort of plugins.

That would probably be more work that doing one offs. What would be nice, however, is some kind of repository for them.

1 Like

@foosel I don't really have the luxury of easily moving upstream with Marlin because of nasty printrbot stuff on their forked version, without spending a lot of time (it will happen eventually). I did however manage to fix this problem, I started to have after a recent update of octoprint by following this link below
and recompiling from an old version of their firmware I had stashed away on another hard disk.

https://forum.repetier.com/discussion/6377/cant-connect-to-i3-mk2s-endless-loop-of-error-line-number-is-not-last-line-number-1-last-line-0

I don't blame you for not wanting to work around what was broke to begin with. I just thought this might be interesting to put here for others to read.

All I did was add "gcode_N = 0;" before the M110 command is performed and it seems to have connected now.

Anyway I was getting garbage like this before:

Send: N0 M110 N0*125
Recv: Error:Line Number is not Last Line Number+1, Last Line���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� "0
Recv: Resend: 1
Recv: ok
Send: N1 M115*39
Recv: FIRMWARE_NAME: Marlin V1 FIRMWARE_URL: https://github.com/omitted/Marlin/ PROTOCOL_VERSION: 1.0 MACHINE_TYPE: Printrbot Plus EXTRUDER_COUNT: 1 SERIAL_NUMBER: omitted

Anytime I tried to send anything to the printer it would just die and I would have to hit the boards reset.

Thanks for all the hard work you put into Octoprint.

1 Like

Hello again, I've been talking with the technical support of JGAurora for several days, and its official answer has been that after talking with their engineers and communicating the incidence with all the evidences provided by me, they are unable to solve the incident, so it seems that JGAurora A5S moment is not compatible with OctoPrint since they do not know how to solve the problem.

Hi @DavidMR

You may have a look at TH3D. They have JGAurora A5 firmware in development. Maybe the A5S comes too soon.