diff --git a/Nextion/nextion.py b/Nextion/nextion.py index 7360845..b9e501e 100644 --- a/Nextion/nextion.py +++ b/Nextion/nextion.py @@ -85,23 +85,26 @@ def transferFile(ser, filename, fSize): if "\x05" in r: continue else: + print + return False break print return True def upload(ser, filename, checkModel=None): if not getBaudrate(ser, os.path.getsize(filename), checkModel): - print 'could not find baudrate' + print 'Could not find baudrate' exit(1) if not setDownloadBaudrate(ser, os.path.getsize(filename), 115200): - print 'could not set download baudrate' + print 'Could not set download baudrate' exit(1) if not transferFile(ser, filename, os.path.getsize(filename)): - print 'could not transfer file' + print 'Could not transfer file' exit(1) + print 'File transferred successfully' exit(0) if __name__ == "__main__":