Skip to content

Commit 645728f

Browse files
authored
Merge branch 'master' into DNSServer-EDNS
2 parents e64e96a + 31d22e6 commit 645728f

File tree

21 files changed

+597
-107
lines changed

21 files changed

+597
-107
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

boards.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41778,6 +41778,13 @@ Geekble_Nano_ESP32S3.menu.PartitionScheme.custom=Custom
4177841778
Geekble_Nano_ESP32S3.menu.PartitionScheme.custom.build.partitions=
4177941779
Geekble_Nano_ESP32S3.menu.PartitionScheme.custom.upload.maximum_size=16777216
4178041780

41781+
Geekble_Nano_ESP32S3.menu.PSRAM.disabled=Disabled
41782+
Geekble_Nano_ESP32S3.menu.PSRAM.disabled.build.defines=
41783+
Geekble_Nano_ESP32S3.menu.PSRAM.disabled.build.psram_type=qspi
41784+
Geekble_Nano_ESP32S3.menu.PSRAM.enabled=Enabled
41785+
Geekble_Nano_ESP32S3.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM
41786+
Geekble_Nano_ESP32S3.menu.PSRAM.enabled.build.psram_type=qspi
41787+
4178141788
Geekble_Nano_ESP32S3.menu.DebugLevel.none=None
4178241789
Geekble_Nano_ESP32S3.menu.DebugLevel.none.build.code_debug=0
4178341790
Geekble_Nano_ESP32S3.menu.DebugLevel.error=Error

cores/esp32/esp32-hal-bt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include "esp32-hal-bt.h"
1616

1717
#if SOC_BT_SUPPORTED
18-
#ifdef CONFIG_BT_BLUEDROID_ENABLED
18+
#if defined(CONFIG_BT_BLUEDROID_ENABLED) && __has_include("esp_bt.h")
1919

2020
#if CONFIG_IDF_TARGET_ESP32
2121
bool btInUse() {

idf_component.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ dependencies:
6868
# RainMaker Start (Fixed versions, because Matter supports only Insights 1.0.1)
6969
espressif/network_provisioning:
7070
version: "1.0.2"
71+
rules:
72+
- if: "target != esp32c2"
7173
espressif/esp_rainmaker:
7274
version: "1.5.2"
7375
rules:

libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ void handleNotFound() {
3434

3535
void setup() {
3636
Serial.begin(115200);
37-
WiFi.mode(WIFI_AP);
38-
WiFi.softAP("ESP32-DNSServer");
37+
WiFi.AP.begin();
38+
WiFi.AP.create("ESP32-DNSServer");
39+
WiFi.AP.enableDhcpCaptivePortal();
3940

4041
// by default DNSServer is started serving any "*" domain name. It will reply
4142
// AccessPoint's IP to all DNS request (this is required for Captive Portal detection)

libraries/HTTPUpdate/src/HTTPUpdate.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ HTTPUpdateResult HTTPUpdate::handleUpdate(HTTPClient &http, const String &curren
356356
log_e("Content-Length was 0 or wasn't set by Server?!\n");
357357
}
358358
break;
359+
case HTTP_CODE_NO_CONTENT:
359360
case HTTP_CODE_NOT_MODIFIED:
360361
///< Not Modified (No updates)
361362
ret = HTTP_UPDATE_NO_UPDATES;

libraries/WiFi/src/AP.cpp

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,45 @@ bool APClass::enableNAPT(bool enable) {
305305
return true;
306306
}
307307

308+
bool APClass::enableDhcpCaptivePortal() {
309+
esp_err_t err = ESP_OK;
310+
static char captiveportal_uri[32] = {
311+
0,
312+
};
313+
314+
if (!started()) {
315+
log_e("AP must be first started to enable DHCP Captive Portal");
316+
return false;
317+
}
318+
319+
// Create Captive Portal URL: http://192.168.0.4
320+
strcpy(captiveportal_uri, "http://");
321+
strcat(captiveportal_uri, String(localIP()).c_str());
322+
323+
// Stop DHCPS
324+
err = esp_netif_dhcps_stop(_esp_netif);
325+
if (err && err != ESP_ERR_ESP_NETIF_DHCP_ALREADY_STOPPED) {
326+
log_e("DHCPS Stop Failed! 0x%04x: %s", err, esp_err_to_name(err));
327+
return false;
328+
}
329+
330+
// Enable DHCP Captive Portal
331+
err = esp_netif_dhcps_option(_esp_netif, ESP_NETIF_OP_SET, ESP_NETIF_CAPTIVEPORTAL_URI, captiveportal_uri, strlen(captiveportal_uri));
332+
if (err) {
333+
log_e("Could not set enable DHCP Captive Portal! 0x%x: %s", err, esp_err_to_name(err));
334+
return false;
335+
}
336+
337+
// Start DHCPS
338+
err = esp_netif_dhcps_start(_esp_netif);
339+
if (err) {
340+
log_e("DHCPS Start Failed! 0x%04x: %s", err, esp_err_to_name(err));
341+
return false;
342+
}
343+
344+
return true;
345+
}
346+
308347
String APClass::SSID(void) const {
309348
if (!started()) {
310349
return String();

libraries/WiFi/src/WiFiAP.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class APClass : public NetworkInterface {
5353

5454
bool bandwidth(wifi_bandwidth_t bandwidth);
5555
bool enableNAPT(bool enable = true);
56+
bool enableDhcpCaptivePortal();
5657

5758
String SSID(void) const;
5859
uint8_t stationCount();

libraries/Zigbee/examples/Zigbee_Analog_Input_Output/Zigbee_Analog_Input_Output.ino

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
* Modified by Pat Clay
2727
*/
2828

29-
#ifndef ZIGBEE_MODE_ED
30-
#error "Zigbee end device mode is not selected in Tools->Zigbee mode"
29+
#ifndef ZIGBEE_MODE_ZCZR
30+
#error "Zigbee coordinator/router device mode is not selected in Tools->Zigbee mode"
3131
#endif
3232

3333
#include "Zigbee.h"
@@ -70,6 +70,7 @@ void setup() {
7070
zbAnalogDevice.addAnalogOutput();
7171
zbAnalogDevice.setAnalogOutputApplication(ESP_ZB_ZCL_AI_RPM_OTHER);
7272
zbAnalogDevice.setAnalogOutputDescription("Fan Speed (RPM)");
73+
zbAnalogDevice.setAnalogOutputResolution(1);
7374

7475
// If analog output cluster is added, set callback function for analog output change
7576
zbAnalogDevice.onAnalogOutputChange(onAnalogOutputChange);
@@ -99,8 +100,8 @@ void setup() {
99100
Zigbee.addEndpoint(&zbAnalogPercent);
100101

101102
Serial.println("Starting Zigbee...");
102-
// When all EPs are registered, start Zigbee in End Device mode
103-
if (!Zigbee.begin()) {
103+
// When all EPs are registered, start Zigbee in Router Device mode
104+
if (!Zigbee.begin(ZIGBEE_ROUTER)) {
104105
Serial.println("Zigbee failed to start!");
105106
Serial.println("Rebooting...");
106107
ESP.restart();
@@ -151,6 +152,9 @@ void loop() {
151152
Zigbee.factoryReset();
152153
}
153154
}
155+
// For demonstration purposes, increment the analog output value by 100
156+
zbAnalogDevice.setAnalogOutput(zbAnalogDevice.getAnalogOutput() + 100);
157+
zbAnalogDevice.reportAnalogOutput();
154158
}
155159
delay(100);
156160
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
2-
"fqbn_append": "PartitionScheme=zigbee,ZigbeeMode=ed",
2+
"fqbn_append": "PartitionScheme=zigbee_zczr,ZigbeeMode=zczr",
33
"requires": [
4-
"CONFIG_SOC_IEEE802154_SUPPORTED=y",
54
"CONFIG_ZB_ENABLED=y"
65
]
76
}

libraries/Zigbee/examples/Zigbee_Thermostat/Zigbee_Thermostat.ino

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
#include "Zigbee.h"
3535

3636
/* Zigbee thermostat configuration */
37-
#define THERMOSTAT_ENDPOINT_NUMBER 5
37+
#define THERMOSTAT_ENDPOINT_NUMBER 1
38+
#define USE_RECEIVE_TEMP_WITH_SOURCE 1
3839
uint8_t button = BOOT_PIN;
3940

4041
ZigbeeThermostat zbThermostat = ZigbeeThermostat(THERMOSTAT_ENDPOINT_NUMBER);
@@ -48,13 +49,28 @@ float sensor_tolerance;
4849
struct tm timeinfo = {}; // Time structure for Time cluster
4950

5051
/****************** Temperature sensor handling *******************/
51-
void recieveSensorTemp(float temperature) {
52+
#if USE_RECEIVE_TEMP_WITH_SOURCE == 0
53+
void receiveSensorTemp(float temperature) {
5254
Serial.printf("Temperature sensor value: %.2f°C\n", temperature);
5355
sensor_temp = temperature;
5456
}
57+
#else
58+
void receiveSensorTempWithSource(float temperature, uint8_t src_endpoint, esp_zb_zcl_addr_t src_address) {
59+
if (src_address.addr_type == ESP_ZB_ZCL_ADDR_TYPE_SHORT) {
60+
Serial.printf("Temperature sensor value: %.2f°C from endpoint %d, address 0x%04x\n", temperature, src_endpoint, src_address.u.short_addr);
61+
} else {
62+
Serial.printf(
63+
"Temperature sensor value: %.2f°C from endpoint %d, address %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n", temperature, src_endpoint,
64+
src_address.u.ieee_addr[7], src_address.u.ieee_addr[6], src_address.u.ieee_addr[5], src_address.u.ieee_addr[4], src_address.u.ieee_addr[3],
65+
src_address.u.ieee_addr[2], src_address.u.ieee_addr[1], src_address.u.ieee_addr[0]
66+
);
67+
}
68+
sensor_temp = temperature;
69+
}
70+
#endif
5571

56-
void recieveSensorConfig(float min_temp, float max_temp, float tolerance) {
57-
Serial.printf("Temperature sensor settings: min %.2f°C, max %.2f°C, tolerance %.2f°C\n", min_temp, max_temp, tolerance);
72+
void receiveSensorConfig(float min_temp, float max_temp, float tolerance) {
73+
Serial.printf("Temperature sensor config: min %.2f°C, max %.2f°C, tolerance %.2f°C\n", min_temp, max_temp, tolerance);
5874
sensor_min_temp = min_temp;
5975
sensor_max_temp = max_temp;
6076
sensor_tolerance = tolerance;
@@ -66,9 +82,15 @@ void setup() {
6682
// Init button switch
6783
pinMode(button, INPUT_PULLUP);
6884

69-
// Set callback functions for temperature and configuration receive
70-
zbThermostat.onTempRecieve(recieveSensorTemp);
71-
zbThermostat.onConfigRecieve(recieveSensorConfig);
85+
// Set callback function for receiving temperature from sensor - Use only one option
86+
#if USE_RECEIVE_TEMP_WITH_SOURCE == 0
87+
zbThermostat.onTempReceive(receiveSensorTemp); // If you bound only one sensor or you don't need to know the source of the temperature
88+
#else
89+
zbThermostat.onTempReceiveWithSource(receiveSensorTempWithSource);
90+
#endif
91+
92+
// Set callback function for receiving sensor configuration
93+
zbThermostat.onConfigReceive(receiveSensorConfig);
7294

7395
//Optional: set Zigbee device name and model
7496
zbThermostat.setManufacturerAndModel("Espressif", "ZigbeeThermostat");
@@ -107,19 +129,30 @@ void setup() {
107129

108130
Serial.println();
109131

110-
// Get temperature sensor configuration
111-
zbThermostat.getSensorSettings();
132+
// Get temperature sensor configuration for all bound sensors by endpoint number and address
133+
std::list<zb_device_params_t *> boundSensors = zbThermostat.getBoundDevices();
134+
for (const auto &device : boundSensors) {
135+
Serial.println("--------------------------------");
136+
if (device->short_addr == 0x0000 || device->short_addr == 0xFFFF) { //End devices never have 0x0000 short address or 0xFFFF group address
137+
Serial.printf(
138+
"Device on endpoint %d, IEEE Address: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\r\n", device->endpoint, device->ieee_addr[7], device->ieee_addr[6],
139+
device->ieee_addr[5], device->ieee_addr[4], device->ieee_addr[3], device->ieee_addr[2], device->ieee_addr[1], device->ieee_addr[0]
140+
);
141+
zbThermostat.getSensorSettings(device->endpoint, device->ieee_addr);
142+
} else {
143+
Serial.printf("Device on endpoint %d, short address: 0x%x\r\n", device->endpoint, device->short_addr);
144+
zbThermostat.getSensorSettings(device->endpoint, device->short_addr);
145+
}
146+
}
112147
}
113148

114149
void loop() {
115150
// Handle button switch in loop()
116151
if (digitalRead(button) == LOW) { // Push button pressed
117-
118152
// Key debounce handling
119153
while (digitalRead(button) == LOW) {
120154
delay(50);
121155
}
122-
123156
// Set reporting interval for temperature sensor
124157
zbThermostat.setTemperatureReporting(0, 10, 2);
125158
}
@@ -130,5 +163,6 @@ void loop() {
130163
last_print = millis();
131164
int temp_percent = (int)((sensor_temp - sensor_min_temp) / (sensor_max_temp - sensor_min_temp) * 100);
132165
Serial.printf("Loop temperature info: %.2f°C (%d %%)\n", sensor_temp, temp_percent);
166+
zbThermostat.printBoundDevices(Serial);
133167
}
134168
}

libraries/Zigbee/keywords.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ setLightColor KEYWORD2
107107
# ZigbeeThermostat
108108
onTempRecieve KEYWORD2
109109
onConfigRecieve KEYWORD2
110+
onTempReceiveWithSource KEYWORD2
110111
getTemperature KEYWORD2
111112
getSensorSettings KEYWORD2
112113
setTemperatureReporting KEYWORD2
@@ -142,14 +143,21 @@ setSensorType KEYWORD2
142143
setCarbonDioxide KEYWORD2
143144

144145
# ZigbeeAnalog
145-
addAnalogValue KEYWORD2
146146
addAnalogInput KEYWORD2
147147
addAnalogOutput KEYWORD2
148148
onAnalogOutputChange KEYWORD2
149-
setAnalogValue KEYWORD2
150149
setAnalogInput KEYWORD2
150+
setAnalogOutput KEYWORD2
151+
getAnalogOutput KEYWORD2
151152
reportAnalogInput KEYWORD2
153+
reportAnalogOutput KEYWORD2
152154
setAnalogInputReporting KEYWORD2
155+
setAnalogInputApplication KEYWORD2
156+
setAnalogInputDescription KEYWORD2
157+
setAnalogInputResolution KEYWORD2
158+
setAnalogOutputApplication KEYWORD2
159+
setAnalogOutputDescription KEYWORD2
160+
setAnalogOutputResolution KEYWORD2
153161

154162
# ZigbeeCarbonDioxideSensor
155163
setCarbonDioxide KEYWORD2
@@ -191,4 +199,4 @@ ZIGBEE_DEFAULT_COORDINATOR_CONFIG LITERAL1
191199
ZIGBEE_DEFAULT_RADIO_CONFIG LITERAL1
192200
ZIGBEE_DEFAULT_UART_RCP_RADIO_CONFIG LITERAL1
193201
ZIGBEE_DEFAULT_HOST_CONFIG LITERAL1
194-
ZB_ARRAY_LENTH LITERAL1
202+
ZB_ARRAY_LENGHT LITERAL1

0 commit comments

Comments
 (0)