Merge branch 'mega' of https://github.com/letscontrolit/ESPEasy into feature/Doc-updates-q2-2026

This commit is contained in:
Ton Huisman
2026-04-06 21:37:57 +02:00
234 changed files with 1730 additions and 1443 deletions
+2 -2
View File
@@ -89,8 +89,8 @@ dependencies.lock
src/src/CustomBuild/CompiletimeDefines_generated.h
sdkconfig.normal_ESP32solo1_4M316k
sdkconfig.*
src/Custom_.h
compile_commands.json
+3 -6
View File
@@ -6,6 +6,7 @@
"f_flash": "40000000L",
"flash_mode": "dio",
"mcu": "esp32",
"chip_variant": "esp32u",
"variant": "esp32",
"partitions": "boards/partitions/esp32_partition_app1810k_spiffs316k.csv"
},
@@ -30,12 +31,8 @@
"require_upload_port": true,
"speed": 460800
},
"espidf": {
"custom_sdkconfig": [
"CONFIG_FREERTOS_UNICORE=y",
"# CONFIG_BOOTLOADER_SPI_CUSTOM_WP_PIN is not set",
"CONFIG_BOOTLOADER_SPI_WP_PIN=7"
]
"download": {
"speed": 230400
},
"url": "https://en.wikipedia.org/wiki/ESP32",
"vendor": "Espressif"
+150 -82
View File
@@ -32,6 +32,7 @@ ESPEasy does support a number of variants of the processors manufactured by Espr
* **ESP32-solo1** Same as ESP32, but with 1 core, running at 160 MHz. Used in some commercially sold devices like the early editions of the orange Shelly modules.
* **ESP32-S2** Has more GPIO pins than the ESP32, but only 1 CPU core. Initial support in ESPEasy added since 2021-09-19.
* **ESP32-S3** Support added: 2023-05-03
* **ESP32-S31** Not yet supported
* **ESP32-C2 / ESP8684** Support added: 2023-11-10
* **ESP32-C3 / ESP8685** Support added: 2023-05-03
* **ESP32-C5** Preliminary support added: 2026-01-09
@@ -42,11 +43,12 @@ ESPEasy does support a number of variants of the processors manufactured by Espr
* **ESP32-H21** Not yet supported
* **ESP32-H4** Not yet supported
* **ESP32-P4** Support added: 2026-01-08
* **ESP32-P4rev3** Not yet supported
.. list-table:: Espressif platforms
:header-rows: 1
:widths: 7 7 7 7 7 7 7 7 7 7 7 7
:widths: 7 7 7 7 7 7 7 7 7 7 7 7 7
:stub-columns: 1
* -
@@ -54,49 +56,53 @@ ESPEasy does support a number of variants of the processors manufactured by Espr
- ESP32 (ESP32solo1)
- ESP32-S2
- ESP32-S3
- ESP32-S31
- ESP32-C2 (ESP8684)
- ESP32-C3 (ESP8685)
- ESP32-C5
- ESP32-C6
- ESP32-C61
- ESP32-H2
- ESP32-P4
- ESP32-P4
* - CPU
- Xtensa® single-core 32-bit L106
- Xtensa® dual-core 32-bit LX6 (solo1:single core)
- Xtensa® single-core 32-bit LX7
- Xtensa® dual-core 32-bit LX7
- 32-bit RISC-V dual-core processor
- 32-bit RISC-V single-core processor
- 32-bit RISC-V single-core processor
- 32-bit RISC-V single-core processor
- 32-bit RISC-V single-core processor
- 32-bit RISC-V single-core processor
- 32-bit RISC-V single-core processor
- 32-bit RISC-V dual-core processor up to 400 MHz with AI instruction extension and FPU for the HP system
- 32-bit RISC-V dual-core processor up to 400 MHz with AI instruction extension and FPU for the HP system
* - Core
- 1
- 2 (solo1:1)
- 1
- 2
- 1
- 1
- 1
- 1
- 1
- 1
- 2
- 1
- 1
- 1
- 1
- 1
- 1
- 2
* - Freq. (MHz)
- 80
- 240 (solo1:160)
- 240
- 240
- 320
- 120
- 160
- 240
- 160
- 120
- 96
- 360 (v1.x) / 400 (v3.x)
- 360 (v1.x) / 400 (v3.x)
* - Voltage (V)
- 2.5 ~ 3.6
- 3.0 ~ 3.6
@@ -109,66 +115,72 @@ ESPEasy does support a number of variants of the processors manufactured by Espr
- 3.0 ~ 3.6
- 3.0 ~ 3.6
- 3.0 ~ 3.6
- 3.0 ~ 3.6
* - ESPEasy supported since
- May-15
- 2026/05
- 2017/12 (solo1:2023/05)
- Sep-21
- May-23
- Nov-23
- May-23
-
- Nov-23
- 2021/09
- 2023/05
-
- 2023/11
- 2023/05
- 2026/01
- 2023/11
- 2026/01
- n/a
- Jan-26
- 2026/01
* - Introduction
- 2014
- 2016
- 2019
- 2021
- 2026
- 2022
- 2020
- 2022
- 2021
- 2024
- 2021
- 2023
- 2023
* - Status (2026/03)
- End-Of-Life
- Mass Production (solo1: NRND)
- NRND
- Mass Production
- Announced
- Mass Production
- Mass Production
- Mass Production
- Mass Production
- Mass Production
- Mass Production
- Mass Production
- Mass Production
* - Wi-Fi
- IEEE 802.11 b/g/n; 2.4 GHz; HT20; up to 72 Mbps
- IEEE 802.11 b/g/n; 2.4 GHz; HT20/40; up to 150 Mbps
- IEEE 802.11 b/g/n; 2.4 GHz; HT20/40; up to 150 Mbps
- IEEE 802.11 b/g/n; 2.4 GHz; HT20/40; up to 150 Mbps
- IEEE 802.11 b/g/n; 2.4 GHz; HT20/40; up to 150 Mbps
- IEEE 802.11 b/g/n; 2.4 GHz; HT20; up to 150 Mbps
- IEEE 802.11 b/g/n; 2.4 GHz; HT20/40; up to 150 Mbps
- IEEE 802.11 b/g/n; 2.4/5 GHz; HT20/40; up to 150 Mbps
- IEEE 802.11 b/g/n; 2.4 GHz; HT20/40; up to 150 Mbps
- IEEE 802.11 b/g/n; 2.4 GHz; HT20/40; up to 150 Mbps
- No Wi-Fi
- No Wi-Fi
- No Wi-Fi
* - Wi-Fi 6
-
-
-
-
- IEEE 802.11 ax; 2.4 GHz; HT20; up to 150 Mbps
-
-
- IEEE 802.11 ax; 2.4/5 GHz; HT20; up to 150 Mbps
- IEEE 802.11 ax; 2.4 GHz; HT20; up to 150 Mbps
- IEEE 802.11 ax; 2.4 GHz; HT20; up to 150 Mbps
-
-
-
* - 5 GHz Wi-Fi
-
-
@@ -176,83 +188,90 @@ ESPEasy does support a number of variants of the processors manufactured by Espr
-
-
-
-
- Yes
-
-
-
-
-
* - Zigbee / Thread (802.15.4)
- N/A
- N/A
- N/A
- N/A
- Available
- N/A
- N/A
- Available
- Available
- N/A
- Available
- N/A
- N/A
* - Bluetooth
- N/A
- BR/EDR + Bluetooth LE v4.2
- N/A
- Bluetooth LE v5.0
- Bluetooth LE+BR/EDR v5.4
- Bluetooth LE v5.0
- Bluetooth LE v5.0
- Bluetooth LE v5.0
- Bluetooth LE v5.3
- Bluetooth LE v5.0
- Bluetooth LE v5.0
- N/A
- N/A
* - SRAM (KB)
- 160
- 520
- 320
- 512
- 512
- 272
- 400
- 384
- 512
- 320
- 320
- 768
- 768
* - ROM (KB)
-
- 448
- 128
- 384
- 320
- 576
- 384
- 320
- 320
- 256
- 128
- 128
- 128
* - RTC SRAM (KB)
- 1
- 16
- 16
- 16
- 32
- 0
- 8
- 16
- 16
- 16
- 4
- 32
- 32
* - ADC
- 1*10-bit ADC, 1 channel
- 2*12-bit ADC, 18 channels
- 2*13-bit ADC, 20 channels
- 2*12-bit ADC, 20 channels
-
- 1*12-bit ADC, 5 channels
- 2*12-bit ADC, 6 channels
- 1*12-bit ADC, 6 channels
- 1*12-bit ADC, 7 channels
- 1*12-bit ADC, 4 channels
- 1*12-bit ADC, 5 channels
- 2*12-bit ADC, 14 channels
- 2*12-bit ADC, 14 channels
* - DAC
- 0
- 2*8-bit DAC
@@ -265,126 +284,137 @@ ESPEasy does support a number of variants of the processors manufactured by Espr
- 0
- 0
- 0
- 0
* - Touch
- 0
- 10
- 14
- 14
-
- 0
- 0
- 0
- 0
- 0
- 0
- 14
- 14
* - Temp Sensor
-
- 0
- 1
- 1
-
- 1
- 1
- 1
- 1
- 1
- 1
- 1
- 1
* - GPIO
- 16
- 26
- 37
- 36
- 61
- 14
- 15
- 22
- 30
- 18
- 19
- 55
- 55
* - Strapping GPIO
- 0, 2, 15
- 0, 2, 5, 12, 15
- 0, 45, 46
- 0, 3, 45, 46
-
- 8, 9
- 2, 8, 9
- 8, 9
- 4, 5, 8, 9, 15
- 4, 5, 8, 9, 15
- 8, 9
-
-
* - GPIO for flash/PSRAM
- 6, 7, 8, 9, 10, 11
- 6, 7, 8, 9, 10, 11 (PSRAM or embedded flash: 16, 17)
- 27, 28, 29, 30, 31, 32 (OPI: 33, 34, 35, 36, 37)
- 27, 28, 29, 30, 31, 32 (OPI: 33, 34, 35, 36, 37)
-
- 11, 12, 13, 14, 15, 16, 17
- 11, 12, 13, 14, 15, 16, 17
- 11, 12, 13, 14, 15, 16, 17
- 20, 21, 22, 24, 25, 26
- 20, 21, 22, 24, 25, 26
-
- N/A
- N/A
* - UART
- 1.5 (Serial1 out only)
- 3
- 2
- 3
- 4
- 2
- 2
- 3
- 2
- 2
- 2
- 5
- 5
* - SPI
- 2
- 4
- 4
- 4
-
- 3
- 3
- 1
- 1
- 1
- 3
- 5
- 5
* - SDIO HOST
-
- 1
- 0
- 2
-
- 0
- 0
- 0
- 0
- 0
- 0
- 1
- 1
* - SDIO SLAVE
-
- 1
- 0
- 0
-
- 0
- 0
- 0
- 1
- 1
- 0
- 1
- 1
* - I2C
- 1(soft)
- 2
- 2
- 2
-
- 1
- 1
- 2
- 2
- 1
- 2
- 3
- 3
* - I3C
-
-
@@ -396,79 +426,86 @@ ESPEasy does support a number of variants of the processors manufactured by Espr
-
-
-
- 1
-
- 1
* - I2S
- 1
- 2
- 1
- 2
-
- 0
- 1
- 1
- 1
- 1
- 1
- 3
- 3
* - RMT
- 0
- 1*8 channels
- 1*4 channels
- 1*4 channels
-
- 0
- 1*4 channels
- 1 channel
- 1*4 channels
-
- 1*2 channels
- 1*4 channels
- 1*4 channels
* - LEDC PWM
- 0
- 2*8 channels
- 1*8 channels
- 1*8 channels
-
- 1*6 channels
- 1*6 channels
- 1*6 channels
- 1*6 channels
- 1*6 channels
- 1*6 channels
- 1*8 channels
- 1*8 channels
* - MCPWM
- 0
- 2
- 0
- 2
-
- 0
- 0
- 0
- 1
- 0
- 1
- 2
- 2
* - USB OTG
- 0
- 0
- 1
- 1
- 1
- 0
- 0
- 0
- 0
- 0
- 0
- 2
- 2
* - USB Serial / JTAG
- N/A
- N/A
- YES
- YES
- YES
- N/A
- YES
- N/A
- YES
- YES
- YES
- YES
- YES
* - Hall
- 0
- 1 (removed in ESP-IDF5)
@@ -481,30 +518,33 @@ ESPEasy does support a number of variants of the processors manufactured by Espr
- 0
- 0
- 0
- 0
* - Ethernet
- 0
- 1 (RMII and SPI)
- 1 (SPI)
- 1 (SPI)
- 1 (RMII Gbit and SPI)
- 1 (SPI)
- 1 (SPI)
- 1 (SPI)
- 1 (SPI)
- 1 (SPI)
- 0
- 1 (RMII and SPI)
- 1 (RMII and SPI)
* - TWAI (CAN)
- 0
- 1
- 1
- 1
- 1
- 0
- 1
- 2
- 2
- 2
- 1
- 3
- 3
* - JTAG
-
- YES
@@ -517,18 +557,20 @@ ESPEasy does support a number of variants of the processors manufactured by Espr
- YES
- YES
- YES
- YES
* - Camera
- N/A
- 1*DVP 8/16-bit
- 1*DVP 8/16-bit
- 1*DVP 8/16-bit
- N/A
- N/A
- N/A
- N/A
- N/A
- N/A
- 1*DVP 8/16-bit
- N/A
- N/A
- N/A
- N/A
- N/A
- N/A
- 1*DVP 8/16-bit
* - TOF
- N/A
- N/A
@@ -541,66 +583,73 @@ ESPEasy does support a number of variants of the processors manufactured by Espr
- N/A
- N/A
- N/A
- N/A
* - BT Certification
-
- BT SIG
-
- BT SIG
-
-
- BT SIG
-
- BQB
-
-
-
-
* - Wi-Fi Certification
- WPA 2
- Wi-Fi Alliance/WPA 3
- Wi-Fi Alliance/WPA 3
-
-
- WFA
-
-
-
-
-
-
-
* - Green Certification
-
- RoHS/REACH
- RoHS/REACH
- RoHS/REACH
-
- RoHS/REACH
- RoHS/REACH
-
- RoHS/REACH
- RoHS/REACH
-
-
-
* - RF Certification
-
- FCC / CE-RED / IC / TELEC / KCC / SRRC / NCC
- FCC / CE-RED / SRRC / IC
- SRRC / CE / FCC / IC / MIC / NCC / KCC
-
- SRRC
- FCC / CE-RED / SRRC / IC
-
-
-
-
-
-
* - Sleep Power Consumption
- 900 µA light sleep, 20 µA deep sleep
- 800 µA light sleep, 10 µA deep sleep
- 750 µA light sleep, 25 µA deep sleep
- 240 µA light sleep, 8 µA deep sleep
-
- 140 µA light sleep, 5 µA deep sleep
- 130 µA light sleep, 5 µA deep sleep
-
- 180 µA / 35 µA light sleep, 7 µA deep sleep
-
-
-
-
Sources:
@@ -614,31 +663,36 @@ Sources:
Datasheets
==========
* `DS:ESP8266 (ESP8285) <https://www.espressif.com/sites/default/files/documentation/0a-esp8266ex_datasheet_en.pdf>`_
* `DS:ESP32 <https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf>`_ / `DS:ESP32-solo1 <https://www.espressif.com/sites/default/files/documentation/esp32-solo-1_datasheet_en.pdf>`_
* `DS:ESP32-S2 <https://www.espressif.com/sites/default/files/documentation/esp32-s2_datasheet_en.pdf>`_
* `DS:ESP32-S3 <https://www.espressif.com/sites/default/files/documentation/esp32-s3_datasheet_en.pdf>`_
* `DS:ESP32-C3 <https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf>`_ / `DS:ESP8685 <https://www.espressif.com/sites/default/files/documentation/esp8685_datasheet_en.pdf>`_
* `DS:ESP32-C2 <https://www.espressif.com/sites/default/files/documentation/esp8684_datasheet_en.pdf>`_ / `DS:ESP8684 <https://www.espressif.com/sites/default/files/documentation/esp8684_datasheet_en.pdf>`_
* `DS:ESP32-C5 <https://www.espressif.com/sites/default/files/documentation/esp32-c5_datasheet_en.pdf>`_
* `DS:ESP32-C6 <https://www.espressif.com/sites/default/files/documentation/esp32-c6_datasheet_en.pdf>`_
* `DS:ESP32-H2 <https://cdn-shop.adafruit.com/product-files/5715/esp32-h2_datasheet_en.pdf>`_
* `DS:ESP32-P4 <https://www.espressif.com/sites/default/files/documentation/esp32-p4_datasheet_en.pdf>`_
* `DS:ESP8266 <https://documentation.espressif.com/0a-esp8266ex_datasheet_en.pdf>`_
* `DS:ESP8285 <https://documentation.espressif.com/0a-esp8285_datasheet_en.pdf>`_
* `DS:ESP32 <https://documentation.espressif.com/esp32_datasheet_en.pdf>`_
* `DS:ESP32-S2 <https://documentation.espressif.com/esp32-s2_datasheet_en.pdf>`_
* `DS:ESP32-S3 <https://documentation.espressif.com/esp32-s3_datasheet_en.pdf>`_
* `DS:ESP32-C2 <https://documentation.espressif.com/esp8684_datasheet_en.pdf>`_
* `DS:ESP32-C3 <https://documentation.espressif.com/esp32-c3_datasheet_en.pdf>`_
* `DS:ESP32-C5 <https://documentation.espressif.com/esp32-c5_datasheet_en.pdf>`_
* `DS:ESP32-C6 <https://documentation.espressif.com/esp32-c6_datasheet_en.pdf>`_
* `DS:ESP32-C61 <https://documentation.espressif.com/esp32-c61_datasheet_en.pdf>`_
* `DS:ESP32-H2 <https://documentation.espressif.com/esp32-h2_datasheet_en.pdf>`_
* `DS:ESP32-P4 <https://documentation.espressif.com/esp32-p4_datasheet_en.pdf>`_
* `DS:ESP32-P4 v1.3 <https://documentation.espressif.com/esp32-p4-chip-revision-v1.3_datasheet_en.pdf>`_
Technical Reference Manuals
===========================
* `TR:ESP8266 <https://www.espressif.com/sites/default/files/documentation/esp8266-technical_reference_en.pdf>`_
* `TR:ESP32 <https://www.espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_en.pdf>`_
* `TR:ESP32-S2 <https://www.espressif.com/sites/default/files/documentation/esp32-s2_technical_reference_manual_en.pdf>`_
* `TR:ESP32-S3 <https://www.espressif.com/sites/default/files/documentation/esp32-s3_technical_reference_manual_en.pdf>`_
* `TR:ESP32-C3 <https://www.espressif.com/sites/default/files/documentation/esp32-c3_technical_reference_manual_en.pdf>`_
* `TR:ESP32-C2 <https://www.espressif.com/sites/default/files/documentation/esp8684_technical_reference_manual_en.pdf>`_
* `TR:ESP32-C5 <https://www.espressif.com/sites/default/files/documentation/esp32-c5_technical_reference_manual_en.pdf>`_
* `TR:ESP32-C6 <https://www.espressif.com/sites/default/files/documentation/esp32-c6_technical_reference_manual_en.pdf>`_
* `TR:ESP32-H2 <https://www.espressif.com/sites/default/files/documentation/esp32-h2_technical_reference_manual_en.pdf>`_
* `TR:ESP32-P4 <https://www.espressif.com/sites/default/files/documentation/esp32-p4_technical_reference_manual_en.pdf>`_
* `TR:ESP8266 <https://documentation.espressif.com/esp8266-technical_reference_en.pdf>`_
* `TR:ESP32 <https://documentation.espressif.com/esp32_technical_reference_manual_en.pdf>`_
* `TR:ESP32-S2 <https://documentation.espressif.com/esp32-s2_technical_reference_manual_en.pdf>`_
* `TR:ESP32-S3 <https://documentation.espressif.com/esp32-s3_technical_reference_manual_en.pdf>`_
* `TR:ESP32-C2 <https://documentation.espressif.com/esp8684_technical_reference_manual_en.pdf>`_
* `TR:ESP32-C3 <https://documentation.espressif.com/esp32-c3_technical_reference_manual_en.pdf>`_
* `TR:ESP32-C5 <https://documentation.espressif.com/esp32-c5_technical_reference_manual_en.pdf>`_
* `TR:ESP32-C6 <https://documentation.espressif.com/esp32-c6_technical_reference_manual_en.pdf>`_
* `TR:ESP32-C61 <https://documentation.espressif.com/esp32-c61_technical_reference_manual_en.pdf>`_
* `TR:ESP32-H2 <https://documentation.espressif.com/esp32-h2_technical_reference_manual_en.pdf>`_
* `TR:ESP32-P4 <https://documentation.espressif.com/esp32-p4_technical_reference_manual_en.pdf>`_
* `TR:ESP32-P4 v1.3 <https://documentation.espressif.com/esp32-p4-chip-revision-v1.3_technical_reference_manual_en.pdf>`_
ESP8266/ESP8285
@@ -849,6 +903,13 @@ Build versions:
* The default SPI mode will be quad mode for both flash and PSRAM
* ``max_ESP32s3_16M8M_LittleFS_OPI_PSRAM_CDC`` will have quad mode for flash and octal (OPI) mode for PSRAM. (typical 8MB PSRAM)
ESP32-S31
=========
There is not yet much known about the ESP32-S31.
Announcement `here <https://www.espressif.com/en/news/ESP32_S31_Release>`_
ESP32-C2/ESP8684
================
@@ -883,9 +944,10 @@ Due to the RISC-V core used in the ESP32-C3, this is a very 'snappy' device and
ESP32-C5
========
Added: 2026/01/26
This will be the first Espressif SoC supporting 5 GHz WiFi.
.. note:: Beta silicon is available (as of June 2025), which may change in Q3 or Q4 of 2025. So not yet adviced to be used in real products
ESP32-C6
========
@@ -900,9 +962,9 @@ It is the more powerful version of the ESP32-H2 and also includes not only the t
ESP32-C61
=========
This is a stripped-down version of the ESP32-C6, but with PSRAM versions available.
Added: 2026/01/26
.. note:: Not yet available (as of Dec 2024)
This is a stripped-down version of the ESP32-C6, but with PSRAM versions available.
@@ -930,3 +992,9 @@ It does have a RMII interface for Ethernet, like the ESP32-classic does.
.. note:: Not yet supported. Beta silicon is available (as of June 2025), which may change in Q3 or Q4 of 2025. So not yet adviced to be used in real products
ESP32-P4 rev3.x
===============
New revision of the ESP32-P4, which is incompatible with the initial P4.
.. note:: Not yet supported (as of March 2026)
+2 -2
View File
@@ -1035,9 +1035,9 @@
"
WifiAPMode","
:red:`Internal`","
Force the unit into AP mode.
Force the unit into AP mode or turn AP mode off.
``WifiAPMode``"
``WifiAPMode,<on|off|1|0>``"
"
WifiConnect","
:red:`Internal`","
@@ -19,10 +19,10 @@ public:
void begin(long speed);
void end();
int peek(void);
int peek(void) override;
size_t write(uint8_t val) override;
size_t write(const uint8_t *buffer,
size_t size);
size_t size) override;
int read(void) override;
size_t readBytes(char *buffer,
size_t size) override;
+25 -4
View File
@@ -35,6 +35,27 @@
#include <Stream.h>
// Different versions of Stream/Print class have different virtual attributes.
// Therefore we need to use the 'override' statement different for a few functions.
#ifdef ESP8266
#ifdef CORE_POST_3_0_0
#define READ_OVERRIDE override
#define VERSION_DEP_OVERRIDE override
#else
#define READ_OVERRIDE
#define VERSION_DEP_OVERRIDE
#endif
#endif
#ifdef ESP32
#define READ_OVERRIDE
#define VERSION_DEP_OVERRIDE override
#endif
// ESP82xx has 2 HW serial ports and option for several software serial ports.
// Serial0: RX: 3 TX: 1
// Serial0 swapped RX: 13 TX: 15
@@ -86,12 +107,12 @@ public:
#endif // ifdef ESP32
void end();
int peek(void);
int peek(void) override;
size_t write(uint8_t val) override;
int read(void) override;
int read(uint8_t *buffer, size_t size);
int read(uint8_t *buffer, size_t size) READ_OVERRIDE;
int available(void) override;
int availableForWrite(void);
int availableForWrite(void) VERSION_DEP_OVERRIDE;
void flush(void) override;
@@ -111,7 +132,7 @@ public:
// HardwareSerial specific:
size_t write(const uint8_t *buffer,
size_t size);
size_t size) override;
size_t write(const char *buffer);
int getBaudRate() const;
@@ -115,8 +115,7 @@ int Port_ESPEasySerial_USB_HWCDC_t::available(void)
int Port_ESPEasySerial_USB_HWCDC_t::availableForWrite(void)
{
if (_hwcdc_serial != nullptr && _hwcdc_serial->isConnected()) {
const int res = _hwcdc_serial->availableForWrite();
return res > 64 ? 64 : res;
return _hwcdc_serial->availableForWrite();
}
return 0;
}
+2
View File
@@ -1,3 +1,4 @@
#if ESP_IDF_VERSION_MAJOR <= 5
// WARNING: This file contains code that is more than likely already
// exposed from the Esp32 Arduino API. It will be removed once integration is complete.
//
@@ -499,3 +500,4 @@ size_t i2sWrite(uint8_t bus_num, uint8_t* data, size_t len, bool copy, bool free
#endif //ESP_IDF_VERSION_MAJOR < 5
#endif // defined(ARDUINO_ARCH_ESP32)
#endif
+4 -1
View File
@@ -2,6 +2,8 @@
#include "sdkconfig.h" // this sets useful config symbols, like CONFIG_IDF_TARGET_ESP32C3
#if ESP_IDF_VERSION_MAJOR <= 5
#ifndef CONFIG_SOC_RMT_TX_CANDIDATES_PER_GROUP // turn this off with something new from idf5.1
// ESP32C3 I2S is not supported yet due to significant changes to interface
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C5) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C2)
@@ -42,4 +44,5 @@ bool i2sWriteDone(uint8_t bus_num);
}
#endif
#endif
#endif // ESP_IDF_VERSION_MAJOR < 5
#endif
#endif
@@ -403,7 +403,12 @@ public:
ESP_ERROR_CHECK( rmt_disable(_channel.RmtChannelNumber));
ESP_ERROR_CHECK( rmt_del_channel(_channel.RmtChannelNumber));
#if ESP_IDF_VERSION_MAJOR < 6
gpio_matrix_out(_pin, 0x100, false, false);
#else
gpio_reset_pin((gpio_num_t)_pin);
// pinMatrixOutAttach(_pin, 0x100, false, false);
#endif
pinMode(_pin, INPUT);
free(_dataEditing);
@@ -457,8 +462,13 @@ public:
config.resolution_hz = RMT_LED_STRIP_RESOLUTION_HZ; // 1 MHz tick resolution, i.e., 1 tick = 1 µs
config.trans_queue_depth = 2; // set the number of transactions that can pend in the background
config.intr_priority = 0;
#if ESP_IDF_VERSION_MAJOR < 6
config.flags.io_loop_back = 0;
config.flags.io_od_mode = 0;
#else
config.flags.allow_pd = 0;
config.flags.init_level = 0;
#endif
config.flags.invert_out = false; // do not invert output signal
config.flags.with_dma = NEOESP32_RMT_FLAGS_WITH_DMA;
@@ -32,6 +32,9 @@ License along with NeoPixel. If not, see
#if !defined(CONFIG_IDF_TARGET_ESP32C5) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C2) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32C61) && !defined(CONFIG_IDF_TARGET_ESP32P4)
#if !defined(ARDUINO_ARCH_ESP8266)
#include "soc/gpio_periph.h"
#if ESP_IDF_VERSION_MAJOR >= 6
#include "soc/gpio_struct.h"
#endif
#endif
static inline uint32_t getCycleCount(void)
+5 -5
View File
@@ -38,15 +38,15 @@ public:
void begin(long speed);
int peek();
int peek() override;
virtual size_t write(uint8_t byte);
virtual size_t write(uint8_t byte) override;
virtual int read();
virtual int read() override;
virtual int available();
virtual int available() override;
virtual void flush();
virtual void flush() override;
};
+1 -1
View File
@@ -248,7 +248,7 @@ class OLEDDisplay : public Print {
void drawLogBuffer(uint16_t x, uint16_t y);
// Implementent needed function to be compatible with Print class
size_t write(uint8_t c);
size_t write(uint8_t c) override;
size_t write(const char* s);
uint8_t *buffer = NULL;
+18 -10
View File
@@ -32,6 +32,7 @@
[esp82xx_defaults]
build_flags = -D NDEBUG
-DESP8266
-lstdc++ -lsupc++
-mtarget-align
-DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY
@@ -70,10 +71,13 @@ lib_ignore = ESP32_ping
; Suggestion to go for -Os: https://www.youtube.com/watch?v=cqHH2NXcf5E
[esp82xx_2_7_x]
build_flags = -DNDEBUG
-DESP8266
-mtarget-align
-DVTABLES_IN_FLASH
-fno-exceptions
-lstdc++
; NONOSDK22x_190703 = 2.2.2-dev(38a443e)
-DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_190703
-DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH_LOW_FLASH
-DPUYA_SUPPORT=1
-DCORE_POST_2_5_0
@@ -100,6 +104,7 @@ lib_ignore = ${esp82xx_defaults.lib_ignore}
[esp82xx_3_0_x]
build_flags = ${esp82xx_2_7_x.build_flags}
-DCORE_POST_3_0_0
-DESP8266
-Wno-deprecated-declarations
; -flto=auto
; -Wl,-flto
@@ -117,8 +122,7 @@ extra_scripts = pre:tools/pio/pre_custom_esp8266_toolchain.py
[core_2_7_4]
extends = esp82xx_2_7_x
platform = espressif8266@2.6.3
platform_packages =
framework-arduinoespressif8266 @ https://github.com/esp8266/Arduino.git#2.7.4
platform_packages = framework-arduinoespressif8266 @ https://github.com/esp8266/Arduino.git#2.7.4
build_flags = ${esp82xx_2_7_x.build_flags}
-DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_190703
-DUSES_LATEST_SOFTWARE_SERIAL_LIBRARY=0
@@ -174,8 +178,17 @@ extra_scripts = ${esp82xx_common.extra_scripts}
;platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF55_gcc15
;platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/1002-1125-5.5_gcc151/framework-arduinoespressif32-release_v5.5_gcc151-7eede06a.tar.xz
;platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF55_gcc152
;platform_packages =
;platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF55_gcc15
;platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/1002-1125-5.5_gcc151/framework-arduinoespressif32-release_v5.5_gcc151-7eede06a.tar.xz
;platform = https://github.com/Jason2866/platform-espressif32.git#IDF6
;platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/2403-0020-6.0/framework-arduinoespressif32-release_v6.0-1a97ddaa.tar.xz
platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF55_gcc152
platform_packages =
platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/2703-1841-5.5/framework-arduinoespressif32-release_v5.5-4e75642b.tar.xz
custom_remove_include = true
@@ -193,6 +206,7 @@ custom_component_remove =
espressif/rmaker_common
build_flags = -DESP32_STAGE
; -DESP_IDF_VERSION_MAJOR=6
-DESP_IDF_VERSION_MAJOR=5
-DLIBRARIES_NO_LOG=1
-DDISABLE_SC16IS752_SPI
@@ -224,13 +238,7 @@ build_flags = -DESP32_STAGE
-DNO_GLOBAL_SPIFFS
-DNO_GLOBAL_OPENTHREADCLI
-DNO_GLOBAL_WIFIPROV
; -Wsuggest-override
lib_ignore = BLE
Zigbee
+2 -1
View File
@@ -33,7 +33,8 @@ build_flags = ${core_esp32_IDF5_5_1__3_3_3_LittleFS.build_flags}
; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE
-DLWIP_IPV6=1
-DCONFIG_BT_NIMBLE_NVS_PERSIST=y
monitor_filters = esp32_exception_decoder
;monitor_filters = esp32_exception_decoder
monitor_filters = direct
lib_ignore =
${core_esp32_IDF5_5_1__3_3_3_LittleFS.lib_ignore}
@@ -1,16 +1,12 @@
#include "../DataStructs/NWPluginData_base.h"
#include "../../../src/DataStructs/ESPEasy_EventStruct.h"
#include "../../../src/Globals/RuntimeData.h"
#include "../../../src/Globals/Settings.h"
#include "../../../src/Helpers/StringConverter.h"
#if FEATURE_STORE_NETWORK_INTERFACE_SETTINGS
# include "../../../src/Helpers/_ESPEasy_key_value_store.h"
#include "../_NWPlugin_Helper.h"
#endif
#ifdef ESP32
# include "../Globals/NetworkState.h"
# include <esp_netif.h>
# include <esp_netif_types.h>
#endif // ifdef ESP32
@@ -13,6 +13,11 @@
#endif
#if FEATURE_MDNS
//#include "../../../src/Helpers/MDNS_Helper.h"
#endif
namespace ESPEasy {
namespace net {
@@ -23,7 +28,7 @@ namespace net {
typedef std::map<int, TX_RX_traffic_count> InterfaceTrafficCount_t;
static InterfaceTrafficCount_t interfaceTrafficCount;
static InterfaceTrafficCount_t interfaceTrafficCount{};
static void tx_rx_event_handler(void *arg, esp_event_base_t event_base,
int32_t event_id, void *event_data)
@@ -190,6 +195,9 @@ void NWPluginData_static_runtime::processEvents()
}
# endif // ifndef BUILD_NO_DEBUG
#endif // ifdef ESP8266
#if FEATURE_MDNS
// update_mDNS();
#endif
}
#if FEATURE_USE_IPV6
@@ -216,6 +224,9 @@ void NWPluginData_static_runtime::processEvents()
}
}
}
#if FEATURE_MDNS
// update_mDNS();
#endif
}
#endif // if FEATURE_USE_IPV6
@@ -240,6 +251,17 @@ void NWPluginData_static_runtime::processEvents()
}
#endif // if FEATURE_NETWORK_TRAFFIC_COUNT
#ifdef ESP8266
if (!_isAP) {
// Check for priority changes on ESP8266 is essentially a check to see
// if we were connected via WiFi or not.
// So we can call priority route changed here
String dummy;
ESPEasy::net::NWPluginCall(NWPlugin::Function::NWPLUGIN_PRIORITY_ROUTE_CHANGED, 0, dummy);
}
#endif // ifdef ESP8266
// Send out event
if (Settings.UseRules && _eventInterfaceName.length())
{
@@ -12,7 +12,6 @@
#endif
#include <map>
#include <list>
namespace ESPEasy {
namespace net {
@@ -173,7 +172,7 @@ private:
// This depends on host and interface.
// Duration is negative when it was suggested but not actually set.
// Duration is positive when actually being set
mutable std::map<int, int32_t>_connectDurations;
mutable std::map<int, int32_t> _connectDurations{};
mutable uint32_t _connectionFailures{};
@@ -95,7 +95,12 @@ void NWPluginData_static_runtime::mark_start()
if (!_netif) { return; }
_netif->setHostname(NetworkCreateRFCCompliantHostname().c_str());
const String hostname = strformat(
F("%s-%s"),
NetworkCreateRFCCompliantHostname().c_str(),
_eventInterfaceName.c_str());
_netif->setHostname(hostname.c_str());
# if FEATURE_USE_IPV6
_netif->enableIPv6(_enableIPv6);
# endif
@@ -2,9 +2,10 @@
#ifdef ESP8266
# include "../../../src/Helpers/StringConverter.h"
# include "../Globals/NetworkState.h"
# include "../ESPEasyNetwork.h"
# include "../../../src/Helpers/StringConverter.h"
namespace ESPEasy {
namespace net {
@@ -73,9 +74,7 @@ void NWPluginData_static_runtime::mark_begin_establish_connection()
_establishConnectStats.forceSet(true);
_connectedStats.setOff();
_operationalStats.setOff();
const String hostname = NetworkCreateRFCCompliantHostname();
wifi_station_set_hostname(hostname.c_str());
WiFi.hostname(hostname.c_str());
WiFi.hostname(NetworkCreateRFCCompliantHostname().c_str());
}
void NWPluginData_static_runtime::mark_connected()
@@ -4,7 +4,6 @@
#include "../DataTypes/NetworkIndex.h"
#include <vector>
namespace ESPEasy {
namespace net {
@@ -1,14 +1,5 @@
#include "../DataStructs/NetworkSettingsStruct.h"
#include "../../../ESPEasy_common.h"
#include "../../../src/CustomBuild/ESPEasyLimits.h"
#include "../../../src/ESPEasyCore/ESPEasy_Log.h"
#include "../ESPEasyNetwork.h"
#include "../../../src/Helpers/Misc.h"
#include "../../../src/Helpers/Networking.h"
#include "../../../src/Helpers/StringConverter.h"
#include <IPAddress.h>
#include <WString.h>
@@ -5,10 +5,6 @@
\*********************************************************************************************/
#include "../../../ESPEasy_common.h"
#include <memory> // For std::unique_ptr
#include <new> // for std::nothrow
#include "../../../src/Globals/Plugins.h"
#include "../../../src/Helpers/Memory.h"
namespace ESPEasy {
@@ -1,8 +1,5 @@
#include "../DataStructs/WiFi_AP_Candidate.h"
#include "../../../ESPEasy_common.h"
#include "../Globals/ESPEasyWiFiEvent.h"
#include "../../../src/Globals/SecuritySettings.h"
#include "../../../src/Globals/Statistics.h"
#include "../../../src/Helpers/ESPEasy_time_calc.h"
@@ -324,8 +321,13 @@ String WiFi_AP_Candidate::toString(const String& separator) const {
switch (bandwidth)
{
#if ESP_IDF_VERSION_MAJOR < 6
case WIFI_BW_HT20: break;
case WIFI_BW_HT40: phy_str += F(" 40 MHz");
#else
case WIFI_BW20: break;
case WIFI_BW40: phy_str += F(" 40 MHz");
#endif
break;
case WIFI_BW80: phy_str += F(" 80 MHz");
break;
@@ -6,6 +6,8 @@
#if FEATURE_WIFI
#include <list>
namespace ESPEasy {
namespace net {
namespace wifi {
@@ -80,7 +82,11 @@ struct WiFi_AP_Candidate {
# ifdef ESP32
# if ESP_IDF_VERSION_MAJOR >= 5
wifi_country_t country;
#if ESP_IDF_VERSION_MAJOR < 6
wifi_bandwidth_t bandwidth{ WIFI_BW_HT20 };
#else
wifi_bandwidth_t bandwidth{ WIFI_BW20 };
#endif
# endif // if ESP_IDF_VERSION_MAJOR >= 5
# endif // ifdef ESP32
@@ -115,6 +121,11 @@ struct WiFi_AP_Candidate {
};
typedef std::list<WiFi_AP_Candidate> WiFi_AP_Candidate_List_t;
typedef WiFi_AP_Candidate_List_t::const_iterator WiFi_AP_Candidate_const_iterator;
} // namespace wifi
} // namespace net
} // namespace ESPEasy
@@ -1,7 +1,5 @@
#include "../DataTypes/NetworkIndex.h"
#include "../../../src/CustomBuild/ESPEasyLimits.h"
namespace ESPEasy {
namespace net {
+2 -2
View File
@@ -100,8 +100,8 @@ void CheckRunningServices() {
#endif // if FEATURE_WIFI
#if FEATURE_MDNS
set_mDNS();
#endif
update_mDNS();
#endif
}
uint64_t NetworkConnectDuration_ms()
+3 -10
View File
@@ -2,19 +2,12 @@
#include "../net/ESPEasyNetwork.h"
#include "../../src/ESPEasyCore/ESPEasy_Log.h"
#include "../net/eth/ESPEasyEth.h"
#include "../net/wifi/ESPEasyWifi.h"
#include "../../src/Globals/ESPEasy_time.h"
#include "../../ESPEasy/net/Globals/ESPEasyWiFiEvent.h"
#include "../../ESPEasy/net/Globals/NetworkState.h"
#include "../../src/Globals/Settings.h"
#include "../../src/ESPEasyCore/ESPEasy_Log.h"
#include "../../src/Helpers/NetworkStatusLED.h"
#include "../../src/Helpers/Networking.h"
#include "../../src/Helpers/StringConverter.h"
#include "../../src/Helpers/MDNS_Helper.h"
#include "../net/eth/ESPEasyEth.h"
#include "../net/Globals/NWPlugins.h"
#include <NetworkManager.h>
-1
View File
@@ -4,7 +4,6 @@
#if FEATURE_WIFI
# include "../wifi/ESPEasyWifi.h"
# include "../wifi/ESPEasyWiFi_state_machine.h"
extern ESPEasy::net::wifi::ESPEasyWiFi_t ESPEasyWiFi;
@@ -1,7 +1,5 @@
#include "../Globals/ESPEasyWiFiEvent.h"
#include "../../../ESPEasy_common.h"
#if FEATURE_WIFI
# ifdef ESP8266
+53 -31
View File
@@ -1,20 +1,25 @@
#include "../Globals/NWPlugins.h"
#include "../../../_Plugin_Helper.h"
#include "../../../src/DataStructs/ESPEasy_EventStruct.h"
#include "../../../src/DataStructs/TimingStats.h"
#include "../../../src/DataTypes/ESPEasy_plugin_functions.h"
#include "../../../src/ESPEasyCore/ESPEasy_Log.h"
#ifdef ESP32
#include "../../../src/Globals/SecuritySettings.h"
#include "../../../src/Globals/Settings.h"
#include "../../../src/Helpers/PrintToString.h"
#include "../Helpers/_NWPlugin_init.h"
#include "../Helpers/NWAccessControl.h"
#include "../_NWPlugin_Helper.h"
#if FEATURE_ETHERNET
# include "../eth/ETH_NWPluginData_static_runtime.h"
#endif
#include "../../../src/Globals/Settings.h"
#include "../Helpers/_NWPlugin_init.h"
#ifdef ESP32
#include "../Helpers/NWAccessControl.h"
#endif
#include "../../../src/Globals/ESPEasy_Scheduler.h"
#include "../_NWPlugin_Helper.h"
#ifdef ESP8266
#include "../wifi/ESPEasyWifi.h"
#endif
#include "../ESPEasyNetwork.h"
namespace ESPEasy {
@@ -59,15 +64,11 @@ bool NWPluginCall(NWPlugin::Function Function, EventStruct *event, String& str)
case NWPlugin::Function::NWPLUGIN_FIFTY_PER_SECOND:
case NWPlugin::Function::NWPLUGIN_WRITE:
case NWPlugin::Function::NWPLUGIN_WEBSERVER_SHOULD_RUN:
#ifdef ESP32
case NWPlugin::Function::NWPLUGIN_PRIORITY_ROUTE_CHANGED:
#endif
{
// Set to true where return value doesn't matter
bool success =
#ifdef ESP32
Function != NWPlugin::Function::NWPLUGIN_PRIORITY_ROUTE_CHANGED &&
#endif
Function != NWPlugin::Function::NWPLUGIN_WRITE &&
Function != NWPlugin::Function::NWPLUGIN_WEBSERVER_SHOULD_RUN;
@@ -84,13 +85,11 @@ bool NWPluginCall(NWPlugin::Function Function, EventStruct *event, String& str)
if (Settings.getNWPluginID_for_network(x) && checkedEnabled) {
if (Function == NWPlugin::Function::NWPLUGIN_INIT_ALL) {
if (!Settings.getNetworkInterface_isFallback(x)) {
Scheduler.setNetworkInitTimer(Settings.getNetworkInterfaceStartupDelay(x), x);
}
Scheduler.setNetworkInitTimer(Settings.getNetworkInterfaceStartupDelay(x), x);
}
if (Function == NWPlugin::Function::NWPLUGIN_WEBSERVER_SHOULD_RUN &&
Settings.getNetworkInterfaceSubnetBlockClientIP(x))
if ((Function == NWPlugin::Function::NWPLUGIN_WEBSERVER_SHOULD_RUN) &&
Settings.getNetworkInterfaceSubnetBlockClientIP(x))
{
// Skip check for this network interface as access to the web UI should be blocked anyway
} else {
@@ -107,11 +106,12 @@ bool NWPluginCall(NWPlugin::Function Function, EventStruct *event, String& str)
if (!currentDefaultInterface) {
String dummy;
if (do_NWPluginCall(
getNetworkDriverIndex_from_NetworkIndex(x),
NWPlugin::Function::NWPLUGIN_FALLBACK_INTERFACE_SHOULD_START,
event,
dummy))
getNetworkDriverIndex_from_NetworkIndex(x),
NWPlugin::Function::NWPLUGIN_FALLBACK_INTERFACE_SHOULD_START,
event,
dummy))
{
// No current default interface, thus we need to start this one.
Scheduler.setNetworkInitTimer(Settings.getNetworkInterfaceStartupDelay(x), x);
@@ -135,6 +135,29 @@ bool NWPluginCall(NWPlugin::Function Function, EventStruct *event, String& str)
}
}
#endif // ifdef ESP32
#ifdef ESP8266
if ((Function == NWPlugin::Function::NWPLUGIN_PRIORITY_ROUTE_CHANGED) &&
Settings.getNetworkInterface_isFallback(x))
{
if (!ESPEasy::net::wifi::WiFiConnected()) {
String dummy;
if (do_NWPluginCall(
getNetworkDriverIndex_from_NetworkIndex(x),
NWPlugin::Function::NWPLUGIN_FALLBACK_INTERFACE_SHOULD_START,
event,
dummy))
{
// No current default interface, thus we need to start this one.
Scheduler.setNetworkInitTimer(Settings.getNetworkInterfaceStartupDelay(x), x);
}
} else {
// TODO TD-er: What to do when performing the setup process?
Scheduler.setNetworkExitTimer(10, x);
}
}
#endif // ifdef ESP8266
String command;
if (Function == NWPlugin::Function::NWPLUGIN_WRITE) {
@@ -156,12 +179,11 @@ bool NWPluginCall(NWPlugin::Function Function, EventStruct *event, String& str)
}
}
}
#ifdef ESP32
if (Function == NWPlugin::Function::NWPLUGIN_PRIORITY_ROUTE_CHANGED) {
CheckRunningServices();
}
#endif // ifdef ESP32
return success;
}
@@ -302,14 +324,14 @@ bool NWPluginCall(NWPlugin::Function Function, EventStruct *event, String& str)
// calls to specific network which need to be enabled before calling
case NWPlugin::Function::NWPLUGIN_INIT:
case NWPlugin::Function::NWPLUGIN_CONNECT_SUCCESS:
case NWPlugin::Function::NWPLUGIN_CONNECT_FAIL:
// case NWPlugin::Function::NWPLUGIN_CONNECT_SUCCESS:
// case NWPlugin::Function::NWPLUGIN_CONNECT_FAIL:
case NWPlugin::Function::NWPLUGIN_WEBFORM_SHOW_ACTIVE:
case NWPlugin::Function::NWPLUGIN_WEBFORM_SHOW_CONNECTED:
case NWPlugin::Function::NWPLUGIN_WEBFORM_SHOW_EXTENDED:
// case NWPlugin::Function::NWPLUGIN_WEBFORM_SHOW_EXTENDED:
case NWPlugin::Function::NWPLUGIN_WEBFORM_SHOW_HW_ADDRESS:
case NWPlugin::Function::NWPLUGIN_WEBFORM_SHOW_IP:
#ifndef LIMIT_BUILD_SIZE
#ifdef ESP32
case NWPlugin::Function::NWPLUGIN_WEBFORM_SHOW_PORT:
#endif
case NWPlugin::Function::NWPLUGIN_WEBFORM_SHOW_HOSTNAME:
@@ -334,7 +356,7 @@ bool NWPluginCall(NWPlugin::Function Function, EventStruct *event, String& str)
case NWPlugin::Function::NWPLUGIN_WEBFORM_LOAD:
case NWPlugin::Function::NWPLUGIN_WEBFORM_SAVE:
case NWPlugin::Function::NWPLUGIN_DRIVER_TEMPLATE:
// case NWPlugin::Function::NWPLUGIN_DRIVER_TEMPLATE:
{
const networkIndex_t networkIndex = event->NetworkIndex;
bool success = false;
-2
View File
@@ -1,7 +1,5 @@
#include "../Globals/NetworkState.h"
#include "../../../ESPEasy_common.h"
// Ethernet Connection status
ESPEasy::net::NetworkMedium_t active_network_medium = ESPEasy::net::NetworkMedium_t::NotSet;
-3
View File
@@ -5,9 +5,6 @@
#include <IPAddress.h>
#include <WiFiUdp.h>
#include "../../../src/DataTypes/ESPEasy_plugin_functions.h"
#include "../../../src/DataTypes/NetworkMedium.h"
// Ethernet Connectiopn status
extern ESPEasy::net::NetworkMedium_t active_network_medium;
@@ -13,10 +13,10 @@
# ifdef USES_NW001
# include "../NWPluginStructs/NW001_data_struct_WiFi_STA.h"
//# include "../NWPluginStructs/NW001_data_struct_WiFi_STA.h"
# endif
# ifdef USES_NW002
# include "../NWPluginStructs/NW002_data_struct_WiFi_AP.h"
//# include "../NWPluginStructs/NW002_data_struct_WiFi_AP.h"
# endif
# ifdef USES_NW003
# include "../NWPluginStructs/NW003_data_struct_ETH_RMII.h"
+46 -5
View File
@@ -2,9 +2,14 @@
#include "../../../src/DataStructs/ESPEasy_EventStruct.h"
#include "../../../src/DataTypes/ESPEasy_plugin_functions.h"
#include "../../../src/Globals/Settings.h"
#include "../../../src/Helpers/ESPEasy_UnitOfMeasure.h"
#include "ESPEasy_config.h"
#include "src/Helpers/StringProvider.h"
#include <cstddef>
#if FEATURE_TASKVALUE_UNIT_OF_MEASURE
# include "../../../src/Helpers/ESPEasy_UnitOfMeasure.h"
#endif
#include "../../../src/Helpers/StringConverter.h"
#include "../../../src/Helpers/StringGenerator_GPIO.h"
#include "../Globals/NWPlugins.h"
@@ -67,7 +72,7 @@ bool write_NetworkAdapterFlags(ESPEasy::net::networkIndex_t networkindex, KeyVal
}
return true;
}
#ifndef LIMIT_BUILD_SIZE
bool write_NetworkAdapterPort(ESPEasy::net::networkIndex_t networkindex,
KeyValueWriter *writer)
{
@@ -81,7 +86,7 @@ bool write_NetworkAdapterPort(ESPEasy::net::networkIndex_t networkindex,
NWPluginCall(NWPlugin::Function::NWPLUGIN_WEBFORM_SHOW_PORT, &TempEvent, str);
return true;
}
#endif
bool write_IP_config(ESPEasy::net::networkIndex_t networkindex, KeyValueWriter*writer)
{
@@ -127,6 +132,40 @@ bool write_IP_config(ESPEasy::net::networkIndex_t networkindex, KeyValueWriter*w
#endif // ifdef ESP32
#ifdef ESP8266
bool write_IP_config(ESPEasy::net::networkIndex_t networkindex, KeyValueWriter*writer)
{
if (writer == nullptr) { return false; }
if (networkindex == 0) {
static const LabelType::Enum labels[] PROGMEM = {
LabelType::IP_CONFIG,
LabelType::IP_ADDRESS_SUBNET,
LabelType::GATEWAY,
LabelType::CLIENT_IP,
LabelType::DNS,
LabelType::MAX_LABEL
};
writer->writeLabels(labels, true);
return true;
}
struct EventStruct TempEvent;
TempEvent.kvWriter = writer;
TempEvent.NetworkIndex = networkindex;
String str;
return ESPEasy::net::NWPluginCall(NWPlugin::Function::NWPLUGIN_WEBFORM_SHOW_IP, &TempEvent);
}
#endif // ifdef ESP8266
bool write_NetworkConnectionInfo(ESPEasy::net::networkIndex_t networkindex, KeyValueWriter*writer)
{
if (!writer) { return false; }
@@ -174,7 +213,7 @@ bool write_Eth_Show_Connected(const ETHClass& eth, KeyValueWriter *writer)
bool write_Eth_HW_Address(
const ESPEasy::net::EthPhyType_t phyType,
const ETHClass* eth, KeyValueWriter *writer)
const ETHClass*eth, KeyValueWriter *writer)
{
if (writer == nullptr) { return false; }
@@ -199,6 +238,7 @@ bool write_Eth_HW_Address(
#endif // if defined(USES_NW003) || defined(USES_NW004)
#ifdef ESP32
bool write_NetworkPort(const __FlashStringHelper*labels[], const int pins[], size_t nrElements, KeyValueWriter *writer)
{
if (writer == nullptr) { return false; }
@@ -231,6 +271,7 @@ bool write_NetworkPort(const __FlashStringHelper*labels[], const int pins[], siz
return success;
}
#endif
} // namespace net
} // namespace ESPEasy
+3 -1
View File
@@ -21,10 +21,10 @@ bool write_NetworkAdapterFlags(ESPEasy::net::networkIndex_t networkindex,
bool write_NetworkAdapterPort(ESPEasy::net::networkIndex_t networkindex,
KeyValueWriter *writer);
#endif
#endif // ifdef ESP32
bool write_IP_config(ESPEasy::net::networkIndex_t networkindex,
KeyValueWriter *writer);
#endif // ifdef ESP32
bool write_NetworkConnectionInfo(ESPEasy::net::networkIndex_t networkindex,
KeyValueWriter *writer);
@@ -40,7 +40,9 @@ bool write_Eth_HW_Address(const ESPEasy::net::EthPhyType_t phyType,
#endif // if defined(USES_NW003) || defined(USES_NW004)
#ifdef ESP32
bool write_NetworkPort(const __FlashStringHelper*labels[], const int pins[], size_t nrElements, KeyValueWriter *writer);
#endif
} // namespace net
} // namespace ESPEasy
@@ -4,13 +4,10 @@
# include "../DataStructs/WiFi_AP_Candidates_NVS.h"
#endif
#include "../Globals/ESPEasyWiFiEvent.h"
#include "../../../src/ESPEasyCore/ESPEasy_Log.h"
#include "../../../src/Globals/RTC.h"
#include "../../../src/Globals/SecuritySettings.h"
#include "../../../src/Globals/Settings.h"
#include "../../../src/Helpers/Misc.h"
#include "../../../src/Helpers/StringConverter.h"
#if defined(ESP8266)
@@ -3,9 +3,7 @@
#include "../../../ESPEasy_common.h"
#include "../DataStructs/WiFi_AP_Candidate.h"
#include "../../../src/Helpers/LongTermOnOffTimer.h"
#include <list>
#define WiFi_CONNECT_ATTEMPTS 1
@@ -16,8 +14,6 @@ namespace net {
namespace wifi {
typedef std::list<WiFi_AP_Candidate>::const_iterator WiFi_AP_Candidate_const_iterator;
struct WiFi_AP_CandidatesList {
WiFi_AP_CandidatesList();
@@ -107,12 +103,12 @@ public:
private:
std::list<WiFi_AP_Candidate>candidates;
WiFi_AP_Candidate_List_t candidates;
std::list<WiFi_AP_Candidate>known;
WiFi_AP_Candidate_List_t known;
std::list<WiFi_AP_Candidate>scanned;
std::list<WiFi_AP_Candidate>scanned_new;
WiFi_AP_Candidate_List_t scanned;
WiFi_AP_Candidate_List_t scanned_new;
WiFi_AP_Candidate_const_iterator known_it;
@@ -1,14 +1,8 @@
#include "../Helpers/_NWPlugin_Helper_webform.h"
#include "../../../ESPEasy_common.h"
#include "../../../src/DataStructs/ESPEasy_EventStruct.h"
#include "../../../src/DataTypes/ESPEasy_plugin_functions.h"
#include "../../../src/Globals/SecuritySettings.h"
#include "../../../src/Globals/Settings.h"
#include "../../../src/Helpers/Networking.h"
#include "../../../src/WebServer/ESPEasy_WebServer.h"
#include "../../../src/WebServer/Markup.h"
#include "../../../src/WebServer/Markup_Forms.h"
#include "../Globals/NWPlugins.h"
#include "../Helpers/_NWPlugin_init.h"
@@ -2,10 +2,10 @@
#include "../../../ESPEasy_common.h"
#include "../../../src/Helpers/ESPEasy_UnitOfMeasure.h"
#include "../DataStructs/NetworkSettingsStruct.h"
#include "../Globals/NWPlugins.h"
#include "../DataTypes/NetworkIndex.h"
#include "../DataTypes/NetworkDriverIndex.h"
namespace ESPEasy {
namespace net {
+1 -1
View File
@@ -4,7 +4,7 @@
#include "../../../src/DataStructs/TimingStats.h"
#include "../../../src/DataTypes/ESPEasy_plugin_functions.h"
#include "../../../src/Globals/Settings.h"
#include "../../../src/Helpers/Misc.h"
//#include "../../../src/Helpers/Misc.h"
#include "../../../src/Helpers/StringConverter.h"
#include "../Globals/NWPlugins.h"
@@ -2,11 +2,7 @@
#ifdef USES_NW001
# include "../../../src/Globals/Settings.h"
# include "../../../src/Helpers/ESPEasy_time_calc.h"
# include "../../../src/Helpers/LongTermOnOffTimer.h"
# include "../../../src/Helpers/StringConverter.h"
# include "../../../src/DataTypes/ESPEasy_plugin_functions.h"
# include "../../../src/WebServer/HTML_wrappers.h"
# include "../../../src/WebServer/Markup.h"
@@ -26,9 +26,9 @@ struct NW001_data_struct_WiFi_STA : public NWPluginData_base {
bool webform_getPort(KeyValueWriter *writer);
bool init(EventStruct *event);
bool init(EventStruct *event) override;
bool exit(EventStruct *event);
bool exit(EventStruct *event) override;
# ifdef ESP32
bool handle_priority_route_changed() override;
@@ -40,7 +40,7 @@ struct NW001_data_struct_WiFi_STA : public NWPluginData_base {
bool webformLoad_show_stats(struct EventStruct *event) const override;
# endif // if FEATURE_NETWORK_STATS
NWPluginData_static_runtime* getNWPluginData_static_runtime();
NWPluginData_static_runtime* getNWPluginData_static_runtime() override;
const __FlashStringHelper* getWiFi_encryptionType() const;
WiFiDisconnectReason getWiFi_disconnectReason() const;
@@ -2,17 +2,17 @@
#ifdef USES_NW002
# ifdef ESP32
# include "../../../src/Globals/Settings.h"
# include "../../../src/Helpers/ESPEasy_time_calc.h"
# include "../../../src/Helpers/LongTermOnOffTimer.h"
# include "../../../src/Helpers/StringConverter.h"
#endif
# include "../wifi/ESPEasyWifi.h"
# ifdef ESP32
# include <esp_wifi.h>
# include <esp_wifi_ap_get_sta_list.h>
# include <NetworkEvents.h>
# include <NetworkManager.h>
# endif // ifdef ESP32
# define NW_PLUGIN_ID 2
@@ -19,9 +19,9 @@ struct NW002_data_struct_WiFi_AP : public NWPluginData_base {
bool webform_getPort(KeyValueWriter *writer);
bool init(EventStruct *event);
bool init(EventStruct *event) override;
bool exit(EventStruct *event);
bool exit(EventStruct *event) override;
# ifdef ESP32
bool handle_priority_route_changed() override;
@@ -33,7 +33,7 @@ struct NW002_data_struct_WiFi_AP : public NWPluginData_base {
bool webformLoad_show_stats(struct EventStruct *event) const override;
# endif // if FEATURE_NETWORK_STATS
NWPluginData_static_runtime* getNWPluginData_static_runtime();
NWPluginData_static_runtime* getNWPluginData_static_runtime() override;
private:
@@ -7,20 +7,17 @@
# include "../../../src/Globals/Settings.h"
# include "../../../src/Helpers/ESPEasy_time_calc.h"
# include "../../../src/Helpers/Hardware_GPIO.h"
# include "../../../src/Helpers/LongTermOnOffTimer.h"
# include "../../../src/Helpers/StringConverter.h"
# include "../../../src/WebServer/Markup.h"
# include "../../../src/WebServer/Markup_Forms.h"
# include "../../../src/WebServer/KeyValueWriter_WebForm.h"
# include "../../../src/WebServer/ESPEasy_key_value_store_webform.h"
# include "../Globals/NetworkState.h"
# include "../Helpers/NW_info_writer.h"
# include "../eth/ESPEasyEth.h"
# include "../ESPEasyNetwork.h"
# define NW_PLUGIN_ID 3
@@ -488,9 +485,9 @@ void NW003_data_struct_ETH_RMII::ethPrintSettings() {
log += F(" Eth Clock mode: ");
log += ESPEasy::net::toString(ETH_ClockMode);
log += strformat(F(" MDC: %d MIO: %d PWR: %d"),
_kvs->getValueAsInt(NW003_KEY_ETH_PIN_MDC),
_kvs->getValueAsInt(NW003_KEY_ETH_PIN_MDIO),
_kvs->getValueAsInt(NW003_KEY_ETH_PIN_POWER));
static_cast<int>(_kvs->getValueAsInt(NW003_KEY_ETH_PIN_MDC)),
static_cast<int>(_kvs->getValueAsInt(NW003_KEY_ETH_PIN_MDIO)),
static_cast<int>(_kvs->getValueAsInt(NW003_KEY_ETH_PIN_POWER)));
addLogMove(LOG_LEVEL_INFO, log);
}
}
@@ -2,8 +2,7 @@
#include "../_NWPlugin_Helper.h"
#ifdef USES_NW003
#include "../eth/ETH_NWPluginData_static_runtime.h"
#include "../../../src/Helpers/StringGenerator_GPIO.h"
namespace ESPEasy {
namespace net {
@@ -34,11 +33,11 @@ struct NW003_data_struct_ETH_RMII : public NWPluginData_base {
bool webform_getPort(KeyValueWriter *writer);
bool init(EventStruct *event);
bool init(EventStruct *event) override;
bool exit(EventStruct *event);
bool exit(EventStruct *event) override;
NWPluginData_static_runtime* getNWPluginData_static_runtime();
NWPluginData_static_runtime* getNWPluginData_static_runtime() override;
bool write_Eth_HW_Address(KeyValueWriter *writer);
@@ -3,23 +3,19 @@
#ifdef USES_NW004
# include "../../../src/Globals/Settings.h"
# include "../../../src/Globals/SPIe.h"
# include "../../../src/Helpers/ESPEasy_time_calc.h"
# include "../../../src/Helpers/Hardware_GPIO.h"
# include "../../../src/Helpers/LongTermOnOffTimer.h"
# include "../../../src/Helpers/Hardware_SPI.h"
# include "../../../src/Helpers/SPI_Helper.h"
# include "../../../src/Helpers/StringConverter.h"
# include "../../../src/WebServer/Markup.h"
# include "../../../src/WebServer/Markup_Forms.h"
# include "../../../src/WebServer/ESPEasy_key_value_store_webform.h"
# include "../Globals/NetworkState.h"
# include "../../../src/WebServer/KeyValueWriter_WebForm.h"
# include "../Helpers/NW_info_writer.h"
# include "../eth/ESPEasyEth.h"
# include "../ESPEasyNetwork.h"
# define NW_PLUGIN_ID 4
@@ -317,7 +313,12 @@ bool NW004_data_struct_ETH_SPI::write_Eth_port(KeyValueWriter *writer)
int8_t spi_gpios[3]{};
if (!Settings.getSPI_pins(spi_gpios), (uint8_t)_kvs->getValueAsInt(NW004_KEY_SPI_BUS)) { return false; }
if (!Settings.getSPI_pins(
spi_gpios,
(uint8_t)_kvs->getValueAsInt(NW004_KEY_SPI_BUS)))
{
return false;
}
const __FlashStringHelper*labels[] = {
F("CLK"), F("MISO"), F("MOSI"), F("CS"), F("IRQ"), F("RST") };
const int pins[] = {
@@ -391,10 +392,10 @@ void NW004_data_struct_ETH_SPI::ethPrintSettings() {
log += F(" PHY Addr: ");
log += _kvs->getValueAsInt(NW004_KEY_ETH_PHY_ADDR);
log += strformat(F(" SPI bus: %d CS: %d IRQ: %d RST: %d"),
_kvs->getValueAsInt(NW004_KEY_SPI_BUS),
_kvs->getValueAsInt(NW004_KEY_ETH_PIN_CS),
_kvs->getValueAsInt(NW004_KEY_ETH_PIN_IRQ),
_kvs->getValueAsInt(NW004_KEY_ETH_PIN_RST));
static_cast<int>(_kvs->getValueAsInt(NW004_KEY_SPI_BUS)),
static_cast<int>(_kvs->getValueAsInt(NW004_KEY_ETH_PIN_CS)),
static_cast<int>(_kvs->getValueAsInt(NW004_KEY_ETH_PIN_IRQ)),
static_cast<int>(_kvs->getValueAsInt(NW004_KEY_ETH_PIN_RST)));
addLogMove(LOG_LEVEL_INFO, log);
}
}
@@ -408,7 +409,7 @@ bool NW004_data_struct_ETH_SPI::ETHConnectRelaxed() {
if (!(data && iface)) { return false; }
if (data->started() && data->connected()) {
if (EthLinkUp()) return true;
if (EthLinkUp()) { return true; }
data->mark_connect_failed();
return false;
}
@@ -440,26 +441,27 @@ bool NW004_data_struct_ETH_SPI::ETHConnectRelaxed() {
const int rstPin = _kvs->getValueAsInt(NW004_KEY_ETH_PIN_RST);
const int csPin = _kvs->getValueAsInt(NW004_KEY_ETH_PIN_CS);
const int irqPin = _kvs->getValueAsInt(NW004_KEY_ETH_PIN_IRQ);
const int spi_bus = _kvs->getValueAsInt(NW004_KEY_SPI_BUS);
const int spi_bus = _kvs->getValueAsInt_or_default(NW004_KEY_SPI_BUS, 0);
auto spi_instance = getSPI(spi_bus);
spi_host_device_t SPI_host = Settings.getSPI_host(spi_bus);
if (SPI_host == spi_host_device_t::SPI_HOST_MAX) {
if (!spi_instance) {
addLog(LOG_LEVEL_ERROR, F("SPI not enabled"));
# ifdef ESP32C3
// FIXME TD-er: Fallback for ETH01-EVO board
SPI_host = spi_host_device_t::SPI2_HOST;
Settings.InitSPI = static_cast<int>(SPI_Options_e::UserDefined_VSPI);
Settings.SPI_SCLK_pin = 7;
Settings.SPI_MISO_pin = 3;
Settings.SPI_MOSI_pin = 10;
initializeSPIBuses();
spi_instance = getSPI(0);
# endif // ifdef ESP32C3
}
// else
if (SPI_host != spi_host_device_t::SPI_HOST_MAX) {
if (spi_instance)
{
// TODO TD-er: Do we need to include the CLK, MISO, MOSI pins in the call or do we need to start the SPI bus first?
# if ETH_SPI_SUPPORTS_CUSTOM
success = iface->begin(
@@ -468,7 +470,7 @@ bool NW004_data_struct_ETH_SPI::ETHConnectRelaxed() {
csPin,
irqPin,
rstPin,
SPI_host);
*spi_instance);
# else // if ETH_SPI_SUPPORTS_CUSTOM
success = iface->begin(
to_ESP_phy_type(phyType),
@@ -481,6 +483,8 @@ bool NW004_data_struct_ETH_SPI::ETHConnectRelaxed() {
static_cast<int>(Settings.SPI_MISO_pin),
static_cast<int>(Settings.SPI_MOSI_pin));
# endif // if ETH_SPI_SUPPORTS_CUSTOM
} else {
addLog(LOG_LEVEL_ERROR, F("ETH : Failed to get SPI host"));
}
}
@@ -3,7 +3,7 @@
#include "../_NWPlugin_Helper.h"
#ifdef USES_NW004
#include "../eth/ETH_NWPluginData_static_runtime.h"
#include "../../../src/Helpers/StringGenerator_GPIO.h"
namespace ESPEasy {
namespace net {
@@ -34,11 +34,11 @@ struct NW004_data_struct_ETH_SPI : public NWPluginData_base {
bool webform_getPort(KeyValueWriter *writer);
bool init(EventStruct *event);
bool init(EventStruct *event) override;
bool exit(EventStruct *event);
bool exit(EventStruct *event) override;
NWPluginData_static_runtime* getNWPluginData_static_runtime();
NWPluginData_static_runtime* getNWPluginData_static_runtime() override;
bool write_Eth_HW_Address(KeyValueWriter *writer);
bool write_Eth_port(KeyValueWriter *writer);
@@ -15,13 +15,14 @@
# include "../../../src/WebServer/Markup_Forms.h"
# include "../../../src/WebServer/ESPEasy_key_value_store_webform.h"
# include "../Globals/NetworkState.h"
# include "../Helpers/_NWPlugin_Helper_webform.h"
# if FEATURE_TASKVALUE_UNIT_OF_MEASURE
# include "../../../src/Helpers/ESPEasy_UnitOfMeasure.h"
# endif // if FEATURE_TASKVALUE_UNIT_OF_MEASURE
# include <ESPEasySerialPort.h>
# include <PPP.h>
// # include <esp_modem_api.h>
// #include <esp_modem_c_api_types.h>
# include <NetworkManager.h>
# define NW_PLUGIN_ID 5
# define NW_PLUGIN_INTERFACE PPP
@@ -60,9 +60,9 @@ static int32_t getNextKey_noCredentials(int32_t key);
bool write_ModemState(KeyValueWriter*writer);
bool init(EventStruct *event);
bool init(EventStruct *event) override;
bool exit(EventStruct *event);
bool exit(EventStruct *event) override;
bool handle_nwplugin_write(EventStruct *event,
String & str) override;
@@ -78,7 +78,7 @@ static int32_t getNextKey_noCredentials(int32_t key);
# endif // if FEATURE_NETWORK_STATS
NWPluginData_static_runtime* getNWPluginData_static_runtime();
NWPluginData_static_runtime* getNWPluginData_static_runtime() override;
private:
+18 -17
View File
@@ -11,27 +11,26 @@
# define NWPLUGIN_NAME_001 "WiFi Station"
# include "../../src/DataStructs/ESPEasy_EventStruct.h"
# include "../../src/Globals/RTC.h"
# include "../../src/Globals/SecuritySettings.h"
# include "../../src/Globals/Settings.h"
# include "../../src/Helpers/ESPEasy_Storage.h"
# include "../../src/Helpers/PrintToString.h"
# include "../../src/Helpers/StringConverter.h"
# include "../../src/Helpers/StringGenerator_WiFi.h"
# include "../../src/WebServer/ESPEasy_WebServer.h"
# include "../../src/WebServer/HTML_Print.h"
# include "../../src/WebServer/HTML_wrappers.h"
# include "../../src/WebServer/KeyValueWriter_WebForm.h"
# include "../../src/WebServer/Markup.h"
# include "../../src/WebServer/Markup_Forms.h"
# include "../../src/WebServer/common.h"
# include "../net/ESPEasyNetwork.h"
# include "../net/Globals/ESPEasyWiFiEvent.h"
# include "../net/Globals/NWPlugins.h"
# include "../net/Globals/WiFi_AP_Candidates.h"
# include "../net/Helpers/_NWPlugin_Helper_webform.h"
# include "../net/Helpers/_NWPlugin_init.h"
# include "../net/NWPluginStructs/NW001_data_struct_WiFi_STA.h"
# include "../net/wifi/ESPEasyWifi.h"
#ifdef ESP8266
# include "../net/ESPEasyNetwork.h"
#endif
#if FEATURE_TASKVALUE_UNIT_OF_MEASURE
# include "../../src/Helpers/ESPEasy_UnitOfMeasure.h"
#endif
# if FEATURE_STORE_CREDENTIALS_SEPARATE_FILE
# include "../../src/WebServer/SecurityStruct_deviceSpecific_webform.h"
@@ -100,11 +99,15 @@ bool NWPlugin_001(NWPlugin::Function function, EventStruct *event, String& strin
case NWPlugin::Function::NWPLUGIN_WEBSERVER_SHOULD_RUN:
{
# ifdef ESP32
success = WiFi.STA.connected();
# else // ifdef ESP32
success = WiFi.isConnected();
# endif // ifdef ESP32
ESPEasy::net::wifi::NW001_data_struct_WiFi_STA *NW_data =
static_cast<ESPEasy::net::wifi::NW001_data_struct_WiFi_STA *>(getNWPluginData(event->NetworkIndex));
if (NW_data) {
auto runtime_data = NW_data->getNWPluginData_static_runtime();
if (runtime_data) {
success = runtime_data->connected();
}
}
break;
}
@@ -313,7 +316,6 @@ bool NWPlugin_001(NWPlugin::Function function, EventStruct *event, String& strin
}
break;
}
# ifndef LIMIT_BUILD_SIZE
case NWPlugin::Function::NWPLUGIN_WEBFORM_SHOW_PORT:
{
if (event->kvWriter) {
@@ -321,7 +323,6 @@ bool NWPlugin_001(NWPlugin::Function function, EventStruct *event, String& strin
}
break;
}
# endif // ifndef LIMIT_BUILD_SIZE
# endif // ifdef BOARD_HAS_SDIO_ESP_HOSTED
case NWPlugin::Function::NWPLUGIN_WEBFORM_SAVE:
{
-9
View File
@@ -13,18 +13,9 @@
# include "../../src/DataStructs/ESPEasy_EventStruct.h"
# include "../../src/Globals/SecuritySettings.h"
# include "../../src/Globals/Settings.h"
# include "../../src/Helpers/ESPEasy_Storage.h"
# include "../../src/Helpers/PrintToString.h"
# include "../../src/Helpers/StringConverter.h"
# include "../../src/WebServer/ESPEasy_WebServer.h"
# include "../../src/WebServer/HTML_Print.h"
# include "../../src/WebServer/HTML_wrappers.h"
# include "../../src/WebServer/Markup.h"
# include "../../src/WebServer/Markup_Forms.h"
# include "../../src/WebServer/common.h"
# include "../net/ESPEasyNetwork.h"
# include "../net/Globals/NWPlugins.h"
# include "../net/Helpers/_NWPlugin_Helper_webform.h"
# include "../net/Helpers/_NWPlugin_init.h"
# include "../net/NWPluginStructs/NW002_data_struct_WiFi_AP.h"
-16
View File
@@ -11,21 +11,7 @@
# define NWPLUGIN_NAME_003 "Ethernet (RMII)"
# include "../../src/DataStructs/ESPEasy_EventStruct.h"
# include "../../src/Globals/SecuritySettings.h"
# include "../../src/Globals/Settings.h"
# include "../../src/Helpers/ESPEasy_Storage.h"
# include "../../src/Helpers/PrintToString.h"
# include "../../src/Helpers/StringConverter.h"
# include "../../src/WebServer/ESPEasy_WebServer.h"
# include "../../src/WebServer/HTML_Print.h"
# include "../../src/WebServer/HTML_wrappers.h"
# include "../../src/WebServer/Markup.h"
# include "../../src/WebServer/Markup_Forms.h"
# include "../../src/WebServer/common.h"
# include "../net/eth/ESPEasyEth.h"
# include "../net/Globals/NWPlugins.h"
# include "../net/Globals/NetworkState.h"
# include "../net/Helpers/_NWPlugin_Helper_webform.h"
# include "../net/Helpers/_NWPlugin_init.h"
# include "../net/Helpers/NW_info_writer.h"
@@ -122,7 +108,6 @@ bool NWPlugin_003(NWPlugin::Function function, EventStruct *event, String& strin
}
break;
}
# ifndef LIMIT_BUILD_SIZE
case NWPlugin::Function::NWPLUGIN_WEBFORM_SHOW_PORT:
{
ESPEasy::net::eth::NW003_data_struct_ETH_RMII *NW_data =
@@ -133,7 +118,6 @@ bool NWPlugin_003(NWPlugin::Function function, EventStruct *event, String& strin
}
break;
}
# endif // ifndef LIMIT_BUILD_SIZE
case NWPlugin::Function::NWPLUGIN_WEBFORM_SAVE:
{
-16
View File
@@ -11,21 +11,7 @@
# define NWPLUGIN_NAME_004 "Ethernet (SPI)"
# include "../../src/DataStructs/ESPEasy_EventStruct.h"
# include "../net/eth/ESPEasyEth.h"
# include "../../src/Globals/SecuritySettings.h"
# include "../../src/Globals/Settings.h"
# include "../../src/Helpers/ESPEasy_Storage.h"
# include "../../src/Helpers/PrintToString.h"
# include "../../src/Helpers/StringConverter.h"
# include "../../src/WebServer/ESPEasy_WebServer.h"
# include "../../src/WebServer/HTML_Print.h"
# include "../../src/WebServer/HTML_wrappers.h"
# include "../../src/WebServer/Markup.h"
# include "../../src/WebServer/Markup_Forms.h"
# include "../../src/WebServer/common.h"
# include "../net/Globals/NWPlugins.h"
# include "../net/Globals/NetworkState.h"
# include "../net/Helpers/_NWPlugin_Helper_webform.h"
# include "../net/Helpers/_NWPlugin_init.h"
# include "../net/Helpers/NW_info_writer.h"
@@ -117,7 +103,6 @@ bool NWPlugin_004(NWPlugin::Function function, EventStruct *event, String& strin
}
break;
}
# ifndef LIMIT_BUILD_SIZE
case NWPlugin::Function::NWPLUGIN_WEBFORM_SHOW_PORT:
{
ESPEasy::net::eth::NW004_data_struct_ETH_SPI *NW_data =
@@ -128,7 +113,6 @@ bool NWPlugin_004(NWPlugin::Function function, EventStruct *event, String& strin
}
break;
}
# endif // ifndef LIMIT_BUILD_SIZE
case NWPlugin::Function::NWPLUGIN_WEBFORM_SAVE:
{
ESPEasy::net::eth::NW004_data_struct_ETH_SPI *NW_data =
-15
View File
@@ -11,21 +11,8 @@
# define NWPLUGIN_NAME_005 "PPP modem"
# include "../../src/DataStructs/ESPEasy_EventStruct.h"
# include "../net/ESPEasyNetwork.h"
# include "../../src/Globals/SecuritySettings.h"
# include "../../src/Globals/Settings.h"
# include "../../src/Helpers/ESPEasy_Storage.h"
# include "../../src/Helpers/PrintToString.h"
# include "../../src/Helpers/StringConverter.h"
# include "../../src/Helpers/_Plugin_Helper_serial.h"
# include "../../src/WebServer/ESPEasy_WebServer.h"
# include "../../src/WebServer/HTML_Print.h"
# include "../../src/WebServer/HTML_wrappers.h"
# include "../../src/WebServer/Markup.h"
# include "../../src/WebServer/Markup_Forms.h"
# include "../../src/WebServer/common.h"
# include "../net/Globals/NWPlugins.h"
# include "../net/Helpers/_NWPlugin_Helper_webform.h"
# include "../net/Helpers/_NWPlugin_init.h"
# include "../net/NWPluginStructs/NW005_data_struct_PPP_modem.h"
@@ -143,7 +130,6 @@ bool NWPlugin_005(NWPlugin::Function function, EventStruct *event, String& strin
break;
}
# ifndef LIMIT_BUILD_SIZE
case NWPlugin::Function::NWPLUGIN_WEBFORM_SHOW_PORT:
{
if (event->kvWriter) {
@@ -156,7 +142,6 @@ bool NWPlugin_005(NWPlugin::Function function, EventStruct *event, String& strin
}
break;
}
# endif // ifndef LIMIT_BUILD_SIZE
case NWPlugin::Function::NWPLUGIN_WEBFORM_SAVE:
{
-4
View File
@@ -3,11 +3,7 @@
#include "../../ESPEasy_common.h"
#include "../../src/CustomBuild/ESPEasyLimits.h"
#include "../../src/DataStructs/ESPEasy_EventStruct.h"
#include "../../src/Helpers/LongTermTimer.h"
#include "../../src/WebServer/KeyValueWriter_WebForm.h"
#include "../net/DataStructs/NWPluginData_base.h"
#include "../net/ESPEasyNetwork.h"
#if FEATURE_STORE_NETWORK_INTERFACE_SETTINGS
#include "../../src/Helpers/_ESPEasy_key_value_store.h"
-7
View File
@@ -2,16 +2,9 @@
#if FEATURE_ETHERNET
# include "../../../src/CustomBuild/ESPEasyLimits.h"
# include "../ESPEasyNetwork.h"
# include "../wifi/ESPEasyWifi.h"
# include "../../../src/ESPEasyCore/ESPEasy_Log.h"
# include "../../../src/ESPEasyCore/ESPEasyGPIO.h"
# include "../Globals/NetworkState.h"
# include "../../../src/Globals/Settings.h"
# include "../../../src/Helpers/Hardware_GPIO.h"
# include "../../../src/Helpers/StringConverter.h"
# include "../../../src/Helpers/Networking.h"
# include <ETH.h>
# include <lwip/dns.h>
-1
View File
@@ -5,7 +5,6 @@
#if FEATURE_ETHERNET
# include "../DataStructs/NWPluginData_static_runtime.h"
# include "../DataStructs/MAC_address.h"
# include <IPAddress.h>
@@ -9,21 +9,13 @@
# if FEATURE_PPP_MODEM
# include <PPP.h>
# endif
# include <NetworkManager.h>
# include "../../../src/DataStructs/RTCStruct.h"
# include "../../../src/DataTypes/ESPEasyTimeSource.h"
# include "../../../src/ESPEasyCore/ESPEasy_Log.h"
# include "../../../src/Globals/RTC.h"
# include "../../../src/Helpers/ESPEasy_time_calc.h"
# include "../../../src/Helpers/StringConverter.h"
# include "../../../src/Helpers/StringGenerator_WiFi.h"
# include "../../net/ESPEasyNetwork.h"
# include "../DataStructs/NWPluginData_static_runtime.h"
# include "../Globals/ESPEasyWiFiEvent.h"
# include "../Globals/NetworkState.h"
# include "../Globals/WiFi_AP_Candidates.h"
# include "../eth/ESPEasyEth.h"
# include "../wifi/ESPEasyWifi.h"
namespace ESPEasy {
namespace net {
@@ -5,7 +5,6 @@
#if FEATURE_WIFI
# ifdef ESP32
# include "../../../src/Helpers/LongTermOnOffTimer.h"
# include <IPAddress.h>
@@ -3,17 +3,11 @@
#if FEATURE_WIFI
# include "../../../src/ESPEasyCore/ESPEasy_Log.h"
# include "../../../src/Globals/EventQueue.h"
# include "../../../src/Globals/RTC.h"
# include "../../../src/Globals/SecuritySettings.h"
# include "../../../src/Globals/Settings.h"
# include "../../../src/Helpers/NetworkStatusLED.h"
# include "../../../src/Helpers/StringConverter.h"
# include "../../../src/Helpers/StringGenerator_WiFi.h"
# include "../ESPEasyNetwork.h" // for setNetworkMedium, however this should not be part of the WiFi code
# include "../Globals/ESPEasyWiFiEvent.h"
# include "../Globals/WiFi_AP_Candidates.h"
# include "../wifi/ESPEasyWifi.h"
# include "../wifi/ESPEasyWifi_abstracted.h"
@@ -489,7 +483,7 @@ bool ESPEasyWiFi_t::connectSTA()
*/
WiFi_pre_STA_setup();
# if defined(ESP8266)
wifi_station_set_hostname(NetworkCreateRFCCompliantHostname().c_str());
WiFi.hostname(NetworkCreateRFCCompliantHostname().c_str());
# endif // if defined(ESP8266)
# if defined(ESP32)
@@ -607,7 +601,8 @@ bool ESPEasyWiFi_t::shouldStartAP_fallback() const
return false;
}
return _connect_attempt > Settings.ConnectFailRetryCount;
return (Settings.ConnectFailRetryCount > 0) &&
(_connect_attempt > Settings.ConnectFailRetryCount);
}
@@ -4,9 +4,7 @@
#if FEATURE_WIFI
# include "../DataStructs/WiFi_AP_Candidate.h"
# include "../../../src/Helpers/LongTermTimer.h"
# include "../../../src/Helpers/LongTermOnOffTimer.h"
# include "../wifi/WiFi_STA_connected_state.h"
# include "../wifi/WiFi_State.h"
@@ -14,10 +14,6 @@
# include <WiFiSTA.h>
# include <WiFiType.h>
# include "../wifi/ESPEasyWifi_abstracted.h"
# include "../../../src/Globals/Settings.h"
namespace ESPEasy {
namespace net {
+19 -24
View File
@@ -2,31 +2,24 @@
#if FEATURE_WIFI
# include "../../../ESPEasy-Globals.h"
# include "../../../src/DataStructs/TimingStats.h"
# include "../../net/ESPEasyNetwork.h"
# include "../../../src/ESPEasyCore/ESPEasy_Log.h"
# include "../../../src/ESPEasyCore/Serial.h"
# include "../../../src/Globals/EventQueue.h"
# include "../../../src/Globals/Nodes.h"
# include "../../../src/Globals/RTC.h"
# include "../../../src/Globals/SecuritySettings.h"
# include "../../../src/Globals/Services.h"
# include "../../../src/Globals/Settings.h"
# include "../Globals/WiFi_AP_Candidates.h"
# include "../../../src/Helpers/ESPEasy_time_calc.h"
# include "../../../src/Helpers/ESPEasy_UnitOfMeasure.h"
# include "../../../src/Helpers/Hardware_defines.h"
# include "../../../src/Helpers/Misc.h"
# include "../../../src/Helpers/Networking.h"
# include "../../../src/Helpers/StringConverter.h"
# include "../../../src/Helpers/StringGenerator_WiFi.h"
# include "../../../src/Helpers/StringProvider.h"
# include "../Globals/ESPEasyWiFi.h"
# include "../Globals/ESPEasyWiFiEvent.h"
# include "../Globals/NetworkState.h"
# include "../Globals/WiFi_AP_Candidates.h"
# include "../wifi/ESPEasyWifi_abstracted.h"
# include "../../net/ESPEasyNetwork.h"
# include "../../../src/ESPEasyCore/Serial.h"
# include "../../../src/Globals/Settings.h"
# include "../../../src/Helpers/ESPEasy_time_calc.h"
# include "../../../src/Helpers/StringConverter.h"
#if FEATURE_TASKVALUE_UNIT_OF_MEASURE
# include "../../../src/Helpers/ESPEasy_UnitOfMeasure.h"
#endif
#ifdef ESP8266
# ifndef BUILD_NO_DEBUG
#include "../../../src/Helpers/StringGenerator_WiFi.h"
#endif
#endif
# ifdef ESP32
# include <WiFiGeneric.h>
@@ -316,7 +309,9 @@ bool write_WiFi_Hosted_MCU_pins(KeyValueWriter*writer)
writer->write(kv);
} else {
KeyValueStruct freq(F("SDIO Freq"), psdio_config->clock_freq_khz / 1000);
#if FEATURE_TASKVALUE_UNIT_OF_MEASURE
freq.setUnit(UOM_MHz);
#endif
writer->write(freq);
writer->write({ F("SDIO D0"), psdio_config->pin_d0.pin });
writer->write({ F("SDIO D1"), psdio_config->pin_d1.pin });
@@ -447,7 +442,7 @@ void WiFiScan_log_to_serial()
int i = 0;
for (auto it = WiFi_AP_Candidates.scanned_begin(); it != WiFi_AP_Candidates.scanned_end(); ++it)
for (WiFi_AP_Candidate_const_iterator it = WiFi_AP_Candidates.scanned_begin(); it != WiFi_AP_Candidates.scanned_end(); ++it)
{
++i;
@@ -463,7 +458,7 @@ void WiFiScan_log_to_serial()
}
// Only internal scope
void setAPinternal(bool enable) { doSetAPinternal(enable); }
bool setAPinternal(bool enable) { return doSetAPinternal(enable); }
void setUseStaticIP(bool enabled) { doSetUseStaticIP(enabled); }
+3 -3
View File
@@ -12,10 +12,10 @@
# endif // if defined(ESP32)
# include "../wifi/WiFiConnectionProtocol.h"
# include "../DataStructs/WiFi_AP_Candidate.h"
# include "../../../src/Helpers/LongTermTimer.h"
# ifdef BOARD_HAS_SDIO_ESP_HOSTED
# include "../../../src/Helpers/KeyValueWriter.h"
#endif
# ifdef ESP32
# define SOFTAP_STATION_COUNT WiFi.AP.stationCount()
@@ -103,7 +103,7 @@ void WifiDisconnect();
bool WiFiScanAllowed();
void WiFiScan_log_to_serial();
void setAPinternal(bool enable); // FIXME TD-er: Move to ESPEasyWifi_abstracted...
bool setAPinternal(bool enable); // FIXME TD-er: Move to ESPEasyWifi_abstracted...
void setUseStaticIP(bool enabled);
bool WiFiUseStaticIP();
@@ -3,15 +3,13 @@
#if FEATURE_WIFI
# include "../../net/ESPEasyNetwork.h"
# include "../../../src/Globals/EventQueue.h"
# include "../../../src/Globals/SecuritySettings.h"
# include "../../../src/Globals/Services.h"
# include "../../../src/Globals/Settings.h"
# include "../Globals/WiFi_AP_Candidates.h"
# include "../../../src/Helpers/StringConverter.h"
# include "../Globals/ESPEasyWiFiEvent.h"
# include "../Globals/ESPEasyWiFi.h"
# include "../Globals/WiFi_AP_Candidates.h"
# include "../Globals/NetworkState.h"
#include "../wifi/ESPEasyWifi.h"
namespace ESPEasy {
namespace net {
@@ -74,10 +72,10 @@ bool doWiFiScanAllowed() {
}
// Only internal scope
void doSetAPinternal(bool enable)
bool doSetAPinternal(bool enable)
{
if (enable) {
if (!Settings.getNetworkEnabled(NETWORK_INDEX_WIFI_AP)) { return; }
if (!Settings.getNetworkEnabled(NETWORK_INDEX_WIFI_AP)) { return false; }
// create and store unique AP SSID/PW to prevent ESP from starting AP mode with default SSID and No password!
// setup ssid for AP Mode when needed
@@ -98,6 +96,7 @@ void doSetAPinternal(bool enable)
}
if (!WiFi.softAPConfig(apIP, apIP, subnet, dhcp_lease_start, dns)) {
#ifndef LIMIT_BUILD_SIZE
addLog(LOG_LEVEL_ERROR, strformat(
("WIFI : [AP] softAPConfig failed! IP: %s, GW: %s, SN: %s DNS: %s"),
apIP.toString().c_str(),
@@ -105,8 +104,14 @@ void doSetAPinternal(bool enable)
subnet.toString().c_str(),
dns.toString().c_str())
);
#endif
return false;
}
#if ESP_IDF_VERSION_MAJOR < 6
WiFi.AP.bandwidth(WIFI_BW_HT20);
#else
WiFi.AP.bandwidth(WIFI_BW20);
#endif
# endif // ifdef ESP32
# ifdef ESP8266
@@ -119,6 +124,7 @@ void doSetAPinternal(bool enable)
subnet.toString().c_str())
);
#endif
return false;
}
# endif // ifdef ESP8266
@@ -154,6 +160,7 @@ void doSetAPinternal(bool enable)
formatIP(apIP).c_str()));
}
#endif
return false;
}
if (Settings.ApCaptivePortal()) {
@@ -199,6 +206,7 @@ void doSetAPinternal(bool enable)
doSetAP(false);
}
return false;
}
void doSetConnectionSpeed() {
@@ -216,7 +224,7 @@ void doSetConnectionSpeed() {
# if FEATURE_SET_WIFI_TX_PWR
void doSetWiFiTXpower() {
doSetWiFiTXpower(0, WiFi.RSSI());
doSetWiFiTXpower(0, WiFi.RSSI());
// Just some minimal value, will be adjusted in doSetWiFiTXpower
}
@@ -5,8 +5,6 @@
#if FEATURE_WIFI
# include "../wifi/WiFiConnectionProtocol.h"
# include "../wifi/WiFi_STA_connected_state.h"
# include "../wifi/WiFi_State.h"
# if defined(ESP8266)
@@ -14,7 +12,6 @@
# include <ESP8266WiFi.h>
# endif // if defined(ESP8266)
# if defined(ESP32)
# include "../wifi/ESPEasyWiFi_STA_Event_ESP32.h"
# include <WiFi.h>
# include <WiFiType.h>
# endif // if defined(ESP32)
@@ -60,7 +57,7 @@ void doWifiScan(bool async,
bool doWiFiScanAllowed();
// Only internal scope
void doSetAPinternal(bool enable);
bool doSetAPinternal(bool enable);
// ********************************************************************************
// Event handlers
@@ -11,7 +11,6 @@
# include "../../../src/Helpers/StringConverter.h"
# include "../../net/ESPEasyNetwork.h" // Needed for NetworkCreateRFCCompliantHostname, WiFi code should not include network code
# include "../Globals/ESPEasyWiFiEvent.h"
# include "../wifi/ESPEasyWiFi_STA_Event_ESP32.h"
# include <WiFiGeneric.h>
@@ -468,7 +467,11 @@ void doSetConnectionSpeed(bool ForceWiFi_bg_mode)
# ifndef SOC_WIFI_SUPPORTED
return;
# else
#if ESP_IDF_VERSION_MAJOR < 6
esp_wifi_set_bandwidth(WIFI_IF_STA, WIFI_BW_HT20);
#else
esp_wifi_set_bandwidth(WIFI_IF_STA, WIFI_BW20);
#endif
# if CONFIG_SOC_WIFI_SUPPORT_5G
@@ -13,7 +13,6 @@
# include "../wifi/ESPEasyWiFi_STA_Event_ESP8266.h"
# include "../../net/ESPEasyNetwork.h"
// # include "../wifi/ESPEasyWifi.h"
namespace ESPEasy {
namespace net {
@@ -251,9 +250,14 @@ WiFiConnectionProtocol doGetConnectionProtocol()
# if FEATURE_SET_WIFI_TX_PWR
void doSetWiFiTXpower(float& dBm) { WiFi.setOutputPower(dBm); }
float _lastSetdBm{};
float doGetWiFiTXpower() { return WiFi.getOutputPower(); }
void doSetWiFiTXpower(float& dBm) {
WiFi.setOutputPower(dBm);
_lastSetdBm = dBm;
}
float doGetWiFiTXpower() { return _lastSetdBm; }
# endif // if FEATURE_SET_WIFI_TX_PWR
+2 -5
View File
@@ -467,9 +467,7 @@ boolean Plugin_095(uint8_t function, struct EventStruct *event, String& string)
case PLUGIN_INIT:
{
const uint8_t spi_bus = Settings.getSPIBusForTask(event->TaskIndex);
if (Settings.isSPI_valid(spi_bus)) {
if (Settings.isSPI_validForTask(event->TaskIndex)) {
# if P095_ENABLE_ILI948X
if (10 == P095_CONFIG_FLAG_GET_TYPE) { // If ILI9486 was selected, reset to ILI9488
@@ -488,8 +486,7 @@ boolean Plugin_095(uint8_t function, struct EventStruct *event, String& string)
P095_CONFIG_FLAG_GET_CMD_TRIGGER)),
P095_CONFIG_GET_COLOR_FOREGROUND,
P095_CONFIG_GET_COLOR_BACKGROUND,
bitRead(P095_CONFIG_FLAGS, P095_CONFIG_FLAG_BACK_FILL) == 0,
spi_bus
bitRead(P095_CONFIG_FLAGS, P095_CONFIG_FLAG_BACK_FILL) == 0
# if ADAGFX_FONTS_INCLUDED
,
P095_CONFIG_DEFAULT_FONT
+2 -6
View File
@@ -508,9 +508,7 @@ boolean Plugin_096(uint8_t function, struct EventStruct *event, String& string)
case PLUGIN_INIT:
{
const uint8_t spi_bus = Settings.getSPIBusForTask(event->TaskIndex);
if (Settings.isSPI_valid(spi_bus)) {
if (Settings.isSPI_validForTask(event->TaskIndex)) {
initPluginTaskData(event->TaskIndex,
# if P096_USE_EXTENDED_SETTINGS
new (std::nothrow) P096_data_struct(static_cast<EPD_type_e>(P096_CONFIG_FLAG_GET_DISPLAYTYPE),
@@ -519,7 +517,6 @@ boolean Plugin_096(uint8_t function, struct EventStruct *event, String& string)
static_cast<AdaGFXTextPrintMode>(P096_CONFIG_FLAG_GET_MODE),
P096_CommandTrigger_toString(static_cast<P096_CommandTrigger>(
P096_CONFIG_FLAG_GET_CMD_TRIGGER)),
spi_bus,
P096_CONFIG_GET_COLOR_FOREGROUND,
P096_CONFIG_GET_COLOR_BACKGROUND,
static_cast<AdaGFXColorDepth>(P096_CONFIG_FLAG_GET_COLORDEPTH),
@@ -531,8 +528,7 @@ boolean Plugin_096(uint8_t function, struct EventStruct *event, String& string)
P096_CONFIG_ROTATION,
P096_CONFIG_FLAG_GET_FONTSCALE,
AdaGFXTextPrintMode::ContinueToNextLine,
F("epd"),
spi_bus)
F("epd"))
# endif // if P096_USE_EXTENDED_SETTINGS
);
P096_data_struct *P096_data = static_cast<P096_data_struct *>(getPluginTaskData(event->TaskIndex));
+1 -3
View File
@@ -364,7 +364,6 @@ boolean Plugin_099(uint8_t function, struct EventStruct *event, String& string)
case PLUGIN_INIT:
{
const uint8_t spi_bus = Settings.getSPIBusForTask(event->TaskIndex);
initPluginTaskData(event->TaskIndex, new (std::nothrow) P099_data_struct());
P099_data_struct *P099_data = static_cast<P099_data_struct *>(getPluginTaskData(event->TaskIndex));
@@ -377,8 +376,7 @@ boolean Plugin_099(uint8_t function, struct EventStruct *event, String& string)
bitRead(P099_CONFIG_FLAGS, P099_FLAGS_SEND_Z),
bitRead(P099_CONFIG_FLAGS, P099_FLAGS_USE_CALIBRATION),
P099_CONFIG_X_RES,
P099_CONFIG_Y_RES,
spi_bus);
P099_CONFIG_Y_RES);
break;
}
+2 -2
View File
@@ -174,8 +174,8 @@ boolean Plugin_104(uint8_t function, struct EventStruct *event, String& string)
case PLUGIN_WEBFORM_LOAD:
{
int8_t spi_pins[3];
Settings.getSPI_pins(spi_pins);
int8_t spi_pins[3]{};
Settings.getSPI_pinsForTask(event->TaskIndex, spi_pins);
int pinnr = -1;
bool input, output, warning;
String note;
+2 -2
View File
@@ -185,8 +185,8 @@ boolean Plugin_111(uint8_t function, struct EventStruct *event, String& string)
case PLUGIN_INIT:
{
const uint8_t spi_bus = Settings.getSPIBusForTask(event->TaskIndex);
initPluginTaskData(event->TaskIndex, new (std::nothrow) P111_data_struct(P111_CS_PIN, P111_RST_PIN, P111_IRQ_PIN, spi_bus));
initPluginTaskData(event->TaskIndex,
new (std::nothrow) P111_data_struct(event->TaskIndex, P111_CS_PIN, P111_RST_PIN, P111_IRQ_PIN));
P111_data_struct *P111_data = static_cast<P111_data_struct *>(getPluginTaskData(event->TaskIndex));
if (nullptr != P111_data) {
+2 -5
View File
@@ -342,9 +342,7 @@ boolean Plugin_116(uint8_t function, struct EventStruct *event, String& string)
case PLUGIN_INIT:
{
const uint8_t spi_bus = Settings.getSPIBusForTask(event->TaskIndex);
if (Settings.isSPI_valid(spi_bus)) {
if (Settings.isSPI_validForTask(event->TaskIndex)) {
initPluginTaskData(event->TaskIndex,
new (std::nothrow) P116_data_struct(static_cast<ST77xx_type_e>(P116_CONFIG_FLAG_GET_TYPE),
P116_CONFIG_FLAG_GET_ROTATION,
@@ -357,8 +355,7 @@ boolean Plugin_116(uint8_t function, struct EventStruct *event, String& string)
P116_CONFIG_FLAG_GET_CMD_TRIGGER)),
P116_CONFIG_GET_COLOR_FOREGROUND,
P116_CONFIG_GET_COLOR_BACKGROUND,
bitRead(P116_CONFIG_FLAGS, P116_CONFIG_FLAG_BACK_FILL) == 0,
spi_bus
bitRead(P116_CONFIG_FLAGS, P116_CONFIG_FLAG_BACK_FILL) == 0
# if ADAGFX_FONTS_INCLUDED
,
P116_CONFIG_DEFAULT_FONT
+1 -3
View File
@@ -200,12 +200,10 @@ boolean Plugin_118(uint8_t function, struct EventStruct *event, String& string)
# endif // ifdef P118_DEBUG_LOG
if (validGpio(P118_CSPIN) && (P118_IRQPIN != P118_CSPIN)) {
const uint8_t spi_bus = Settings.getSPIBusForTask(event->TaskIndex);
initPluginTaskData(event->TaskIndex, new (std::nothrow) P118_data_struct(P118_CSPIN,
P118_IRQPIN,
P118_CONFIG_LOG == 1,
P118_CONFIG_RF_LOG == 1,
spi_bus));
P118_CONFIG_RF_LOG == 1));
P118_data_struct *P118_data = static_cast<P118_data_struct *>(getPluginTaskData(event->TaskIndex));
success = (nullptr != P118_data) && P118_data->plugin_init(event);
+2 -5
View File
@@ -250,9 +250,7 @@ boolean Plugin_141(uint8_t function, struct EventStruct *event, String& string)
case PLUGIN_INIT:
{
const uint8_t spi_bus = Settings.getSPIBusForTask(event->TaskIndex);
if (Settings.isSPI_valid(spi_bus)) {
if (Settings.isSPI_validForTask(event->TaskIndex)) {
initPluginTaskData(event->TaskIndex,
new (std::nothrow) P141_data_struct(P141_CONFIG_FLAG_GET_ROTATION,
P141_CONFIG_FLAG_GET_FONTSCALE,
@@ -266,8 +264,7 @@ boolean Plugin_141(uint8_t function, struct EventStruct *event, String& string)
ADAGFX_WHITE,
ADAGFX_BLACK,
bitRead(P141_CONFIG_FLAGS, P141_CONFIG_FLAG_BACK_FILL) == 0,
bitRead(P141_CONFIG_FLAGS, P141_CONFIG_FLAG_INVERTED) == 1,
spi_bus
bitRead(P141_CONFIG_FLAGS, P141_CONFIG_FLAG_INVERTED) == 1
# if ADAGFX_FONTS_INCLUDED
,
P141_CONFIG_DEFAULT_FONT
+1 -1
View File
@@ -82,7 +82,7 @@ boolean Plugin_154(uint8_t function, struct EventStruct *event, String& string)
P154_data_struct *P154_data =
static_cast<P154_data_struct *>(getPluginTaskData(event->TaskIndex));
success = (nullptr != P154_data && P154_data->begin());
success = (nullptr != P154_data && P154_data->begin(event));
break;
}
+3 -2
View File
@@ -125,8 +125,9 @@ boolean Plugin_162(uint8_t function, struct EventStruct *event, String& string)
case PLUGIN_INIT:
{
const uint8_t spi_bus = Settings.getSPIBusForTask(event->TaskIndex);
initPluginTaskData(event->TaskIndex, new (std::nothrow) P162_data_struct(P162_CS_PIN, P162_RST_PIN, P162_SHD_PIN, spi_bus));
initPluginTaskData(
event->TaskIndex,
new (std::nothrow) P162_data_struct(P162_RST_PIN, P162_SHD_PIN));
P162_data_struct *P162_data = static_cast<P162_data_struct *>(getPluginTaskData(event->TaskIndex));
if (nullptr != P162_data) {
+1 -1
View File
@@ -59,7 +59,7 @@ boolean Plugin_172(uint8_t function, struct EventStruct *event, String& string)
P154_data_struct *P154_P172_data =
static_cast<P154_data_struct *>(getPluginTaskData(event->TaskIndex));
success = (nullptr != P154_P172_data && P154_P172_data->begin(false));
success = (nullptr != P154_P172_data && P154_P172_data->begin(event, false));
break;
}
+4 -53
View File
@@ -15,59 +15,8 @@
#pragma GCC system_header
#endif
/******************************************************************************\
* Detect core versions *******************************************************
\******************************************************************************/
#ifndef ESP32
#if defined(ARDUINO_ESP8266_RELEASE_2_4_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_1) || defined(ARDUINO_ESP8266_RELEASE_2_4_2)
#ifndef CORE_2_4_X
#define CORE_2_4_X
#endif
#endif
#if defined(ARDUINO_ESP8266_RELEASE_2_3_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_1)
#ifndef CORE_PRE_2_4_2
#define CORE_PRE_2_4_2
#endif
#endif
#if defined(ARDUINO_ESP8266_RELEASE_2_3_0) || defined(CORE_2_4_X)
#ifndef CORE_PRE_2_5_0
#define CORE_PRE_2_5_0
#endif
#else
#ifndef CORE_POST_2_5_0
#define CORE_POST_2_5_0
#endif
#endif
#ifdef FORCE_PRE_2_5_0
#ifdef CORE_POST_2_5_0
#undef CORE_POST_2_5_0
#endif
#endif
/*
#ifndef CORE_POST_2_5_0
#define STR_HELPER(x) #x
#define STR(x) STR_HELPER(x)
#endif
*/
#endif
#if defined(ESP8266)
#include <c_types.h>
#ifndef CORE_POST_3_0_0
#ifndef IRAM_ATTR
#define IRAM_ATTR ICACHE_RAM_ATTR
#endif
#endif
#ifdef ESP8266
#include "../include/esp8266_soc_caps.h"
#endif
#if defined(ESP32)
@@ -80,6 +29,8 @@
#endif
#endif
#include <memory>
#define ZERO_FILL(S) memset((S), 0, sizeof(S))
#define ZERO_TERMINATE(S) S[sizeof(S) - 1] = 0
+24 -74
View File
@@ -33,7 +33,7 @@
* -include "esp32x_fixes.h"
*/
//#include <sdkconfig.h>
// #include <sdkconfig.h>
#ifdef __riscv
@@ -46,90 +46,40 @@
#endif // __riscv
#ifdef ESP32
#include <soc/soc_caps.h>
# include <soc/soc_caps.h>
#endif
// alias, deprecated for the chips after esp32s2
#ifdef CONFIG_IDF_TARGET_ESP32
# define SPI_HOST SPI1_HOST
# define HSPI_HOST SPI2_HOST
# define VSPI_HOST SPI3_HOST
# define SPI_HOST SPI1_HOST // SPI 1 bus attached to the flash (can use the same data lines but different SS)
# define HSPI_HOST SPI2_HOST // SPI 2 bus normally mapped to pins 12 - 15, but can be matrixed to any pins
# define VSPI_HOST SPI3_HOST // SPI 3 bus normally attached to pins 5, 18, 19 and 23, but can be matrixed to any pins
#elif CONFIG_IDF_TARGET_ESP32S2
#else // ifdef CONFIG_IDF_TARGET_ESP32
// SPI_HOST (SPI1_HOST) is not supported by the SPI Master and SPI Slave driver on ESP32-S2 and later
# define SPI_HOST SPI1_HOST
# define FSPI_HOST SPI2_HOST
# define HSPI_HOST SPI3_HOST
# define VSPI_HOST SPI3_HOST
#elif CONFIG_IDF_TARGET_ESP32S3
// SPI_HOST (SPI1_HOST) is not supported by the SPI Master and SPI Slave driver on ESP32-S2 and later
# define SPI_HOST SPI1_HOST
# define FSPI_HOST SPI2_HOST
# define HSPI_HOST SPI3_HOST
# define VSPI_HOST SPI3_HOST
# ifndef REG_SPI_BASE
# if ESP_IDF_VERSION_MAJOR < 5
# define REG_SPI_BASE(i) (DR_REG_SPI1_BASE + (((i) > 1) ? (((i) * 0x1000) + 0x20000) : (((~(i)) & 1) * 0x1000)))
# endif
// SPI_MOSI_DLEN_REG is not defined anymore in esp32s3, instead use SPI_MS_DLEN_REG
# define SPI_MOSI_DLEN_REG(x) SPI_MS_DLEN_REG(x)
# endif // REG_SPI_BASE
#elif CONFIG_IDF_TARGET_ESP32C3
# define SPI_HOST SPI1_HOST
# define HSPI_HOST SPI2_HOST
# define VSPI_HOST SPI2_HOST /* No SPI3_host on C3 */
# if ESP_IDF_VERSION_MAJOR < 5
// fix a bug in esp-idf 4.4 for esp32c3
# ifndef REG_SPI_BASE
# define REG_SPI_BASE(i) (DR_REG_SPI1_BASE + (((i) > 1) ? (((i) * 0x1000) + 0x20000) : (((~(i)) & 1) * 0x1000)))
// SPI_MOSI_DLEN_REG is not defined anymore in esp32c3, instead use SPI_MS_DLEN_REG
# define SPI_MOSI_DLEN_REG(x) SPI_MS_DLEN_REG(x)
# endif // REG_SPI_BASE
# endif // ESP_IDF_VERSION_MAJOR < 5
#else
# define SPI_HOST SPI1_HOST
# define HSPI_HOST SPI2_HOST
#if SOC_SPI_PERIPH_NUM > 2
# define VSPI_HOST SPI3_HOST
#else
# define VSPI_HOST SPI2_HOST /* No SPI3_host */
#endif
# define VSPI SPI
// #if ESP_IDF_VERSION_MAJOR < 5
// // fix a bug in esp-idf 4.4 for esp32c3
// #ifndef REG_SPI_BASE
// #define REG_SPI_BASE(i) (DR_REG_SPI1_BASE + (((i)>1) ? (((i)* 0x1000) + 0x20000) : (((~(i)) & 1)* 0x1000 )))
// // SPI_MOSI_DLEN_REG is not defined anymore in esp32c3, instead use SPI_MS_DLEN_REG
# define SPI_MOSI_DLEN_REG(x) SPI_MS_DLEN_REG(x)
// #endif // REG_SPI_BASE
// #endif //ESP_IDF_VERSION_MAJOR < 5
# define FSPI_HOST SPI2_HOST // ESP32C2, C3, C5, C6, C61, H2, S2, S3, P4 - SPI 2 bus
# if SOC_SPI_PERIPH_NUM > 2
# define HSPI_HOST SPI3_HOST // ESP32S2, S3, P4 - SPI 3 bus
# else
# endif
# define VSPI_HOST FSPI_HOST // Alias for older code
#endif // TARGET
#ifndef CONFIG_SOC_WIFI_HE_SUPPORT
#if CONFIG_IDF_TARGET_ESP32C5 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32C61
#define CONFIG_SOC_WIFI_HE_SUPPORT 1
#else
#define CONFIG_SOC_WIFI_HE_SUPPORT 0
#endif
#endif
# if CONFIG_IDF_TARGET_ESP32C5 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32C61
# define CONFIG_SOC_WIFI_HE_SUPPORT 1
# else
# define CONFIG_SOC_WIFI_HE_SUPPORT 0
# endif // if CONFIG_IDF_TARGET_ESP32C5 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32C61
#endif // ifndef CONFIG_SOC_WIFI_HE_SUPPORT
#ifndef CONFIG_SOC_WIFI_SUPPORT_5G
#if CONFIG_IDF_TARGET_ESP32C5
#define CONFIG_SOC_WIFI_SUPPORT_5G 1
#else
#define CONFIG_SOC_WIFI_SUPPORT_5G 0
#endif
#endif
# if CONFIG_IDF_TARGET_ESP32C5
# define CONFIG_SOC_WIFI_SUPPORT_5G 1
# else
# define CONFIG_SOC_WIFI_SUPPORT_5G 0
# endif // if CONFIG_IDF_TARGET_ESP32C5
#endif // ifndef CONFIG_SOC_WIFI_SUPPORT_5G
+174
View File
@@ -0,0 +1,174 @@
#pragma once
#ifdef ESP8266
# include <cstdint>
# include <eagle_soc.h>
/******************************************************************************\
* Detect core versions *******************************************************
\******************************************************************************/
# if defined(ARDUINO_ESP8266_RELEASE_2_4_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_1) || defined(ARDUINO_ESP8266_RELEASE_2_4_2)
# ifndef CORE_2_4_X
# define CORE_2_4_X
# endif
# endif // if defined(ARDUINO_ESP8266_RELEASE_2_4_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_1) || defined(ARDUINO_ESP8266_RELEASE_2_4_2)
# if defined(ARDUINO_ESP8266_RELEASE_2_3_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_1)
# ifndef CORE_PRE_2_4_2
# define CORE_PRE_2_4_2
# endif
# endif // if defined(ARDUINO_ESP8266_RELEASE_2_3_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_1)
# if defined(ARDUINO_ESP8266_RELEASE_2_3_0) || defined(CORE_2_4_X)
# ifndef CORE_PRE_2_5_0
# define CORE_PRE_2_5_0
# endif
# else // if defined(ARDUINO_ESP8266_RELEASE_2_3_0) || defined(CORE_2_4_X)
# ifndef CORE_POST_2_5_0
# define CORE_POST_2_5_0
# endif
# endif // if defined(ARDUINO_ESP8266_RELEASE_2_3_0) || defined(CORE_2_4_X)
# ifdef FORCE_PRE_2_5_0
# ifdef CORE_POST_2_5_0
# undef CORE_POST_2_5_0
# endif
# endif // ifdef FORCE_PRE_2_5_0
/*
#ifndef CORE_POST_2_5_0
#define STR_HELPER(x) #x
#define STR(x) STR_HELPER(x)
#endif
*/
# define SOC_ADC_SUPPORTED 1
# define SOC_DAC_SUPPORTED 0
# define SOC_UART_SUPPORTED 1
# define SOC_MCPWM_SUPPORTED 0
# define SOC_GPTIMER_SUPPORTED 0
# define SOC_SDMMC_HOST_SUPPORTED 1
# define SOC_BT_SUPPORTED 0
# define SOC_PCNT_SUPPORTED 0
# define SOC_PHY_SUPPORTED 0
# define SOC_WIFI_SUPPORTED 1
# define SOC_SDIO_SLAVE_SUPPORTED 0
# define SOC_TWAI_SUPPORTED 1
# define SOC_EFUSE_SUPPORTED 0
# define SOC_EMAC_SUPPORTED 0
# define SOC_ULP_SUPPORTED 0
# define SOC_CCOMP_TIMER_SUPPORTED 0
# define SOC_RTC_FAST_MEM_SUPPORTED 0
# define SOC_RTC_SLOW_MEM_SUPPORTED 0
# define SOC_RTC_MEM_SUPPORTED 0
# define SOC_I2S_SUPPORTED 0
# define SOC_RMT_SUPPORTED 0
# define SOC_SDM_SUPPORTED 0
# define SOC_GPSPI_SUPPORTED 1
# define SOC_LEDC_SUPPORTED 0
# define SOC_I2C_SUPPORTED 1
# define SOC_SUPPORT_COEXISTENCE 0
# define SOC_AES_SUPPORTED 0
# define SOC_MPI_SUPPORTED 0
# define SOC_SHA_SUPPORTED 0
# define SOC_FLASH_ENC_SUPPORTED 0
# define SOC_SECURE_BOOT_SUPPORTED 0
# define SOC_TOUCH_SENSOR_SUPPORTED 0
# define SOC_BOD_SUPPORTED 0
# define SOC_ULP_FSM_SUPPORTED 0
# define SOC_CLK_TREE_SUPPORTED 0
# define SOC_MPU_SUPPORTED 0
# define SOC_WDT_SUPPORTED 0
# define SOC_SPI_FLASH_SUPPORTED 1
# define SOC_RNG_SUPPORTED 0
# define SOC_LIGHT_SLEEP_SUPPORTED 1
# define SOC_DEEP_SLEEP_SUPPORTED 1
# define SOC_PM_SUPPORTED 0
/*-------------------------- CPU CAPS ----------------------------------------*/
# define SOC_CPU_CORES_NUM 1
/*-------------------------- GPIO CAPS ---------------------------------------*/
// ESP8266 has 1 GPIO peripheral
# define SOC_GPIO_PORT (1U)
# define SOC_GPIO_PIN_COUNT 16
// 0~16 valid except flash pins
constexpr uint32_t SOC_GPIO_VALID_GPIO_MASK = (0x1FFFFUL & ~(0UL | BIT6 | BIT7 | BIT8 | BIT11));
# define SOC_GPIO_VALID_OUTPUT_GPIO_MASK (SOC_GPIO_VALID_GPIO_MASK)
# define SOC_GPIO_IN_RANGE_MAX SOC_GPIO_PIN_COUNT
# define SOC_GPIO_OUT_RANGE_MAX SOC_GPIO_PIN_COUNT
/*-------------------------- I2C CAPS ----------------------------------------*/
// ESP32 has 2 I2C
# define SOC_I2C_NUM (1U)
# define SOC_HP_I2C_NUM (1)
# define SOC_I2C_FIFO_LEN (32) /*!< I2C hardware FIFO depth */
# define SOC_I2C_CMD_REG_NUM (16) /*!< Number of I2C command registers */
# define SOC_I2C_SUPPORT_SLAVE (0)
# define SOC_I2C_SUPPORT_APB (0)
# define SOC_I2C_SUPPORT_10BIT_ADDR (0)
# define SOC_I2C_STOP_INDEPENDENT (0)
/*-------------------------- SPI CAPS ----------------------------------------*/
# define SOC_SPI_PERIPH_NUM (1U)
# define SOC_SPI_SCLK (14)
# define SOC_SPI_MISO (12)
# define SOC_SPI_MOSI (13)
/*-------------------------- UART CAPS ---------------------------------------*/
# define SOC_UART_NUM (2)
# define SOC_TX0 1
# define SOC_RX0 3
# define SOC_UART_FIFO_LEN (128) /*!< The UART hardware FIFO length */
# include <c_types.h>
# ifndef CORE_POST_3_0_0
# ifndef IRAM_ATTR
# define IRAM_ATTR ICACHE_RAM_ATTR
# endif
# endif // ifndef CORE_POST_3_0_0
# ifndef SOC_WIFI_SUPPORTED
# define SOC_WIFI_SUPPORTED 1
# endif
# ifndef FEATURE_WIFI
# define FEATURE_WIFI 1
# endif
/*-------------------------- GPIO CAPS ----------------------------------------*/
# ifndef GPIO_PIN_COUNT
# define GPIO_PIN_COUNT (SOC_GPIO_PIN_COUNT)
# endif
/// Check whether it is a valid GPIO number
# define GPIO_IS_VALID_GPIO(gpio_num) ((gpio_num >= 0) && \
(((1ULL << (gpio_num))&SOC_GPIO_VALID_GPIO_MASK) != 0))
/// Check whether it can be a valid GPIO number of output mode
# define GPIO_IS_VALID_OUTPUT_GPIO(gpio_num) ((gpio_num >= 0) && \
(((1ULL << (gpio_num))&SOC_GPIO_VALID_OUTPUT_GPIO_MASK) != 0))
/// Check whether it can be a valid digital I/O pad
# define GPIO_IS_VALID_DIGITAL_IO_PAD(gpio_num) ((gpio_num >= 0) && \
(((1ULL << (gpio_num))&SOC_GPIO_VALID_DIGITAL_IO_PAD_MASK) != 0))
#endif // ifdef ESP8266
+1 -1
View File
@@ -11,7 +11,7 @@
#include "../Helpers/ESPEasy_time_calc.h"
#include "../Helpers/_CPlugin_Helper.h"
#include "../../ESPEasy_fdwdecl.h"
//#include "../../ESPEasy_fdwdecl.h"
controllerIndex_t firstEnabledBlynk_ControllerIndex() {
+1 -1
View File
@@ -5,7 +5,7 @@
#ifdef USES_C012
#include "../Globals/CPlugins.h"
#include "../DataTypes/ControllerIndex.h"
controllerIndex_t firstEnabledBlynk_ControllerIndex();
-3
View File
@@ -3,9 +3,6 @@
#include <ctype.h>
#include <IPAddress.h>
#include "../../ESPEasy_common.h"
#include "../../ESPEasy/net/wifi/ESPEasyWifi.h"
#include "../ESPEasyCore/Serial.h"
#include "../Helpers/Networking.h"
-1
View File
@@ -6,7 +6,6 @@
#include "../../ESPEasy_common.h"
#include "../DataStructs/ESPEasy_EventStruct.h"
#include "../DataTypes/EventValueSource.h"
#include <IPAddress.h>
-3
View File
@@ -1,9 +1,6 @@
#include "../Commands/Controller.h"
#include "../../ESPEasy_common.h"
#include "../Commands/Common.h"
#include "../DataStructs/ESPEasy_EventStruct.h"
-3
View File
@@ -11,15 +11,12 @@
#include "../ESPEasyCore/ESPEasy_Log.h"
#include "../ESPEasyCore/Serial.h"
#include "../Globals/Device.h"
#include "../Globals/ExtraTaskSettings.h"
#include "../Globals/GlobalMapPortStatus.h"
#include "../Globals/SecuritySettings.h"
#include "../Globals/Settings.h"
#include "../Globals/Statistics.h"
#include "../Helpers/Convert.h"
#include "../Helpers/ESPEasy_Storage.h"
#include "../Helpers/ESPEasy_time_calc.h"
#include "../Helpers/Misc.h"
#include "../Helpers/_Plugin_init.h"
-1
View File
@@ -2,7 +2,6 @@
#define COMMAND_DIAGNOSTIC_H
#include <stdint.h>
#include <map>
#include "../../ESPEasy_common.h"
+1
View File
@@ -15,6 +15,7 @@
#include "../../ESPEasy/net/Globals/NWPlugins.h"
ExecuteCommandArgs::ExecuteCommandArgs(EventValueSource::Enum source,
const char *Line) :
_taskIndex(INVALID_TASK_INDEX),
+1 -6
View File
@@ -1,10 +1,5 @@
#include "../Commands/GPIO.h"
#include "../../ESPEasy_common.h"
#include "../../ESPEasy-Globals.h"
#include "../Commands/Common.h"
#include "../DataStructs/PinMode.h"
#include "../ESPEasyCore/Controller.h"
@@ -17,11 +12,11 @@
#include "../Helpers/StringConverter.h"
#include "../Helpers/PortStatus.h"
#include "../Helpers/Numerical.h"
#include "../Helpers/Hardware_I2C.h"
#if FEATURE_I2C_MULTIPLE
#include "../Globals/Settings.h"
#include "../Helpers/Hardware_device_info.h"
#include "../Helpers/I2C_access.h"
#endif // if FEATURE_I2C_MULTIPLE
#if FEATURE_GPIO_USE_ESP8266_WAVEFORM
-5
View File
@@ -1,7 +1,5 @@
#include "../Commands/HTTP.h"
#include "../../ESPEasy_common.h"
#include "../Commands/Common.h"
#include "../DataStructs/ControllerSettingsStruct.h"
@@ -12,10 +10,7 @@
#include "../Globals/Settings.h"
#include "../Helpers/_CPlugin_Helper.h"
#include "../Helpers/Misc.h"
#include "../Helpers/Networking.h"
#include "../Helpers/StringParser.h"
#if FEATURE_SEND_TO_HTTP || FEATURE_POST_TO_HTTP || FEATURE_PUT_TO_HTTP
const __FlashStringHelper* httpEmitToHTTP(struct EventStruct *event,
+1 -5
View File
@@ -1,8 +1,6 @@
#include "../Commands/InternalCommands.h"
#include "../../ESPEasy_common.h"
#include "../../_Plugin_Helper.h"
#include "../Globals/Settings.h"
#if FEATURE_BLYNK
@@ -55,9 +53,7 @@
#include "../ESPEasyCore/ESPEasy_Log.h"
#include "../Helpers/Misc.h"
#include "../Helpers/StringConverter.h"
#include "../Helpers/StringParser.h"
bool checkNrArguments(const char *cmd, const String& Line, int nrArguments) {
@@ -502,7 +498,7 @@ bool InternalCommands::executeInternalCommand()
#endif // ifndef LIMIT_BUILD_SIZE
#if FEATURE_WIFI
case ESPEasy_cmd_e::wifiallowap: COMMAND_CASE_R(Command_Wifi_AllowAP, 0); // WiFi.h
case ESPEasy_cmd_e::wifiapmode: COMMAND_CASE_R(Command_Wifi_APMode, 0); // WiFi.h
case ESPEasy_cmd_e::wifiapmode: COMMAND_CASE_R(Command_Wifi_APMode, -1); // WiFi.h
case ESPEasy_cmd_e::wificonnect: COMMAND_CASE_A(Command_Wifi_Connect, 0); // WiFi.h
case ESPEasy_cmd_e::wifidisconnect: COMMAND_CASE_A(Command_Wifi_Disconnect, 0); // WiFi.h
case ESPEasy_cmd_e::wifikey: COMMAND_CASE_R(Command_Wifi_Key, 1); // WiFi.h
-2
View File
@@ -1,4 +1,3 @@
#include "../../ESPEasy_common.h"
#include "../Globals/MQTT.h"
#if FEATURE_MQTT
@@ -13,7 +12,6 @@
#include "../Globals/CPlugins.h"
#include "../Globals/ESPEasy_Scheduler.h"
#include "../Globals/Settings.h"
#include "../Helpers/ESPEasy_Storage.h"
#include "../Helpers/PeriodicalActions.h"
-1
View File
@@ -5,7 +5,6 @@
#include "../../ESPEasy/net/Globals/NetworkState.h"
#include "../../ESPEasy/net/Helpers/NWAccessControl.h"
#include "../../ESPEasy/net/eth/ESPEasyEth.h"
#include "../../ESPEasy_common.h"
#include "../Commands/Common.h"
#include "../Globals/Settings.h"
#include "../Helpers/StringConverter.h"
-1
View File
@@ -4,7 +4,6 @@
#include "../Commands/Common.h"
#include "../../ESPEasy_common.h"
#include "../DataTypes/ESPEasy_plugin_functions.h"
#include "../Globals/ESPEasy_Scheduler.h"
#include "../Globals/Settings.h"
+22 -21
View File
@@ -16,29 +16,30 @@ String Command_Provisioning_Dispatcher(struct EventStruct *event,
if (equals(cmd, F("config"))) {
return Command_Provisioning_Config();
} else
if (equals(cmd, F("firmware"))) {
}
else if (equals(cmd, F("firmware"))) {
return Command_Provisioning_Firmware(event, Line);
} else
# if FEATURE_NOTIFIER
if (equals(cmd, F("notification"))) {
return Command_Provisioning_Notification();
} else
# endif // if FEATURE_NOTIFIER
if (equals(cmd, F("provision"))) {
return Command_Provisioning_Provision();
} else
if (equals(cmd, F("rules"))) {
return Command_Provisioning_Rules(event);
} else
if (equals(cmd, F("security"))) {
return Command_Provisioning_Security();
#if FEATURE_STORE_CREDENTIALS_SEPARATE_FILE
} else
if (equals(cmd, F("devsecurity"))) {
return Command_Provisioning_DeviceSecurity();
#endif // if FEATURE_STORE_CREDENTIALS_SEPARATE_FILE
}
# if FEATURE_NOTIFIER
else if (equals(cmd, F("notification"))) {
return Command_Provisioning_Notification();
}
# endif // if FEATURE_NOTIFIER
else if (equals(cmd, F("provision"))) {
return Command_Provisioning_Provision();
}
else if (equals(cmd, F("rules"))) {
return Command_Provisioning_Rules(event);
}
else if (equals(cmd, F("security"))) {
return Command_Provisioning_Security();
}
#if FEATURE_STORE_CREDENTIALS_SEPARATE_FILE
else if (equals(cmd, F("devsecurity"))) {
return Command_Provisioning_DeviceSecurity();
}
#endif // if FEATURE_STORE_CREDENTIALS_SEPARATE_FILE
return return_command_failed_flashstr();
}
-3
View File
@@ -1,8 +1,5 @@
#include "../Commands/RTC.h"
#include "../../ESPEasy_common.h"
#include "../Commands/Common.h"
#include "../DataStructs/RTCStruct.h"

Some files were not shown because too many files have changed in this diff Show More