Skip to content

Commit d7f892d

Browse files
authored
Merge branch 'master' into patch-3
2 parents 169d4b5 + d22bcb7 commit d7f892d

File tree

7 files changed

+100
-46
lines changed

7 files changed

+100
-46
lines changed

.github/scripts/on-push.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ else
108108
replace_script+="data['packages']['toolchain-xtensa-esp32']['optional']=True;"
109109
replace_script+="data['packages']['toolchain-xtensa-esp32s3']['optional']=False;"
110110
replace_script+="data['packages']['tool-esptoolpy']['owner']='tasmota';"
111-
replace_script+="data['packages']['tool-esptoolpy']['version']='https://github.com/tasmota/esptool/releases/download/v3.3/esptool-3.3.zip';"
111+
replace_script+="data['packages']['tool-esptoolpy']['version']='https://github.com/tasmota/esptool/releases/download/v4.2.1/esptool-4.2.1.zip';"
112112
replace_script+="fp.seek(0);fp.truncate();json.dump(data, fp, indent=2);fp.close()"
113113
python -c "$replace_script"
114114

.gitignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,17 @@ tools/esptool.exe
88
tools/mkspiffs
99
tools/mklittlefs
1010
tools/mkfatfs.exe
11+
12+
# Ignore editor backup files and macOS system metadata
1113
.DS_Store
14+
.*.swp
15+
.*.swo
16+
*~
17+
18+
# Ignore build folder
19+
/build
1220

13-
#Ignore files built by Visual Studio/Visual Micro
21+
# Ignore files built by Visual Studio/Visual Micro
1422
[Dd]ebug*/
1523
[Rr]elease*/
1624
.vs/

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ set(BLE_SRCS
168168
)
169169

170170
set(includedirs
171-
variants/${IDF_TARGET}/
171+
variants/${CONFIG_ARDUINO_VARIANT}/
172172
cores/esp32/
173173
libraries/ArduinoOTA/src
174174
libraries/AsyncUDP/src
@@ -210,13 +210,13 @@ set(priv_requires fatfs nvs_flash app_update spiffs bootloader_support openssl b
210210

211211
idf_component_register(INCLUDE_DIRS ${includedirs} PRIV_INCLUDE_DIRS ${priv_includes} SRCS ${srcs} REQUIRES ${requires} PRIV_REQUIRES ${priv_requires})
212212

213-
string(TOUPPER ${CONFIG_IDF_TARGET} idf_target_caps)
213+
string(TOUPPER ${CONFIG_ARDUINO_VARIANT} idf_target_caps)
214214
target_compile_options(${COMPONENT_TARGET} PUBLIC
215215
-DARDUINO=10812
216216
-DARDUINO_${idf_target_caps}_DEV
217217
-DARDUINO_ARCH_ESP32
218218
-DARDUINO_BOARD="${idf_target_caps}_DEV"
219-
-DARDUINO_VARIANT="${CONFIG_IDF_TARGET}"
219+
-DARDUINO_VARIANT="${CONFIG_ARDUINO_VARIANT}"
220220
-DESP32)
221221

222222
if(CONFIG_AUTOSTART_ARDUINO)

Kconfig.projbuild

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
menu "Arduino Configuration"
22

3+
config ARDUINO_VARIANT
4+
string "Arduino target variant (board)"
5+
default IDF_TARGET
6+
help
7+
The name of a target variant (e.g., a specific board) in the variants/
8+
folder, e.g. "heltec_wifi_lora_32_V2". The name is case sensitive.
9+
Specifying a variant name different from the target enables additional
10+
customization, for example the definition of GPIO pins.
11+
312
config ENABLE_ARDUINO_DEPENDS
413
bool
514
select LWIP_SO_RCVBUF

boards.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17114,8 +17114,8 @@ department_of_alchemy_minimain_esp32s2.menu.EraseFlash.all.upload.erase_cmd=-e
1711417114
##############################################################
1711517115

1711617116
Bee_Motion_S3.name=Bee Motion S3
17117-
Bee_Motion_Mini.vid.0=0x303a
17118-
Bee_Motion_Mini.pid.0=0x8113
17117+
Bee_Motion_S3.vid.0=0x303a
17118+
Bee_Motion_S3.pid.0=0x8113
1711917119

1712017120
Bee_Motion_S3.bootloader.tool=esptool_py
1712117121
Bee_Motion_S3.bootloader.tool.default=esptool_py
@@ -17223,8 +17223,8 @@ Bee_Motion_S3.menu.EraseFlash.all.upload.erase_cmd=-e
1722317223
########################################################################
1722417224

1722517225
Bee_Motion.name=Bee Motion
17226-
Bee_Motion_Mini.vid.0=0x303a
17227-
Bee_Motion_Mini.pid.0=0x810D
17226+
Bee_Motion.vid.0=0x303a
17227+
Bee_Motion.pid.0=0x810D
1722817228

1722917229
Bee_Motion.bootloader.tool=esptool_py
1723017230
Bee_Motion.bootloader.tool.default=esptool_py
@@ -17440,8 +17440,8 @@ Bee_Motion_Mini.menu.EraseFlash.all.upload.erase_cmd=-e
1744017440
###############################################################
1744117441

1744217442
Bee_S3.name=Bee S3
17443-
Bee_Motion_Mini.vid.0=0x303a
17444-
Bee_Motion_Mini.pid.0=0x8110
17443+
Bee_S3.vid.0=0x303a
17444+
Bee_S3.pid.0=0x8110
1744517445

1744617446
Bee_S3.bootloader.tool=esptool_py
1744717447
Bee_S3.bootloader.tool.default=esptool_py

package/package_esp32_index.template.json

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
{
6060
"packager": "esp32",
6161
"name": "esptool_py",
62-
"version": "3.3.0"
62+
"version": "4.2.1"
6363
},
6464
{
6565
"packager": "esp32",
@@ -297,56 +297,56 @@
297297
},
298298
{
299299
"name": "esptool_py",
300-
"version": "3.3.0",
300+
"version": "4.2.1",
301301
"systems": [
302302
{
303303
"host": "i686-mingw32",
304-
"url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.2/esptool-3.3-windows.zip",
305-
"archiveFileName": "esptool-3.3-windows.zip",
306-
"checksum": "SHA-256:55a1d7165414bf4dbd2bb16ca094e555d671958450f5d1536b457a518d2b15df",
307-
"size": "7436864"
304+
"url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.4/esptool-4.2.1-windows.zip",
305+
"archiveFileName": "esptool-4.2.1-windows.zip",
306+
"checksum": "SHA-256:582560067bfbd9895f4862eb5fdf87558ddee5d4d30e7575c9b8bcb0dd60fd94",
307+
"size": "6368279"
308308
},
309309
{
310310
"host": "x86_64-mingw32",
311-
"url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.2/esptool-3.3-windows.zip",
312-
"archiveFileName": "esptool-3.3-windows.zip",
313-
"checksum": "SHA-256:55a1d7165414bf4dbd2bb16ca094e555d671958450f5d1536b457a518d2b15df",
314-
"size": "7436864"
311+
"url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.4/esptool-4.2.1-windows.zip",
312+
"archiveFileName": "esptool-4.2.1-windows.zip",
313+
"checksum": "SHA-256:582560067bfbd9895f4862eb5fdf87558ddee5d4d30e7575c9b8bcb0dd60fd94",
314+
"size": "6368279"
315315
},
316316
{
317317
"host": "x86_64-apple-darwin",
318-
"url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.2/esptool-3.3-macos.tar.gz",
319-
"archiveFileName": "esptool-3.3-macos.tar.gz",
320-
"checksum": "SHA-256:3e5f7b521ae33c8c63f3b48efc909c08f37bef1a083c0eafa408312c09900afd",
321-
"size": "6944975"
318+
"url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.4/esptool-4.2.1-macos.tar.gz",
319+
"archiveFileName": "esptool-4.2.1-macos.tar.gz",
320+
"checksum": "SHA-256:a984f7ad8bdb40c42d0d368bf4bb21b69a9587aed46b7b6d7de23ca58a3f150d",
321+
"size": "5816598"
322322
},
323323
{
324324
"host": "x86_64-pc-linux-gnu",
325-
"url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.2/esptool-3.3-linux.tar.gz",
326-
"archiveFileName": "esptool-3.3-linux.tar.gz",
327-
"checksum": "SHA-256:fbe91a49e5f5deca4881f5eed32e8903faf97bfd365fe2d0d1512b80bdb67f5e",
328-
"size": "97026"
325+
"url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.4/esptool-4.2.1-linux.tar.gz",
326+
"archiveFileName": "esptool-4.2.1-linux.tar.gz",
327+
"checksum": "SHA-256:5a45fb77eb6574554ec2f45230d0b350f26f9c24ab3b6c13c4031ebdf72a34ab",
328+
"size": "90123"
329329
},
330330
{
331331
"host": "i686-pc-linux-gnu",
332-
"url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.2/esptool-3.3-linux.tar.gz",
333-
"archiveFileName": "esptool-3.3-linux.tar.gz",
334-
"checksum": "SHA-256:fbe91a49e5f5deca4881f5eed32e8903faf97bfd365fe2d0d1512b80bdb67f5e",
335-
"size": "97026"
332+
"url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.4/esptool-4.2.1-linux.tar.gz",
333+
"archiveFileName": "esptool-4.2.1-linux.tar.gz",
334+
"checksum": "SHA-256:5a45fb77eb6574554ec2f45230d0b350f26f9c24ab3b6c13c4031ebdf72a34ab",
335+
"size": "90123"
336336
},
337337
{
338338
"host": "arm-linux-gnueabihf",
339-
"url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.2/esptool-3.3-linux.tar.gz",
340-
"archiveFileName": "esptool-3.3-linux.tar.gz",
341-
"checksum": "SHA-256:fbe91a49e5f5deca4881f5eed32e8903faf97bfd365fe2d0d1512b80bdb67f5e",
342-
"size": "97026"
339+
"url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.4/esptool-4.2.1-linux.tar.gz",
340+
"archiveFileName": "esptool-4.2.1-linux.tar.gz",
341+
"checksum": "SHA-256:5a45fb77eb6574554ec2f45230d0b350f26f9c24ab3b6c13c4031ebdf72a34ab",
342+
"size": "90123"
343343
},
344344
{
345345
"host": "aarch64-linux-gnu",
346-
"url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.2/esptool-3.3-linux.tar.gz",
347-
"archiveFileName": "esptool-3.3-linux.tar.gz",
348-
"checksum": "SHA-256:fbe91a49e5f5deca4881f5eed32e8903faf97bfd365fe2d0d1512b80bdb67f5e",
349-
"size": "97026"
346+
"url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.4/esptool-3.3-linux.tar.gz",
347+
"archiveFileName": "esptool-4.2.1-linux.tar.gz",
348+
"checksum": "SHA-256:5a45fb77eb6574554ec2f45230d0b350f26f9c24ab3b6c13c4031ebdf72a34ab",
349+
"size": "90123"
350350
}
351351
]
352352
},

tools/get.py

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,17 @@ def mkdir_p(path):
5454

5555
def report_progress(count, blockSize, totalSize):
5656
if sys.stdout.isatty():
57-
percent = int(count*blockSize*100/totalSize)
58-
percent = min(100, percent)
59-
sys.stdout.write("\r%d%%" % percent)
57+
if totalSize > 0:
58+
percent = int(count*blockSize*100/totalSize)
59+
percent = min(100, percent)
60+
sys.stdout.write("\r%d%%" % percent)
61+
else:
62+
sofar = (count*blockSize) / 1024
63+
if sofar >= 1000:
64+
sofar /= 1024
65+
sys.stdout.write("\r%dMB " % (sofar))
66+
else:
67+
sys.stdout.write("\r%dKB" % (sofar))
6068
sys.stdout.flush()
6169

6270
def unpack(filename, destination):
@@ -82,6 +90,32 @@ def unpack(filename, destination):
8290
shutil.rmtree(rename_to)
8391
shutil.move(dirname, rename_to)
8492

93+
def download_file_with_progress(url,filename):
94+
import ssl
95+
import contextlib
96+
ctx = ssl.create_default_context()
97+
ctx.check_hostname = False
98+
ctx.verify_mode = ssl.CERT_NONE
99+
with contextlib.closing(urlopen(url,context=ctx)) as fp:
100+
total_size = int(fp.getheader("Content-Length",fp.getheader("Content-length","0")))
101+
block_count = 0
102+
block_size = 1024 * 8
103+
block = fp.read(block_size)
104+
if block:
105+
with open(filename,'wb') as out_file:
106+
out_file.write(block)
107+
block_count += 1
108+
report_progress(block_count, block_size, total_size)
109+
while True:
110+
block = fp.read(block_size)
111+
if not block:
112+
break
113+
out_file.write(block)
114+
block_count += 1
115+
report_progress(block_count, block_size, total_size)
116+
else:
117+
raise Exception ('nonexisting file or connection error')
118+
85119
def download_file(url,filename):
86120
import ssl
87121
import contextlib
@@ -126,8 +160,11 @@ def get_tool(tool):
126160
if is_ci:
127161
download_file(url, local_path)
128162
else:
129-
urlretrieve(url, local_path, report_progress)
130-
sys.stdout.write("\rDone\n")
163+
try:
164+
urlretrieve(url, local_path, report_progress)
165+
except:
166+
download_file_with_progress(url, local_path)
167+
sys.stdout.write("\rDone \n")
131168
sys.stdout.flush()
132169
else:
133170
print('Tool {0} already downloaded'.format(archive_name))

0 commit comments

Comments
 (0)