-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Integrated handling for filesystem and gzipped binaries #8266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
gneiss15
wants to merge
25
commits into
esp8266:master
from
gneiss15:Integrated-handling-for-filesystem-and-gzipped-Binaries
Closed
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
28c79fa
Add functionality to copy generated binaries into sketch folder
gneiss15 8c7445b
Merge branch 'master' into master
gneiss15 4f6340e
Integrated handling for filesystem and gzipped Binaries
gneiss15 5509ba4
Forgot to add new tools to git
gneiss15 71d4213
Minor bugfix
gneiss15 62ca3b6
Debug for failed check in Pull-Request
gneiss15 6091823
Ignore files generated by boards.txt.py & my extra files
gneiss15 158484f
More Debug for failed check in Pull-Request
gneiss15 cf02d41
Bugfix for check
gneiss15 dd93598
And another bigfix :-(
gneiss15 f39b549
Changed mod a+x (as all other .py)
gneiss15 43f9e21
Syntax error in utilities.py may be the reason for failed import. Cor…
gneiss15 6849302
instead of external commd, use python module gzip
gneiss15 d86910c
Integrated handling for filesystem and gzipped binaries (#1)
gneiss15 ea98d66
Improved handling of "tkinter not awailable"
gneiss15 fc74ac7
Merge branch 'master' into Integrated-handling-for-filesystem-and-gzi…
gneiss15 b827489
Improved selection of actions to be performed
gneiss15 8c06e83
Merge branch 'master' of https://github.com/esp8266/Arduino into esp8…
gneiss15 cbc8f4d
Merge branch 'esp8266-master' into Integrated-handling-for-filesystem…
gneiss15 87eacb4
Remover empthy dir
gneiss15 32d715a
Merge branch 'Integrated-handling-for-filesystem-and-gzipped-Binaries…
gneiss15 3380148
Changes as requested by d-a-v
gneiss15 311c9c3
Removed changes not contained inside master
gneiss15 b7751e3
platformio-build.py forgotten
gneiss15 9d1ded0
Merge branch 'master' into Integrated-handling-for-filesystem-and-gzi…
gneiss15 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule SoftwareSerial
deleted from
bdcbe7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Network-Upload-Wrapper | ||
# 2021-08-08: G.N.: Written to support (optional) uploading of sketch & filesystem in one step | ||
|
||
import os | ||
import sys | ||
ToolsDir = os.path.dirname( os.path.realpath( __file__ ) ).replace( '\\', '/' ) + "/" # convert to UNIX format | ||
try: | ||
sys.path.insert( 0, ToolsDir ) # ToolsDir | ||
from utilities import * # If this fails, we can't continue and will bomb below | ||
except Exception as e: | ||
sys.stderr.write( '\nImport of utilities.py failed.\n...Is it not next to this %s tool?\n...Exception was: %s\n' % ( __file__, e ) ) | ||
sys.exit( 2 ) | ||
|
||
try: | ||
sys.path.insert( 0, ToolsDir ) # Add this dir to search path | ||
import espota # If this fails, we can't continue and will bomb below | ||
except Exception: | ||
Msg( '\nespota not found next to this netUpload.py tool.' ) | ||
sys.exit( 2 ) | ||
|
||
#Args: (original) | ||
# As defined in 'platform.txt' for 'tools.esptool.upload.network_pattern' | ||
# -i "{serial.port}" | ||
# -p "{network.port}" | ||
# "--auth={network.password}" | ||
# -f "{build.path}/{build.project_name}.bin" | ||
|
||
#Args: (new) | ||
# As defined in 'platform.txt' for 'tools.esptool.upload.network_pattern' | ||
# | possible values/meaning | ||
# | | | ||
# -fi "{build.Filesystem}" 0-4 | ||
# -i "{serial.port}" | ||
# -p "{network.port}" | ||
# "--auth={network.password}" | ||
# --sk "{build.path}/{build.project_name}.bin" <filePath for sketch-bin> | ||
# --fs "{build.path}/{build.project_name}" <filePath for fs.bin, without ext> | ||
|
||
def parse_args( argsIn ): | ||
parser = argparse.ArgumentParser( description = 'Network-Upload-Wrapper for Arduino esp8266' ) | ||
parser.add_argument( '-fi', '--Filesystem', type = int, default = 0, help = '0: Off, 1: LitteFs: Create & Upload, 2: LitteFs: Create only, 3: SPIFFS: Create & Upload, 4: SPIFFS: Create only' ) | ||
parser.add_argument( '-i', '--port', type = str, required = True, help = 'path to serial device' ) | ||
parser.add_argument( '-p', '--netPort', type = str, required = True, help = 'network port' ) | ||
parser.add_argument( '--auth', type = str, help = 'network password' ) | ||
parser.add_argument( '--sk', type = str, required = True, help = 'path_path_to_sketch_binary' ) | ||
parser.add_argument( '--fs', type = str, help = 'path_to_fs_binary_without_ext' ) | ||
global Args | ||
Args = parser.parse_args( argsIn ) | ||
|
||
def main( argsIn = None ): | ||
""" | ||
Main function for netUpload | ||
|
||
argsIn - Optional override for default arguments parsing (that uses sys.argv), can be a list of custom arguments. | ||
Arguments and their values need to be added as individual items to the list e.g. "-b 115200" thus becomes ['-b', '115200']. | ||
""" | ||
|
||
parse_args( argsIn ) | ||
|
||
if not os.path.exists( Args.port ): | ||
Msg( "Port: '%s', does not exist!\n...Upload aborted" % Args.port ) | ||
sys.exit( 1 ) | ||
|
||
baseArgs = [ '-i', Args.port, '-p', Args.netPort, '--auth', Args.auth ] | ||
|
||
sketchArgs = baseArgs + [ '-f', Args.sk ] | ||
|
||
Msg( "Uploading Binaries..." ) | ||
|
||
#Debug( str( sketchArgs ) ) | ||
esptool.main( sketchArgs ) | ||
filesUploaded = [ Args.sk ] | ||
|
||
if Args.Filesystem == 1 or Args.Filesystem == 3: | ||
fsArgs = baseArgs + [ '-s', '-f' ] | ||
if Args.Filesystem == 1: | ||
fsArgs = baseArgs + [ "%s.littlefs" % Args.fs ] | ||
elif Args.Filesystem == 3: | ||
fsArgs = baseArgs + [ "%s.spiffs" % Args.fs ] | ||
|
||
#Debug( str( fsArgs ) ) | ||
esptool.main( fsArgs ) | ||
filesUploaded += [ Args.fs ] | ||
|
||
Msg( '...files uploaded: %s' % ", ".join( filesUploaded ) ) | ||
|
||
def main_(): | ||
try: | ||
main() | ||
except RuntimeError as e: | ||
Msg( '\nA RuntimeError error occurred: %s' % e ) | ||
sys.exit( 2 ) | ||
|
||
if __name__ == '__main__': | ||
main_() | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is removing
espota.py
really part of this PR ?This one is very sensitive and any change must be backward compatible.
It must be part of another dedicated PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not removed... See You comment above (about old behaviour) there espota.py is still contained.
It's only modified to additionally upload the fs within one call to espota !