Skip to content

Commit 705dd39

Browse files
thangktrandevyte
authored andcommitted
tools: fixed bug to select signed bin (esp8266#6334)
From platform.txt, the binary to be uploaded is hardcoded to *.bin file. This is not the expected behaviour when Signed Update is used.
1 parent a64ef54 commit 705dd39

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tools/espota.py

+8
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ def serve(remoteAddr, localAddr, remotePort, localPort, password, filename, comm
8181
logging.error("Listen Failed")
8282
return 1
8383

84+
# Check whether Signed Update is used.
85+
if ( os.path.isfile(filename + '.signed') ):
86+
filename = filename + '.signed'
87+
file_check_msg = 'Detected Signed Update. %s will be uploaded instead.' % (filename)
88+
sys.stderr.write(file_check_msg + '\n')
89+
sys.stderr.flush()
90+
logging.info(file_check_msg)
91+
8492
content_size = os.path.getsize(filename)
8593
f = open(filename,'rb')
8694
file_md5 = hashlib.md5(f.read()).hexdigest()

0 commit comments

Comments
 (0)