Index: pykota/trunk/pykota/constants.py
===================================================================
--- pykota/trunk/pykota/constants.py (revision 3489)
+++ pykota/trunk/pykota/constants.py (revision 3530)
@@ -25,4 +25,5 @@
 STATUSSTABILIZATIONLOOPS = 5  # number of consecutive times the 'idle' status must be seen before we consider it to be stable
 NOPRINTINGMAXDELAY = 60 # The printer must begin to print within 60 seconds by default.
+FIVEMINUTES = 300 # Five minutes : maximum delay between two SNMP queries
 
 def get(application, varname) :
Index: pykota/trunk/pykota/accounters/snmp.py
===================================================================
--- pykota/trunk/pykota/accounters/snmp.py (revision 3529)
+++ pykota/trunk/pykota/accounters/snmp.py (revision 3530)
@@ -157,4 +157,5 @@
         """Waits for printer status being 'printing'."""
         statusstabilizationdelay = constants.get(self.parent.filter, "StatusStabilizationDelay")
+        increment = 1
         noprintingmaxdelay = constants.get(self.parent.filter, "NoPrintingMaxDelay")
         if not noprintingmaxdelay :
@@ -166,5 +167,8 @@
         while True :
             self.retrieveSNMPValues()
+            waitdelay = statusstabilizationdelay * increment
+            error = self.checkIfError(self.printerDetectedErrorState)
             pstatusAsString = printerStatusValues.get(self.printerStatus)
+            dstatusAsString = deviceStatusValues.get(self.deviceStatus)
             if pstatusAsString in ('printing', 'warmup') :
                 break
@@ -184,8 +188,7 @@
                     elif noprintingmaxdelay \
                          and ((time.time() - self.timebefore) > noprintingmaxdelay) \
-                         and not self.checkIfError(self.printerDetectedErrorState) :
+                         and not error :
                         # More than X seconds without the printer being in 'printing' mode
                         # We can safely assume this won't change if printer is now 'idle'
-                        dstatusAsString = deviceStatusValues.get(self.deviceStatus)
                         if (pstatusAsString == 'idle') or \
                             ((pstatusAsString == 'other') and \
@@ -200,6 +203,9 @@
                                 self.parent.filter.printInfo("Printer %s has probably already printed this job !!!" % self.parent.filter.PrinterName, "warn")
                             break
-            self.parent.filter.logdebug(_("Waiting for printer %s to be printing...") % self.parent.filter.PrinterName)
-            time.sleep(statusstabilizationdelay)
+                    if error or (dstatusAsString == "down") :
+                        if waitdelay < constants.FIVEMINUTES :
+                            increment *= 2
+            self.parent.filter.logdebug("Waiting %s seconds for printer %s to be printing..." % (waitdelay, self.parent.filter.PrinterName))
+            time.sleep(waitdelay)
 
     def waitIdle(self) :
@@ -207,15 +213,18 @@
         statusstabilizationdelay = constants.get(self.parent.filter, "StatusStabilizationDelay")
         statusstabilizationloops = constants.get(self.parent.filter, "StatusStabilizationLoops")
-        idle_num = idle_flag = 0
+        increment = 1
+        idle_num = 0
         while True :
             self.retrieveSNMPValues()
+            waitdelay = statusstabilizationdelay * increment
+            error = self.checkIfError(self.printerDetectedErrorState)
             pstatusAsString = printerStatusValues.get(self.printerStatus)
             dstatusAsString = deviceStatusValues.get(self.deviceStatus)
-            idle_flag = 0
-            if (not self.checkIfError(self.printerDetectedErrorState)) \
-               and ((pstatusAsString == 'idle') or \
-                         ((pstatusAsString == 'other') and \
-                          (dstatusAsString == 'running'))) :
-                idle_flag = 1       # Standby / Powersave is considered idle
+            idle_flag = False
+            if (not error) and ((pstatusAsString == 'idle') or \
+                                    ((pstatusAsString == 'other') and \
+                                         (dstatusAsString == 'running'))) :
+                idle_flag = True # Standby / Powersave is considered idle
+                increment = 1 # Reset initial stabilization delay
             if idle_flag :
                 if (self.printerInternalPageCounter is not None) \
@@ -230,6 +239,10 @@
             else :
                 idle_num = 0
-            self.parent.filter.logdebug(_("Waiting for printer %s's idle status to stabilize...") % self.parent.filter.PrinterName)
-            time.sleep(statusstabilizationdelay)
+            if error or (dstatusAsString == "down") :
+                if waitdelay < constants.FIVEMINUTES :
+                    increment *= 2
+            self.parent.filter.logdebug("Waiting %s seconds for printer %s's idle status to stabilize..." % (waitdelay,
+                                                                                                             self.parent.filter.PrinterName))
+            time.sleep(waitdelay)
 
     def retrieveInternalPageCounter(self) :
@@ -243,5 +256,5 @@
             self.waitIdle()
         except :
-            self.parent.filter.printInfo(_("SNMP querying stage interrupted. Using latest value seen for internal page counter (%s) on printer %s.") % (self.printerInternalPageCounter, self.parent.filter.PrinterName), "warn")
+            self.parent.filter.printInfo("SNMP querying stage interrupted. Using latest value seen for internal page counter (%s) on printer %s." % (self.printerInternalPageCounter, self.parent.filter.PrinterName), "warn")
             raise
         return self.printerInternalPageCounter
@@ -333,7 +346,4 @@
         sys.stderr.write("Usage :  python  %s  printer_ip_address\n" % sys.argv[0])
     else :
-        def _(msg) :
-            return msg
-
         pagecounter = main(sys.argv[1])
         print "Internal page counter's value is : %s" % pagecounter
