Skip to content

Commit fe8202d

Browse files
authored
Merge branch 'espressif:master' into master
2 parents dedec9b + 003db9e commit fe8202d

40 files changed

+1167
-28
lines changed

Diff for: .github/scripts/tests_run.sh

+10-8
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ function run_test {
1111
local error=0
1212
local sdkconfig_path
1313
local extra_args
14+
local test_type
1415

1516
sketchdir=$(dirname "$sketch")
1617
sketchname=$(basename "$sketchdir")
18+
test_type=$(basename "$(dirname "$sketchdir")")
1719

1820
if [ "$options" -eq 0 ] && [ -f "$sketchdir"/ci.json ]; then
1921
len=$(jq -r --arg target "$target" '.fqbn[$target] | length' "$sketchdir"/ci.json)
@@ -48,10 +50,10 @@ function run_test {
4850
return 0
4951
fi
5052

51-
local right_target
52-
right_target=$(grep -E "^CONFIG_IDF_TARGET=\"$target\"$" "$sdkconfig_path")
53-
if [ -z "$right_target" ]; then
54-
printf "\033[91mError: Sketch %s compiled for different target\n\033[0m\n" "$sketchname"
53+
local compiled_target
54+
compiled_target=$(grep -E "CONFIG_IDF_TARGET=" "$sdkconfig_path" | cut -d'"' -f2)
55+
if [ "$compiled_target" != "$target" ]; then
56+
printf "\033[91mError: Sketch %s compiled for %s, expected %s\033[0m\n" "$sketchname" "$compiled_target" "$target"
5557
printf "\n\n\n"
5658
return 1
5759
fi
@@ -113,14 +115,14 @@ function run_test {
113115
rm "$sketchdir"/diagram.json 2>/dev/null || true
114116

115117
result=0
116-
printf "\033[95mpytest \"%s/test_%s.py\" --build-dir \"%s\" --junit-xml=\"%s\" %s\033[0m\n" "$sketchdir" "$sketchname" "$build_dir" "$report_file" "${extra_args[*]@Q}"
117-
bash -c "set +e; pytest \"$sketchdir/test_$sketchname.py\" --build-dir \"$build_dir\" --junit-xml=\"$report_file\" ${extra_args[*]@Q}; exit \$?" || result=$?
118+
printf "\033[95mpytest \"%s/test_%s.py\" --build-dir \"%s\" --junit-xml=\"%s\" -o junit_suite_name=%s_%s_%s_%s%s %s\033[0m\n" "$sketchdir" "$sketchname" "$build_dir" "$report_file" "$test_type" "$platform" "$target" "$sketchname" "$i" "${extra_args[*]@Q}"
119+
bash -c "set +e; pytest \"$sketchdir/test_$sketchname.py\" --build-dir \"$build_dir\" --junit-xml=\"$report_file\" -o junit_suite_name=${test_type}_${platform}_${target}_${sketchname}${i} ${extra_args[*]@Q}; exit \$?" || result=$?
118120
printf "\n"
119121
if [ $result -ne 0 ]; then
120122
result=0
121123
printf "\033[95mRetrying test: %s -- Config: %s\033[0m\n" "$sketchname" "$i"
122-
printf "\033[95mpytest \"%s/test_%s.py\" --build-dir \"%s\" --junit-xml=\"%s\" %s\033[0m\n" "$sketchdir" "$sketchname" "$build_dir" "$report_file" "${extra_args[*]@Q}"
123-
bash -c "set +e; pytest \"$sketchdir/test_$sketchname.py\" --build-dir \"$build_dir\" --junit-xml=\"$report_file\" ${extra_args[*]@Q}; exit \$?" || result=$?
124+
printf "\033[95mpytest \"%s/test_%s.py\" --build-dir \"%s\" --junit-xml=\"%s\" -o junit_suite_name=%s_%s_%s_%s%s %s\033[0m\n" "$sketchdir" "$sketchname" "$build_dir" "$report_file" "$test_type" "$platform" "$target" "$sketchname" "$i" "${extra_args[*]@Q}"
125+
bash -c "set +e; pytest \"$sketchdir/test_$sketchname.py\" --build-dir \"$build_dir\" --junit-xml=\"$report_file\" -o junit_suite_name=${test_type}_${platform}_${target}_${sketchname}${i} ${extra_args[*]@Q}; exit \$?" || result=$?
124126
printf "\n"
125127
if [ $result -ne 0 ]; then
126128
printf "\033[91mFailed test: %s -- Config: %s\033[0m\n\n" "$sketchname" "$i"

Diff for: .github/workflows/tests_results.yml

+33-4
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
original_sha=$(cat ./artifacts/parent-artifacts/sha.txt)
4242
original_ref=$(cat ./artifacts/parent-artifacts/ref.txt)
4343
original_conclusion=$(cat ./artifacts/parent-artifacts/conclusion.txt)
44+
original_run_id=$(cat ./artifacts/parent-artifacts/run_id.txt)
4445
4546
# Sanitize the values to avoid security issues
4647
@@ -59,17 +60,27 @@ jobs:
5960
# Conclusion: Allow alphabetical characters and underscores
6061
original_conclusion=$(echo "$original_conclusion" | tr -cd '[:alpha:]_')
6162
63+
# Run ID: Allow numeric characters
64+
original_run_id=$(echo "$original_run_id" | tr -cd '[:digit:]')
65+
6266
echo "original_event=$original_event" >> $GITHUB_ENV
6367
echo "original_action=$original_action" >> $GITHUB_ENV
6468
echo "original_sha=$original_sha" >> $GITHUB_ENV
6569
echo "original_ref=$original_ref" >> $GITHUB_ENV
6670
echo "original_conclusion=$original_conclusion" >> $GITHUB_ENV
71+
echo "original_run_id=$original_run_id" >> $GITHUB_ENV
6772
6873
echo "original_event = $original_event"
6974
echo "original_action = $original_action"
7075
echo "original_sha = $original_sha"
7176
echo "original_ref = $original_ref"
7277
echo "original_conclusion = $original_conclusion"
78+
echo "original_run_id = $original_run_id"
79+
80+
- name: Print links to other runs
81+
run: |
82+
echo "Build, Hardware and QEMU tests: https://github.com/${{ github.repository }}/actions/runs/${{ env.original_run_id }}"
83+
echo "Wokwi tests: https://github.com/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}"
7384
7485
- name: Publish Unit Test Results
7586
uses: EnricoMi/publish-unit-test-result-action@v2
@@ -80,6 +91,17 @@ jobs:
8091
files: ./artifacts/**/*.xml
8192
action_fail: true
8293
compare_to_earlier_commit: false
94+
json_file: ./unity_results.json
95+
json_suite_details: true
96+
97+
- name: Upload JSON
98+
uses: actions/upload-artifact@v4
99+
if: ${{ always() }}
100+
with:
101+
name: unity_results
102+
overwrite: true
103+
path: |
104+
./unity_results.json
83105
84106
- name: Fail if tests failed
85107
if: ${{ env.original_conclusion == 'failure' || env.original_conclusion == 'timed_out' || github.event.workflow_run.conclusion == 'failure' || github.event.workflow_run.conclusion == 'timed_out' }}
@@ -138,11 +160,18 @@ jobs:
138160
})).data;
139161
core.info(`${name} is ${state}`);
140162
141-
- name: Create output folder
163+
- name: Generate report
142164
if: ${{ !cancelled() && (env.original_event == 'schedule' || env.original_event == 'workflow_dispatch') }} # codespell:ignore cancelled
165+
env:
166+
REPORT_FILE: ./runtime-tests-results/RUNTIME_TESTS_REPORT.md
167+
WOKWI_RUN_ID: ${{ github.event.workflow_run.id }}
168+
BUILD_RUN_ID: ${{ env.original_run_id }}
169+
IS_FAILING: ${{ env.original_conclusion == 'failure' || env.original_conclusion == 'timed_out' || github.event.workflow_run.conclusion == 'failure' || github.event.workflow_run.conclusion == 'timed_out' || job.status == 'failure' }}
143170
run: |
144-
rm -rf artifacts
145-
mkdir -p runtime-tests-results
171+
rm -rf artifacts $REPORT_FILE
172+
mv -f ./unity_results.json ./runtime-tests-results/unity_results.json
173+
touch $REPORT_FILE
174+
python3 ./runtime-tests-results/table_generator.py ./runtime-tests-results/unity_results.json >> $REPORT_FILE
146175
147176
- name: Generate badge
148177
if: ${{ !cancelled() && (env.original_event == 'schedule' || env.original_event == 'workflow_dispatch') }} # codespell:ignore cancelled
@@ -161,6 +190,6 @@ jobs:
161190
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
162191
if [[ `git status --porcelain` ]]; then
163192
git add --all
164-
git commit -m "Updated runtime tests badge"
193+
git commit -m "Updated runtime tests report"
165194
git push origin HEAD:gh-pages
166195
fi

Diff for: .github/workflows/tests_wokwi.yml

+4
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ jobs:
109109
printf "\nAction = "
110110
cat artifacts/action.txt
111111
112+
printf "${{ github.event.workflow_run.id }}" >> artifacts/run_id.txt
113+
printf "\nRun ID = "
114+
cat artifacts/run_id.txt
115+
112116
if [ -z "$ref" ] || [ "$ref" == "null" ]; then
113117
echo "Failed to get PR number or ref"
114118
exit 1

Diff for: CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ set(ARDUINO_LIBRARY_Zigbee_SRCS
295295
libraries/Zigbee/src/ep/ZigbeeDoorWindowHandle.cpp
296296
libraries/Zigbee/src/ep/ZigbeeWindowCovering.cpp
297297
libraries/Zigbee/src/ep/ZigbeeVibrationSensor.cpp
298+
libraries/Zigbee/src/ep/ZigbeeAnalog.cpp
299+
libraries/Zigbee/src/ep/ZigbeeRangeExtender.cpp
298300
)
299301

300302
set(ARDUINO_LIBRARY_BLE_SRCS

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Build Status](https://img.shields.io/github/actions/workflow/status/espressif/arduino-esp32/push.yml?branch=master&event=push&label=Compilation%20Tests)](https://github.com/espressif/arduino-esp32/actions/workflows/push.yml?query=branch%3Amaster+event%3Apush)
44
[![Verbose Build Status](https://img.shields.io/github/actions/workflow/status/espressif/arduino-esp32/push.yml?branch=master&event=schedule&label=Compilation%20Tests%20(Verbose))](https://github.com/espressif/arduino-esp32/actions/workflows/push.yml?query=branch%3Amaster+event%3Aschedule)
55
[![External Libraries Test](https://img.shields.io/github/actions/workflow/status/espressif/arduino-esp32/lib.yml?branch=master&event=schedule&label=External%20Libraries%20Test)](https://github.com/espressif/arduino-esp32/blob/gh-pages/LIBRARIES_TEST.md)
6-
[![Runtime Tests](https://github.com/espressif/arduino-esp32/blob/gh-pages/runtime-tests-results/badge.svg)](https://github.com/espressif/arduino-esp32/actions/workflows/tests_results.yml)
6+
[![Runtime Tests](https://github.com/espressif/arduino-esp32/blob/gh-pages/runtime-tests-results/badge.svg)](https://github.com/espressif/arduino-esp32/blob/gh-pages/runtime-tests-results/RUNTIME_TESTS_REPORT.md)
77

88
### Need help or have a question? Join the chat at [Discord](https://discord.gg/8xY6e9crwv) or [open a new Discussion](https://github.com/espressif/arduino-esp32/discussions)
99

Diff for: libraries/Matter/examples/MatterComposedLights/MatterComposedLights.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ void loop() {
128128
// Onboard User Button is kept pressed for longer than 5 seconds in order to decommission matter node
129129
uint32_t time_diff = millis() - button_time_stamp;
130130
if (button_state && time_diff > decommissioningTimeout) {
131-
Serial.println("Decommissioning the Light Matter Accessory. It shall be commissioned again.");
131+
Serial.println("Decommissioning the Composed Light Matter Accessory. It shall be commissioned again.");
132132
Matter.decommission();
133133
button_time_stamp = millis(); // avoid running decommissining again, reboot takes a second or so
134134
}

Diff for: libraries/Matter/examples/MatterContactSensor/MatterContactSensor.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ void loop() {
140140

141141
// Onboard User Button is kept pressed for longer than 5 seconds in order to decommission matter node
142142
if (button_state && time_diff > decommissioningTimeout) {
143-
Serial.println("Decommissioning the Generic Switch Matter Accessory. It shall be commissioned again.");
143+
Serial.println("Decommissioning Contact Sensor Matter Accessory. It shall be commissioned again.");
144144
Matter.decommission();
145145
button_time_stamp = millis(); // avoid running decommissining again, reboot takes a second or so
146146
}

Diff for: libraries/Matter/examples/MatterFan/MatterFan.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ void loop() {
180180

181181
// Onboard User Button is kept pressed for longer than 5 seconds in order to decommission matter node
182182
if (button_state && time_diff > decommissioningTimeout) {
183-
Serial.println("Decommissioning the Generic Switch Matter Accessory. It shall be commissioned again.");
183+
Serial.println("Decommissioning Fan Matter Accessory. It shall be commissioned again.");
184184
Matter.decommission();
185185
button_time_stamp = millis(); // avoid running decommissining again, reboot takes a second or so
186186
}

Diff for: libraries/Matter/examples/MatterHumiditySensor/MatterHumiditySensor.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ void loop() {
122122
// Onboard User Button is kept pressed for longer than 5 seconds in order to decommission matter node
123123
uint32_t time_diff = millis() - button_time_stamp;
124124
if (button_state && time_diff > decommissioningTimeout) {
125-
Serial.println("Decommissioning the Light Matter Accessory. It shall be commissioned again.");
125+
Serial.println("Decommissioning Humidity Sensor Matter Accessory. It shall be commissioned again.");
126126
Matter.decommission();
127127
}
128128

Diff for: libraries/Matter/examples/MatterOccupancySensor/MatterOccupancySensor.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ void loop() {
116116
// Onboard User Button is kept pressed for longer than 5 seconds in order to decommission matter node
117117
uint32_t time_diff = millis() - button_time_stamp;
118118
if (button_state && time_diff > decommissioningTimeout) {
119-
Serial.println("Decommissioning the Generic Switch Matter Accessory. It shall be commissioned again.");
119+
Serial.println("Decommissioning Occupancy Sensor Matter Accessory. It shall be commissioned again.");
120120
Matter.decommission();
121121
button_time_stamp = millis(); // avoid running decommissining again, reboot takes a second or so
122122
}

Diff for: libraries/Matter/examples/MatterPressureSensor/MatterPressureSensor.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ void loop() {
122122
// Onboard User Button is kept pressed for longer than 5 seconds in order to decommission matter node
123123
uint32_t time_diff = millis() - button_time_stamp;
124124
if (button_state && time_diff > decommissioningTimeout) {
125-
// Factory reset is triggered if the button is pressed longer than 10 seconds
126-
Serial.println("Decommissioning the Light Matter Accessory. It shall be commissioned again.");
125+
// Factory reset is triggered if the button is pressed longer than 5 seconds
126+
Serial.println("Decommissioning Pressure Sensor Matter Accessory. It shall be commissioned again.");
127127
Matter.decommission();
128128
}
129129

Diff for: libraries/Matter/examples/MatterTemperatureSensor/MatterTemperatureSensor.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ void loop() {
122122
// Onboard User Button is kept pressed for longer than 5 seconds in order to decommission matter node
123123
uint32_t time_diff = millis() - button_time_stamp;
124124
if (button_state && time_diff > decommissioningTimeout) {
125-
Serial.println("Decommissioning the Light Matter Accessory. It shall be commissioned again.");
125+
Serial.println("Decommissioning Temperature Sensor Matter Accessory. It shall be commissioned again.");
126126
Matter.decommission();
127127
button_time_stamp = millis(); // avoid running decommissining again, reboot takes a second or so
128128
}

Diff for: libraries/Matter/examples/MatterThermostat/MatterThermostat.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ void loop() {
234234
// Onboard User Button is kept pressed for longer than 5 seconds in order to decommission matter node
235235
uint32_t time_diff = millis() - button_time_stamp;
236236
if (button_state && time_diff > decommissioningTimeout) {
237-
Serial.println("Decommissioning the Light Matter Accessory. It shall be commissioned again.");
237+
Serial.println("Decommissioning Thermostat Matter Accessory. It shall be commissioned again.");
238238
Matter.decommission();
239239
button_time_stamp = millis(); // avoid running decommissining again, reboot takes a second or so
240240
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Arduino-ESP32 Zigbee Analog Input Output Example
2+
3+
This example shows how to configure the Zigbee end device and use it as a Home Automation (HA) analog input/output device.
4+
5+
# Supported Targets
6+
7+
Currently, this example supports the following targets.
8+
9+
| Supported Targets | ESP32-C6 | ESP32-H2 |
10+
| ----------------- | -------- | -------- |
11+
12+
## Analog Sensor Functions
13+
14+
* After this board first starts up, it would be configured locally to report an analog input on change or every 30 seconds.
15+
* By clicking the button (BOOT) on this board, this board will immediately send a report of the current measured value to the network.
16+
17+
## Hardware Required
18+
19+
* A USB cable for power supply and programming
20+
21+
### Configure the Project
22+
23+
Set the ADC GPIO by changing the `analogPin` variable. By default, it's the pin `A0`.
24+
Set the Button GPIO by changing the `button` variable. By default, it's the pin `BOOT_PIN` (BOOT button on ESP32-C6 and ESP32-H2).
25+
26+
#### Using Arduino IDE
27+
28+
To get more information about the Espressif boards see [Espressif Development Kits](https://www.espressif.com/en/products/devkits).
29+
30+
* Before Compile/Verify, select the correct board: `Tools -> Board`.
31+
* Select the End device Zigbee mode: `Tools -> Zigbee mode: Zigbee ED (end device)`
32+
* Select Partition Scheme for Zigbee: `Tools -> Partition Scheme: Zigbee 4MB with spiffs`
33+
* Select the COM port: `Tools -> Port: xxx` where the `xxx` is the detected COM port.
34+
* Optional: Set debug level to verbose to see all logs from Zigbee stack: `Tools -> Core Debug Level: Verbose`.
35+
36+
## Troubleshooting
37+
38+
If the End device flashed with this example is not connecting to the coordinator, erase the flash of the End device before flashing the example to the board. It is recommended to do this if you re-flash the coordinator.
39+
You can do the following:
40+
41+
* In the Arduino IDE go to the Tools menu and set `Erase All Flash Before Sketch Upload` to `Enabled`.
42+
* Add to the sketch `Zigbee.factoryReset();` to reset the device and Zigbee stack.
43+
44+
By default, the coordinator network is closed after rebooting or flashing new firmware.
45+
To open the network you have 2 options:
46+
47+
* Open network after reboot by setting `Zigbee.setRebootOpenNetwork(time);` before calling `Zigbee.begin();`.
48+
* In application you can anytime call `Zigbee.openNetwork(time);` to open the network for devices to join.
49+
50+
***Important: Make sure you are using a good quality USB cable and that you have a reliable power source***
51+
52+
* **LED not blinking:** Check the wiring connection and the IO selection.
53+
* **Programming Fail:** If the programming/flash procedure fails, try reducing the serial connection speed.
54+
* **COM port not detected:** Check the USB cable and the USB to Serial driver installation.
55+
56+
If the error persists, you can ask for help at the official [ESP32 forum](https://esp32.com) or see [Contribute](#contribute).
57+
58+
## Contribute
59+
60+
To know how to contribute to this project, see [How to contribute.](https://github.com/espressif/arduino-esp32/blob/master/CONTRIBUTING.rst)
61+
62+
If you have any **feedback** or **issue** to report on this example/library, please open an issue or fix it by creating a new PR. Contributions are more than welcome!
63+
64+
Before creating a new issue, be sure to try Troubleshooting and check if the same issue was already created by someone else.
65+
66+
## Resources
67+
68+
* Official ESP32 Forum: [Link](https://esp32.com)
69+
* Arduino-ESP32 Official Repository: [espressif/arduino-esp32](https://github.com/espressif/arduino-esp32)
70+
* ESP32-C6 Datasheet: [Link to datasheet](https://www.espressif.com/sites/default/files/documentation/esp32-c6_datasheet_en.pdf)
71+
* ESP32-H2 Datasheet: [Link to datasheet](https://www.espressif.com/sites/default/files/documentation/esp32-h2_datasheet_en.pdf)
72+
* Official ESP-IDF documentation: [ESP-IDF](https://idf.espressif.com)

0 commit comments

Comments
 (0)