File tree 2 files changed +5
-3
lines changed
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ tools.esptool.upload.params.quiet=
137
137
# First, potentially perform an erase or nothing
138
138
# Next, do the binary upload
139
139
# Combined in one rule because Arduino doesn't suport upload.1.pattern/upload.3.pattern
140
- tools.esptool.upload.pattern="{cmd}" "{runtime.platform.path}/tools/upload.py" "{runtime.platform.path}/tools/pyserial" "{runtime.platform.path}/tools/esptool" --chip esp8266 --port "{serial.port}" --baud "{upload.speed}" "{upload.verbose}" {upload.erase_cmd} --end --chip esp8266 --port "{serial.port}" --baud "{upload.speed}" "{upload.verbose}" write_flash 0x0 "{build.path}/{build.project_name}.bin" --end
140
+ tools.esptool.upload.pattern="{cmd}" "{runtime.platform.path}/tools/upload.py" --chip esp8266 --port "{serial.port}" --baud "{upload.speed}" "{upload.verbose}" {upload.erase_cmd} --end --chip esp8266 --port "{serial.port}" --baud "{upload.speed}" "{upload.verbose}" write_flash 0x0 "{build.path}/{build.project_name}.bin" --end
141
141
142
142
tools.esptool.upload.network_pattern="{network_cmd}" "{runtime.platform.path}/tools/espota.py" -i "{serial.port}" -p "{network.port}" "--auth={network.password}" -f "{build.path}/{build.project_name}.bin"
143
143
Original file line number Diff line number Diff line change 7
7
# i.e. upload.py tools/pyserial tools/esptool erase_flash --end write_flash file 0x0 --end
8
8
9
9
import sys
10
+ import os
10
11
11
12
sys .argv .pop (0 ) # Remove executable name
13
+ toolspath = os .path .dirname (os .path .realpath (__file__ )).replace ('\\ ' , '/' ) # CWD in UNIX format
12
14
try :
13
- sys .path .append (sys . argv . pop ( 0 ). replace ( ' \\ ' , '/' )) # Add pyserial dir to search path, in UNIX format
14
- sys .path .append (sys . argv . pop ( 0 ). replace ( ' \\ ' , '/' )) # Add esptool dir to search path, in UNIX format
15
+ sys .path .append (toolspath + "/pyserial" ) # Add pyserial dir to search path
16
+ sys .path .append (toolspath + "/esptool" ) # Add esptool dir to search path
15
17
import esptool # If this fails, we can't continue and will bomb below
16
18
except :
17
19
sys .stderr .write ("Error in command line, need pyserial path as 1st arg and esptool path as 2nd.\n " )
You can’t perform that action at this time.
0 commit comments