Communication timeouts since the last update of OctoPrint


#1

Hello,

since the last update of OctoPrint (v1.3.8), it have a lot of issues with communication and connection with my printer.
When I press the "Connect" button with the usual settings (serial port : /dev/ttyUSB0 and baudrate : 250000), I have a communication timeout :

serial.log
Connecting to: /dev/ttyUSB0
Changing monitoring state from "Offline" to "Opening serial port"
Connected to: Serial<id=0x6bc80bd0, open=True>(port='/dev/ttyUSB0', baudrate=250000, bytesize=8, parity='N', stopbits=1, timeout=10.0, xonxoff=False, rtscts=False, dsrdtr=False), starting monitor
Changing monitoring state from "Opening serial port" to "Connecting"
Send: N0 M110 N0*125
Recv: start
Recv: echo:Marlin 1.1.0-RC6
Send: N0 M110 N0*125
Recv: echo: Last Updated: 2016-04-24 12:00 | Author: Dagoma.Fr
Recv: Compiled: Sep 12 2016
Recv: echo: Free Memory: 3545  PlannerBufferBytes: 1232
Recv: echo:V23 stored settings retrieved (396 bytes)
Recv: echo:Steps per unit:
Recv: echo:  M92 X80.00 Y80.00 Z2560.00 E98.00
Recv: echo:Maximum feedrates (mm/s):
Recv: echo:  M203 X500.00 Y500.00 Z4.00 E25.00
Recv: echo:Maximum Acceleration (mm/s2):
Recv: echo:  M201 X9000 Y3000 Z100 E10000
Recv: echo:Accelerations: P=printing, R=retract and T=travel
Recv: echo:  M204 P3000.00 R3000.00 T3000.00
Recv: echo:Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum XY jerk (mm/s),  Z=maximum Z jerk (mm/s),  E=maximum E jerk (mm/s)
Recv: echo:  M205 S0.00 T0.00 B20000 X20.00 Z0.40 E5.00
Recv: echo:Home offset (mm):
Recv: echo:  M206 X0.00 Y0.00 Z0.00
Recv: echo:PID settings:
Recv: echo:  M301 P32.48 I6.40 D41.25 C100.00 L20
Recv: echo:Filament settings: Disabled
Recv: echo:  M200 D3.00
Recv: echo:  M200 D0
Recv: echo:Z-Probe Offset (mm):
Recv: echo:  M851 Z-1.00
Recv: echo:SD init fail
Recv: OK
There was a timeout while trying to connect to the printer
Changing monitoring state from "Connecting" to "Offline"
Connection closed, closing down monitor

I succeed in connecting by changing the serial port and baudrate settings by AUTO, and I have this in return :

serial.log
Changing monitoring state from "Offline" to "Detecting serial port"
Serial port list: ['/dev/ttyUSB0']
Connecting to: /dev/ttyUSB0
Changing monitoring state from "Detecting serial port" to "Opening serial port"
Connected to: Serial<id=0x6ba795f0, open=True>(port='/dev/ttyUSB0', baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=10.0, xonxoff=False, rtscts=False, dsrdtr=False), starting monitor
Starting baud rate detection
Changing monitoring state from "Opening serial port" to "Detecting baudrate"
Trying baudrate: 250000
Send: N0 M110 N0*125
Recv: start
Changing monitoring state from "Detecting baudrate" to "Operational"
Send: N1 M105*38
Recv: echo:Marlin 1.1.0-RC6
Recv: echo: Last Updated: 2016-04-24 12:00 | Author: Dagoma.Fr
Recv: Compiled: Sep 12 2016
Recv: echo: Free Memory: 3545  PlannerBufferBytes: 1232
Recv: echo:V23 stored settings retrieved (396 bytes)
Recv: echo:Steps per unit:
Recv: echo:  M92 X80.00 Y80.00 Z2560.00 E98.00
Recv: echo:Maximum feedrates (mm/s):
Recv: echo:  M203 X500.00 Y500.00 Z4.00 E25.00
Recv: echo:Maximum Acceleration (mm/s2):
Recv: echo:  M201 X9000 Y3000 Z100 E10000
Recv: echo:Accelerations: P=printing, R=retract and T=travel
Recv: echo:  M204 P3000.00 R3000.00 T3000.00
Recv: echo:Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum XY jerk (mm/s),  Z=maximum Z jerk (��6J[[iWI��\x16�K\x02\x02j%��\x02�\x1d&	\x13\x13$�0.00 B20000 X20.00 Z0.40 E5.00
Recv: echo:Home offset (mm):
Recv: echo:  M206 X0.00 Y0.00 Z0.00
Recv: echo:PID settings:
Recv: echo:  M301 P32.48 I6.40 D41.25 C100.00 L20
Recv: echo:Filament settings: Disabled
Recv: echo:  M200 D3.00
Recv: echo:  M200 D0
Recv: echo:Z-Probe Offset (mm):
Recv: echo:  M851 Z-1.00
Recv: echo:SD init fail
Recv: OK T:0.0 /0.0 @:0

Then I have a lot of

Communication timeout while idle, trying to trigger response from printer. Configure long running commands or increase communication timeout if that happens regularly on specific commands or long moves.

in the terminal tab.
I tried to set a temperature, but the temperature graph is not up-to-date and have a couple of minutes of latency. If I try to launch a printing job, my printer just don't do anything and stay still on my desk (poor printer!)
I tried to send commands directly in the terminal tab, but nothing was sent to the printer. After too many timeouts, they were disconnected.

My printer is alive, I launched a printing job by hand and everything was OK.

I have no clue of what's going on. Everything was great before the last update. :neutral_face:

Starring :

  • Octoprint v1.3.8 as "the software"
  • Octopi v0.14.0 as "the distro"
  • Raspberry Pi3 B as "the hardware"
  • Dagoma DiscoEasy200 as "the printer"
    Unfortunatly, David Hasselhoff wasn't free today...

#2

Sorry to say but your firmware is not adhering to the communication protocol. This should not be an uppercase OK, this should be a lower case ok and that is what's causing your issues here.

I just took a look into the source and OctoPrint hasn't been accepting upper case OKs since at least 2014, so I don't see how an update of OctoPrint could have caused this problem to surface. The only difference between 1.3.6 and 1.3.7/8 with regards to ok handling is that it will now also track when it received the last ok and trigger a timeout earlier, but I don't see how printing through OctoPrint would ever have been possible against this firmware considering that it would never have been allowed to send the next line due to the acknowledgement of prior sent lines is broken.

tldr: Firmware error. Ask your printer vendor to provide firmware that adheres to the agreed upon protocol.


#3

@foosel Thank you for your reply, I'm going to modify the firmware in order to have "ok" returned instead of "OK", and tell you what happened then.

I don't know how, but I succeeded in printing things with the same printer with OctoPrint. Everything was ok before last update, as mentioned in the title.

Thank you again foosel !

EDIT : After flashing the firmware of the printer and assuring myself the MSG_OK is really "ok" and not "OK", everything works just as expected ! Thank you for the hint !