Skip to content

Commit 54785c5

Browse files
Merge branch 'espressif:master' into master
2 parents fa56eee + 9e61fa7 commit 54785c5

File tree

126 files changed

+6368
-819
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+6368
-819
lines changed

.github/CODEOWNERS

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# CODEOWNERS for ESP32 Arduino Core
2+
3+
# This file is used to specify the code owners for the ESP32 Arduino Core.
4+
# Read more about CODEOWNERS:
5+
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
6+
# Note that order matters. The last matching pattern will be used.
7+
8+
# The default owners are the active developers of the ESP32 Arduino Core.
9+
# Refrain from using @espressif/arduino-esp32 to avoid spamming non-developers with review requests.
10+
* @espressif/arduino-devs
11+
12+
# CI
13+
/.github/ @lucasssvaz @me-no-dev @P-R-O-C-H-Y
14+
/tests/ @lucasssvaz @P-R-O-C-H-Y
15+
16+
# Tools
17+
/tools/ @me-no-dev
18+
/tools/pre-commit/ @lucasssvaz
19+
/tools/add_lib.sh @P-R-O-C-H-Y
20+
21+
# Pre-commit
22+
/.* @lucasssvaz # Files in root directory that start with a dot.
23+
24+
# Git Files
25+
/.gitignore @espressif/arduino-devs
26+
/.gitmodules @espressif/arduino-devs
27+
28+
# Documentation
29+
/docs/ @pedrominatel
30+
/.github/ISSUE_TEMPLATE/ @pedrominatel
31+
/.github/PULL_REQUEST_TEMPLATE.md @pedrominatel
32+
/.readthedocs.yaml @pedrominatel
33+
/*.md @pedrominatel
34+
35+
# Boards
36+
/variants/ @P-R-O-C-H-Y
37+
/boards.txt @P-R-O-C-H-Y
38+
39+
# Arduino as Component
40+
/idf_component_examples/ @SuGlider
41+
/idf_component.yml @SuGlider @me-no-dev
42+
/CMakeLists.txt @SuGlider @me-no-dev
43+
/Kconfig.projbuild @SuGlider @me-no-dev
44+
45+
# Build System
46+
/package.json @me-no-dev
47+
/platform.txt @me-no-dev
48+
/programmers.txt @me-no-dev
49+
/package/ @me-no-dev
50+
51+
# Libraries
52+
/libraries/ArduinoOTA/ @me-no-dev
53+
/libraries/AsyncUDP/ @me-no-dev
54+
/libraries/BLE/ @lucasssvaz @SuGlider
55+
/libraries/ESP_I2S/ @me-no-dev
56+
/libraries/ESP_NOW/ @P-R-O-C-H-Y @lucasssvaz
57+
/libraries/ESP_SR/ @me-no-dev
58+
/libraries/ESPmDNS/ @me-no-dev
59+
/libraries/Ethernet/ @me-no-dev
60+
/libraries/Matter/ @SuGlider
61+
/libraries/NetBIOS/ @me-no-dev
62+
/libraries/Network/ @me-no-dev
63+
/libraries/OpenThread/ @SuGlider
64+
/libraries/PPP/ @me-no-dev
65+
/libraries/SPI/ @me-no-dev
66+
/libraries/Update/ @me-no-dev
67+
/libraries/USB/ @SuGlider @me-no-dev
68+
/libraries/WiFi/ @me-no-dev
69+
/libraries/WiFiProv/ @me-no-dev
70+
/libraries/Wire/ @me-no-dev
71+
/libraries/Zigbee/ @P-R-O-C-H-Y
72+
73+
# CI JSON
74+
# Keep this after other libraries and tests to avoid being overridden.
75+
**/ci.json @lucasssvaz
76+
77+
# The CODEOWNERS file should be owned by the developers of the ESP32 Arduino Core.
78+
# Leave this entry as the last one to avoid being overridden.
79+
/.github/CODEOWNERS @espressif/arduino-devs

.github/scripts/on-release.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,12 +342,14 @@ jq_arg=".packages[0].platforms[0].version = \"$RELEASE_TAG\" | \
342342
echo "Generating $PACKAGE_JSON_DEV ..."
343343
cat "$PACKAGE_JSON_TEMPLATE" | jq "$jq_arg" > "$OUTPUT_DIR/$PACKAGE_JSON_DEV"
344344
# On MacOS the sed command won't skip the first match. Use gsed instead.
345-
sed '0,/github\.com\/espressif\//!s|github\.com/espressif/|dl.espressif.cn/github_assets/espressif/|g' "$OUTPUT_DIR/$PACKAGE_JSON_DEV" > "$OUTPUT_DIR/$PACKAGE_JSON_DEV_CN"
345+
sed '0,/github\.com\//!s|github\.com/|dl.espressif.cn/github_assets/|g' "$OUTPUT_DIR/$PACKAGE_JSON_DEV" > "$OUTPUT_DIR/$PACKAGE_JSON_DEV_CN"
346+
python "$SCRIPTS_DIR/release_append_cn.py" "$OUTPUT_DIR/$PACKAGE_JSON_DEV_CN"
346347
if [ "$RELEASE_PRE" == "false" ]; then
347348
echo "Generating $PACKAGE_JSON_REL ..."
348349
cat "$PACKAGE_JSON_TEMPLATE" | jq "$jq_arg" > "$OUTPUT_DIR/$PACKAGE_JSON_REL"
349350
# On MacOS the sed command won't skip the first match. Use gsed instead.
350-
sed '0,/github\.com\/espressif\//!s|github\.com/espressif/|dl.espressif.cn/github_assets/espressif/|g' "$OUTPUT_DIR/$PACKAGE_JSON_REL" > "$OUTPUT_DIR/$PACKAGE_JSON_REL_CN"
351+
sed '0,/github\.com\//!s|github\.com/|dl.espressif.cn/github_assets/|g' "$OUTPUT_DIR/$PACKAGE_JSON_REL" > "$OUTPUT_DIR/$PACKAGE_JSON_REL_CN"
352+
python "$SCRIPTS_DIR/release_append_cn.py" "$OUTPUT_DIR/$PACKAGE_JSON_REL_CN"
351353
fi
352354

353355
# Figure out the last release or pre-release
@@ -456,14 +458,14 @@ echo "Uploading $PACKAGE_JSON_DEV ..."
456458
echo "Download URL: $(git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_DEV")"
457459
echo "Pages URL: $(git_safe_upload_to_pages "$PACKAGE_JSON_DEV" "$OUTPUT_DIR/$PACKAGE_JSON_DEV")"
458460
echo "Download CN URL: $(git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_DEV_CN")"
459-
echo "Pages CN URL: $(git_safe_upload_to_pages "$PACKAGE_JSON_DEV" "$OUTPUT_DIR/$PACKAGE_JSON_DEV_CN")"
461+
echo "Pages CN URL: $(git_safe_upload_to_pages "$PACKAGE_JSON_DEV_CN" "$OUTPUT_DIR/$PACKAGE_JSON_DEV_CN")"
460462
echo
461463
if [ "$RELEASE_PRE" == "false" ]; then
462464
echo "Uploading $PACKAGE_JSON_REL ..."
463465
echo "Download URL: $(git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_REL")"
464466
echo "Pages URL: $(git_safe_upload_to_pages "$PACKAGE_JSON_REL" "$OUTPUT_DIR/$PACKAGE_JSON_REL")"
465467
echo "Download CN URL: $(git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_REL_CN")"
466-
echo "Pages CN URL: $(git_safe_upload_to_pages "$PACKAGE_JSON_REL" "$OUTPUT_DIR/$PACKAGE_JSON_REL_CN")"
468+
echo "Pages CN URL: $(git_safe_upload_to_pages "$PACKAGE_JSON_REL_CN" "$OUTPUT_DIR/$PACKAGE_JSON_REL_CN")"
467469
echo
468470
fi
469471

.github/scripts/package_esptool.sh

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
# Check version argument
6+
if [[ $# -ne 3 ]]; then
7+
echo "Usage: $0 <version> <base_folder> <json_path>"
8+
echo "Example: $0 5.0.dev1 /tmp/esptool /tmp/esptool-5.0.dev1.json"
9+
exit 1
10+
fi
11+
12+
VERSION=$1
13+
BASE_FOLDER=$2
14+
JSON_PATH=$3
15+
16+
export COPYFILE_DISABLE=1
17+
18+
shopt -s nullglob # So for loop doesn't run if no matches
19+
20+
# Function to update JSON for a given host
21+
function update_json_for_host {
22+
local host=$1
23+
local archive=$2
24+
25+
# Extract the old url from the JSON for this host, then replace only the filename
26+
old_url=$(jq -r --arg host "$host" '
27+
.packages[].tools[] | select(.name == "esptool_py") | .systems[] | select(.host == $host) | .url // empty
28+
' "$tmp_json")
29+
if [[ -n "$old_url" ]]; then
30+
base_url="${old_url%/*}"
31+
url="$base_url/$archive"
32+
else
33+
echo "No old url found for $host"
34+
exit 1
35+
fi
36+
37+
archiveFileName="$archive"
38+
checksum="SHA-256:$(shasum -a 256 "$archive" | awk '{print $1}')"
39+
size=$(stat -f%z "$archive")
40+
41+
# Use jq to update the JSON
42+
jq --arg host "$host" \
43+
--arg url "$url" \
44+
--arg archiveFileName "$archiveFileName" \
45+
--arg checksum "$checksum" \
46+
--arg size "$size" \
47+
'
48+
.packages[].tools[]
49+
|= if .name == "esptool_py" then
50+
.systems = (
51+
((.systems // []) | map(select(.host != $host))) + [{
52+
host: $host,
53+
url: $url,
54+
archiveFileName: $archiveFileName,
55+
checksum: $checksum,
56+
size: $size
57+
}]
58+
)
59+
else
60+
.
61+
end
62+
' "$tmp_json" > "$tmp_json.new" && mv "$tmp_json.new" "$tmp_json"
63+
}
64+
65+
cd "$BASE_FOLDER"
66+
67+
# Delete all archives before starting
68+
rm -f esptool-*.tar.gz esptool-*.zip
69+
70+
for dir in esptool-*; do
71+
# Check if directory exists and is a directory
72+
if [[ ! -d "$dir" ]]; then
73+
continue
74+
fi
75+
76+
base="${dir#esptool-}"
77+
78+
# Add 'linux-' prefix if base doesn't contain linux/macos/win64
79+
if [[ "$base" != *linux* && "$base" != *macos* && "$base" != *win64* ]]; then
80+
base="linux-${base}"
81+
fi
82+
83+
if [[ "$dir" == esptool-win* ]]; then
84+
# Windows zip archive
85+
zipfile="esptool-v${VERSION}-${base}.zip"
86+
echo "Creating $zipfile from $dir ..."
87+
zip -r "$zipfile" "$dir"
88+
else
89+
# Non-Windows: set permissions and tar.gz archive
90+
tarfile="esptool-v${VERSION}-${base}.tar.gz"
91+
echo "Setting permissions and creating $tarfile from $dir ..."
92+
chmod -R u=rwx,g=rx,o=rx "$dir"
93+
tar -cvzf "$tarfile" "$dir"
94+
fi
95+
done
96+
97+
# After the for loop, update the JSON for each archive
98+
# Create a temporary JSON file to accumulate changes
99+
tmp_json="${JSON_PATH}.tmp"
100+
cp "$JSON_PATH" "$tmp_json"
101+
102+
for archive in esptool-v"${VERSION}"-*.tar.gz esptool-v"${VERSION}"-*.zip; do
103+
[ -f "$archive" ] || continue
104+
105+
echo "Updating JSON for $archive"
106+
107+
# Determine host from archive name
108+
case "$archive" in
109+
*linux-amd64*) host="x86_64-pc-linux-gnu" ;;
110+
*linux-armv7*) host="arm-linux-gnueabihf" ;;
111+
*linux-aarch64*) host="aarch64-linux-gnu" ;;
112+
*macos-amd64*) host="x86_64-apple-darwin" ;;
113+
*macos-arm64*) host="arm64-apple-darwin" ;;
114+
*win64*) hosts=("x86_64-mingw32" "i686-mingw32") ;;
115+
*) echo "Unknown host for $archive"; continue ;;
116+
esac
117+
118+
# For win64, loop over both hosts; otherwise, use a single host
119+
if [[ "$archive" == *win64* ]]; then
120+
for host in "${hosts[@]}"; do
121+
update_json_for_host "$host" "$archive"
122+
done
123+
else
124+
update_json_for_host "$host" "$archive"
125+
fi
126+
done
127+
128+
# After all archives are processed, move the temporary JSON to the final file
129+
mv "$tmp_json" "$JSON_PATH"

.github/scripts/release_append_cn.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
2+
#!/usr/bin/env python3
3+
4+
# Arduino IDE provides by default a package file for the ESP32. This causes version conflicts
5+
# when the user tries to use the JSON file with the Chinese mirrors.
6+
#
7+
# The downside is that the Arduino IDE will always warn the user that updates are available as it
8+
# will consider the version from the Chinese mirrors as a pre-release version.
9+
#
10+
# This script is used to append "-cn" to all versions in the package_esp32_index_cn.json file so that
11+
# the user can select the Chinese mirrors without conflicts.
12+
#
13+
# If Arduino ever stops providing the package_esp32_index.json file by default,
14+
# this script can be removed and the tags reverted.
15+
16+
import json
17+
18+
def append_cn_to_versions(obj):
19+
if isinstance(obj, dict):
20+
# dfu-util comes from arduino.cc and not from the Chinese mirrors, so we skip it
21+
if obj.get("name") == "dfu-util":
22+
return
23+
24+
for key, value in obj.items():
25+
if key == "version" and isinstance(value, str):
26+
if not value.endswith("-cn"):
27+
obj[key] = value + "-cn"
28+
else:
29+
append_cn_to_versions(value)
30+
31+
elif isinstance(obj, list):
32+
for item in obj:
33+
append_cn_to_versions(item)
34+
35+
def process_json_file(input_path, output_path=None):
36+
with open(input_path, "r", encoding="utf-8") as f:
37+
data = json.load(f)
38+
39+
append_cn_to_versions(data)
40+
41+
if output_path is None:
42+
output_path = input_path
43+
44+
with open(output_path, "w", encoding="utf-8") as f:
45+
json.dump(data, f, indent=2)
46+
47+
print(f"Updated JSON written to {output_path}")
48+
49+
if __name__ == "__main__":
50+
import sys
51+
if len(sys.argv) < 2:
52+
print("Usage: python release_append_cn.py input.json [output.json]")
53+
else:
54+
input_file = sys.argv[1]
55+
output_file = sys.argv[2] if len(sys.argv) > 2 else None
56+
process_json_file(input_file, output_file)

.github/workflows/publishsizes.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,17 @@ jobs:
4444
gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read artifact
4545
do
4646
IFS=$'\t' read name url <<< "$artifact"
47-
gh api $url > "$name.zip"
48-
unzip -j "$name.zip" -d "temp_$name"
49-
if [[ "$name" == "pr_number" ]]; then
50-
mv "temp_$name"/* sizes-report
51-
elif [[ "$name" == "pr_cli"* ]]; then
52-
mv "temp_$name"/* sizes-report/pr
53-
else
54-
mv "temp_$name"/* sizes-report
47+
# Only process pr_number and pr_cli_compile artifacts
48+
if [[ "$name" == "pr_number" || "$name" =~ ^pr_cli_compile_[0-9]+$ ]]; then
49+
gh api $url > "$name.zip"
50+
unzip -o -j "$name.zip" -d "temp_$name"
51+
if [[ "$name" == "pr_number" ]]; then
52+
mv "temp_$name"/* sizes-report
53+
elif [[ "$name" =~ ^pr_cli_compile_[0-9]+$ ]]; then
54+
mv "temp_$name"/* sizes-report/pr
55+
fi
56+
rm -r "temp_$name"
5557
fi
56-
rm -r "temp_$name"
5758
done
5859
echo "Contents of parent directory:"
5960
ls -R ..
@@ -65,7 +66,7 @@ jobs:
6566
path: ./artifacts/sizes-report/pr_num.txt
6667

6768
- name: Report results
68-
uses: P-R-O-C-H-Y/report-size-deltas@2043188c68f483a7b50527c4eacf609d05bb67a5 # sizes_v2
69+
uses: P-R-O-C-H-Y/report-size-deltas@bea91d2c99ca80c88a883b39b1c4012f00ec3d09 # sizes_v2
6970
with:
7071
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}
7172
github-token: ${{ env.GITHUB_TOKEN }}

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ set(ARDUINO_LIBRARY_LittleFS_SRCS libraries/LittleFS/src/LittleFS.cpp)
165165
set(ARDUINO_LIBRARY_NetBIOS_SRCS libraries/NetBIOS/src/NetBIOS.cpp)
166166

167167
set(ARDUINO_LIBRARY_OpenThread_SRCS
168+
libraries/OpenThread/src/OThread.cpp
168169
libraries/OpenThread/src/OThreadCLI.cpp
169170
libraries/OpenThread/src/OThreadCLI_Util.cpp)
170171

@@ -301,6 +302,8 @@ set(ARDUINO_LIBRARY_Zigbee_SRCS
301302
libraries/Zigbee/src/ep/ZigbeeWindSpeedSensor.cpp
302303
libraries/Zigbee/src/ep/ZigbeeIlluminanceSensor.cpp
303304
libraries/Zigbee/src/ep/ZigbeePM25Sensor.cpp
305+
libraries/Zigbee/src/ep/ZigbeeElectricalMeasurement.cpp
306+
libraries/Zigbee/src/ep/ZigbeeBinary.cpp
304307
libraries/Zigbee/src/ep/ZigbeePowerOutlet.cpp
305308
)
306309

0 commit comments

Comments
 (0)