On 31 Jul 2013 , at 2:17 PM, Paige Warner wrote:
> I'd love to know what that one line fix to s3g.py would be. I just
> switched over to sailfish
> and would like to start transferring my files without swapping cards. Mind
> you, my bot is
> only a few feet away from my mac but I still don't like swapping cards and
> pushing more
> buttons than I have too…
Find StreamWriter.py (streamWrite.py in older versions) and find the section
around line 116 which reads
except makerbot_driver.RetryableError as e:
# Sent a packet to the host, but got a malformed response or timed out waiting
# for a reply. Retry immediately.
self._log.debug('{"event":"transmission_problem", "exception":"%s", "message":"%s", "retry_count"=%i}', type(e), e.__str__(), retry_count)
self.total_retries += 1
retry_count += 1
received_errors.append(e.__class__.__name__)
and add a flush call so that it now reads
except makerbot_driver.RetryableError as e:
# Sent a packet to the host, but got a malformed response or timed out waiting
# for a reply. Retry immediately.
self._log.debug('{"event":"transmission_problem", "exception":"%s", "message":"%s", "retry_count"=%i}', type(e), e.__str__(), retry_count)
# We're going to go back and try again -- flush the input buffer
self.file.flushInput()
self.total_retries += 1
retry_count += 1
received_errors.append(e.__class__.__name__)
That solves the underlying problem. Conveyor sends command X and incorrectly assumes that
the response it gets back is to command X. If it gets an error response, it resends command X.
Problem is that the response may have been to line noise or another process sending data down
the wire after which there will then be a response to command X. So then Conveyor gets two
responses to the two command X's which it sent. Net, Net, Conveyor gets confused. The s3g
protocol simply doesn't adequately take comms errors into account and gets all out of sync
and confused when they happen. When the bots didn't send any error responses back, Conveyor
didn't get confused this way. However, when you don't send error responses, then Conveyor can
make other incorrect assumptions. By flushing the I/O channel, the first response to command X
is wiped and Conveyor doesn't get confused when it resends command X.
NOW, you may not be out of the woods when you make this change. You may still have
issues with Conveyor (s3g.py and support code) seeing error responses for which MBI has
not added code to handle and thus they appear as an "unknown" error rather than nicely
categorized where they belong. But for just sending a "print this file", you may/should
be okay.
Dan