We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d456c1d commit 409ed1fCopy full SHA for 409ed1f
extras/tools/bin2json.py
@@ -4,6 +4,9 @@
4
import json
5
import base64
6
7
+CHUNK_SIZE = 256 # This is the chunk size of how the binary is split on the server side for not overloading the embedded device receive buffers.
8
+INTER_CHUNK_DELAY_MS = 100 # This is delay between 2 consecutive chunks so as to not over load the embedded device.
9
+
10
if len(sys.argv) != 3:
11
print ("Usage: bin2json.py sketch-ota.bin sketch-ota.json")
12
sys.exit()
@@ -21,5 +24,5 @@
21
24
22
25
# Write to outfile
23
26
out_file = open(ofile, "w")
-json.dump({'binary' : base64_data.decode("ascii")}, out_file)
27
+json.dump({'binary' : base64_data.decode("ascii"), 'chunk_size' : CHUNK_SIZE, 'delay' : INTER_CHUNK_DELAY_MS}, out_file)
28
out_file.close()
0 commit comments