confused smileyOctoprint | firmware buffer overflow problem?
August 12, 2020 06:15PM
Hello,

I recently finished creating my I3-RS. I am very satisfied with it. (maker fr I3-RS).

Being an automation / home automation fan, I wanted to integrate an RPI (Model B Rev 2) with octoprint into my printer.

All of my prints going through SD / USB drives worked perfectly fine. However, by going through octoprint, it prints well, until at some point (randommoody smiley: Because never the same layer) the printer starts to jerk, then stops dead.

I went to see the octoprint terminal which is the following:

Send: N47700 G1 X117.444 Y105.35 E776.61995*83
Recv: Error:Line Number is not Last Line Number+1, Last Line: 47699
Recv: Resend: 47700
Recv: ok
Send: N47700 G1 X117.444 Y105.35 E776.61995*83
Recv: Error:Line Number is not Last Line Number+1, Last Line: 47699
Recv: Resend: 47700
Recv: ok
Send: N47700 G1 X117.444 Y105.35 E776.61995*83
Recv: Error:Line Number is not Last Line Number+1, Last Line: 47699
Recv: Resend: 47700
Recv: ok
Send: N47700 G1 X117.444 Y105.35 E776.61995*83
Recv: Error:Line Number is not Last Line Number+1, Last Line: 47699
Recv: Resend: 47700
Printer keeps requesting line 47700 again and again, communication stuck
Changing monitoring state from "Printing" to "Error: Printer keeps requesting line 47700 again and again, communication stuck"
Send: M112
Send: N47701 M112*36
Send: N47702 M104 T0 S0*39
Send: N47703 M140 S0*98
Changing monitoring state from "Error: Printer keeps requesting line 47700 again and again, communication stuck" to "Offline (Error: Printer keeps requesting line 47700 again and again, communication stuck)"
Connection closed, closing down monitor

It can be seen that the printer is not receiving the 47700 line and create a loopback. (It never hangs on the same line but here I will continue to talk about this line).

I did a little research on the net and found a python plugin that I added in the plugin folder of my RPI.

The plugin is as follows:

# 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
}

It comes from this topic on the octoprint forum: octoprint topic

I checked that it was in my list of plugins on my dashboard and relaunched a print .... unfortunately, the problem persists.sad smileyangry smiley

So I continued my research and found that someone had changed the buffer size in the "Configuration_adv.h" file for the marlin serial link.

 #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller
#else
  #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
#endif

// @section serial

// The ASCII buffer for serial input
#define MAX_CMD_SIZE 96
#define BUFSIZE 4

... became ... :

  //before 32->16
  #define BLOCK_BUFFER_SIZE 32 // SD,LCD,Buttons take more memory, block buffer needs to be smaller
#else
  //before 32->16
  #define BLOCK_BUFFER_SIZE 32 // maximize block buffer
#endif

// @section serial

// The ASCII buffer for serial input
#define MAX_CMD_SIZE 96
//before 32 -> 4
#define BUFSIZE 32

Unfortunately, again without success.

So I come here to find out if anyone has the solution to my problem or a lead that allowed me to move forward.

thank you in advancethumbs upsmileys with beer
Re: confused smileyOctoprint | firmware buffer overflow problem?
August 14, 2020 04:11AM
I run a RPI 3 on repetier server,maybe try that.
Sorry, only registered users may post in this forum.

Click here to login