From 9380dacbed823b3194e900dc2dbd1f84c95b6b51 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 18 Sep 2015 15:24:21 +0200 Subject: [PATCH] Small fix to USB printing which should fix the issues for printrbots --- plugins/USBPrinting/PrinterConnection.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/USBPrinting/PrinterConnection.py b/plugins/USBPrinting/PrinterConnection.py index bb1de905a4..e52ccb58da 100644 --- a/plugins/USBPrinting/PrinterConnection.py +++ b/plugins/USBPrinting/PrinterConnection.py @@ -264,16 +264,17 @@ class PrinterConnection(OutputDevice, QObject, SignalEmitter): # If the programmer connected, we know its an atmega based version. Not all that usefull, but it does give some debugging information. for baud_rate in self._getBaudrateList(): # Cycle all baud rates (auto detect) + Logger.log("d","Attempting to connect to printer with serial %s on baud rate %s", self._serial_port, baud_rate) if self._serial is None: try: self._serial = serial.Serial(str(self._serial_port), baud_rate, timeout = 3, writeTimeout = 10000) except serial.SerialException: - Logger.log("i", "Could not open port %s" % self._serial_port) - return + #Logger.log("i", "Could not open port %s" % self._serial_port) + continue else: if not self.setBaudRate(baud_rate): continue # Could not set the baud rate, go to the next - Logger.log("d","Attempting to connect to printer with serial %s on baud rate %s", self._serial_port, baud_rate) + time.sleep(1.5) # Ensure that we are not talking to the bootloader. 1.5 sec seems to be the magic number sucesfull_responses = 0 timeout_time = time.time() + 5