'Try connecting repeatedly until successful, or giving up'

def connect(self, mode='default_reset'):

    print('Connecting...', end='')
    sys.stdout.flush()
    last_error = None
    try:
        for _ in range(10):
            last_error = self._connect_attempt(mode=mode, esp32r0_delay=False)
            if (last_error is None):
                return
            last_error = self._connect_attempt(mode=mode, esp32r0_delay=True)
            if (last_error is None):
                return
    finally:
        print('')
    raise FatalError(('Failed    to    connect    to    %s:    %s' % (self.CHIP_NAME, last_error)))
