Octoprint Printer Communication

What is the problem?
I’m not sure.
I’ve had this happen a couple of times, but basically I’ll start a print and a couple of hours in, I’ll notice that the print is still progressing, and heating. The console is still running, so the printer is connected, but I’ve got no temp readings (current or target).

I’ve noticed sometime after, it seems like the online server shuts down. The print finishes completely without any problems, but I can no longer connect to octopi.local at all.

What did you already try to solve it?
Honestly not a whole lot. I’m relatively new to pi, octoprint, etc. and my knowledge on these types of things are limited.
I was using this setup without these issues for at least a few prints, but I added a handful of plugins and got a sleep notification message when booting up. I haven’t seen this message again, so maybe a sleep setting go reverted? But I’m not sure where to go for this.


Additional information about your setup
OctoPi 3B+ (I'm pretty sure), Snapmaker 2.0 A350 (default firmware), chrome/firefox browsers, most recent OctoPrint, not sure on OctoPi.

You might try reading the log. It says many things.

Final error:

2020-01-23 10:10:13,763 - tornado.application - ERROR - Uncaught exception GET /downloads/logs/octoprint.log (::ffff:
Traceback (most recent call last):
  File "/home/pi/oprint/local/lib/python2.7/site-packages/tornado/web.py", line 1512, in _execute
    result = yield result
  File "/home/pi/oprint/local/lib/python2.7/site-packages/tornado/gen.py", line 1055, in run
    value = future.result()
  File "/home/pi/oprint/local/lib/python2.7/site-packages/tornado/concurrent.py", line 238, in result
  File "/home/pi/oprint/local/lib/python2.7/site-packages/tornado/gen.py", line 1069, in run
    yielded = self.gen.send(value)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/tornado/web.py", line 2422, in get
    yield self.flush()
  File "/home/pi/oprint/local/lib/python2.7/site-packages/tornado/web.py", line 953, in flush
    return self.request.connection.write(chunk, callback=callback)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/tornado/http1connection.py", line 437, in write
    self._pending_write = self.stream.write(self._format_chunk(chunk))
  File "/home/pi/oprint/local/lib/python2.7/site-packages/tornado/http1connection.py", line 412, in _format_chunk
    "Tried to write more data than Content-Length")
HTTPOutputError: Tried to write more data than Content-Length
2020-01-23 10:10:13,765 - tornado.general - ERROR - Cannot send error response after headers written

This could have been attempting to download the octoprint.log perhaps. You have several plugins which could be causing the trouble. Try Safe Mode to compare.

Problem with bettergrblsupport:

2020-01-23 09:48:36,476 - octoprint.plugin - ERROR - Error while calling plugin bettergrblsupport
Traceback (most recent call last):
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/plugin/__init__.py", line 219, in call_plugin
    result = getattr(plugin, method)(*args, **kwargs)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_bettergrblsupport/__init__.py", line 241, in on_after_startup
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_bettergrblsupport/__init__.py", line 282, in deSerializeGrblSettings
    self.grblSettings.update({int(set[0]): [set[1], self.grblSettingsNames.get(int(set[0]))]})
IndexError: list index out of range

You've disabled the Printer Safety Check.

Looks like one of the plugins is causing this:

2020-01-23 09:48:20,817 - py.warnings - WARNING - /home/pi/oprint/local/lib/python2.7/site-packages/octoprint/util/__init__.py:658: UnicodeWarning: Unicode unequal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
  if value_source != value_target:

You have many, many plugins installed. If you're having difficulties printing then it's time to disable all of the add-on plugins and only add them back in when you know they're not causing you problems.

1 Like

Hey OG - thanks for the response.

I had glanced at it, but as I admitted my knowledge here is really limited, so what I'm looking for is a needle in the haystack idea.

I have disabled printer safety check, to my own risk.

I think your point might be fair, I can give this a shot. Probably disable all of the addons that aren't the core package, and try one print at a time with them installed. The problem I have with that is these problems were relatively intermittent, so the trial and error process could be a couple weeks, if not longer, but I'll see what it reveals!

As for the problems I have, and the plugin solution, do these type of issues sound familiar with this type of cause? I would think if it was plugins contradicting it would be more error/crashing (stopping print). But with the print finishing without any problems, and it just being a sensor and wifi (seems to be?) issue, that would be interested if so.

Hey @OutsourcedGuru -

So I disabled quite a bit of plugins (admittedly not all, in an attempt to shorten the troubleshooting time, cut down by half each time). Regardless, it looks like it happened again where it disconnected the server.

2020-01-23 21:49:47,442 - octoprint.server.util.sockjs - INFO - New connection from client: ::ffff:*<IP>*
2020-01-23 21:49:47,909 - octoprint.server.util.flask - INFO - Passively logging in user MapleCreations from ::ffff:*<IP>*
2020-01-23 21:49:50,884 - octoprint.plugins.tplinksmartplug - INFO - ImmutableMultiDict([('checkStatus', u'*<IP>*')])
2020-01-23 21:49:52,843 - octoprint.server.util.sockjs - INFO - User MapleCreations logged in on the socket from client ::ffff:*<IP>*
**2020-01-23 22:02:09,525 - octoprint.util.connectivity_checker - INFO - Connectivity changed from online to offline**
2020-01-23 22:02:12,580 - octoprint.server.heartbeat - INFO - Server heartbeat <3
2020-01-23 22:11:03,882 - octoprint.server.util.sockjs - INFO - Client connection closed: ::ffff:*<IP>*
2020-01-23 22:11:03,891 - octoprint.server.util.sockjs - INFO - Client connection closed: ::ffff:*<IP>*
2020-01-23 22:11:24,362 - octoprint.server.util.sockjs - INFO - Client connection closed: ::ffff:*<IP>*
2020-01-23 22:17:12,584 - octoprint.server.heartbeat - INFO - Server heartbeat <3
2020-01-23 22:32:12,586 - octoprint.server.heartbeat - INFO - Server heartbeat <3
2020-01-23 22:47:12,588 - octoprint.server.heartbeat - INFO - Server heartbeat <3
2020-01-23 23:02:12,591 - octoprint.server.heartbeat - INFO - Server heartbeat <3
2020-01-23 23:17:12,592 - octoprint.server.heartbeat - INFO - Server heartbeat <3
2020-01-23 23:30:51,199 - octoprint.util.comm - INFO - Finished in 13117.132 s.

Looks like around 2020-01-23 22:02:09,525, connectivity just went offline.

2020-01-23 22:02:09,525 - octoprint.util.connectivity_checker - INFO - Connectivity changed from online to offline

Is there another log (perhaps a pi log?) that could give me why this went offline? Looks like there's not much information on this one for it.

You can visit the Settings area and enable the Serial log. Then run your print and see what's there.

Again, try it in Safe Mode. This will simply not run any plugin which isn't bundled. If that's happy then you can rest assured that one of your many third-party plugins is to blame. But if it still misbehaves then you can more confidently start working on...

  • solid power (5V @ 2.5A with a power adapter to the Pi) + solid AC power from the wall (UPS?) + firm connectivity at both ends of the power adapter
  • a good-quality serial cable (internally-shielded or with a ferrite bead) + as short as possible + with no extra adapters + fits firmly at both ends of the cable
  • your Pi isn't sinking 5V power over to the printer adapter (make sure that the printer is plugged into power and the power switch is on before the Pi is turned on)

Some plugins hook into the gcode stream. This means that they run code while OctoPrint is trying to stream it to the printer. There becomes a point when the delay it adds makes things break. Or perhaps some branch of that code returns the wrong response, OctoPrint sees that and panics.