Skip to content

Commit

Permalink
Tasmota changes
Browse files Browse the repository at this point in the history
* revert WiFiClient - rename flush() to clear() https://github.com/espressif/arduino-esp32/pull/9453/files since it uneeded brakes many libs and code
* optional Ethernet support (JL1101 driver added)
* esp-modem only esp32, esp32s2 and esp32s3
* remove `OpenThread`
* remove all BT BLE libraries
* remove SPIFFS
* remove Client Secure
* remove Provisioning
* remove TfLite, Insights and Rainmaker
  • Loading branch information
Jason2866 committed Jul 10, 2024
1 parent 0852177 commit 1e526cd
Show file tree
Hide file tree
Showing 23 changed files with 87 additions and 524 deletions.
100 changes: 2 additions & 98 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ endif()
set(CORE_SRCS
cores/esp32/base64.cpp
cores/esp32/cbuf.cpp
cores/esp32/chip-debug-report.cpp
cores/esp32/esp32-hal-adc.c
cores/esp32/esp32-hal-bt.c
cores/esp32/esp32-hal-cpu.c
Expand Down Expand Up @@ -78,39 +77,27 @@ set(CORE_SRCS
set(ARDUINO_ALL_LIBRARIES
ArduinoOTA
AsyncUDP
BLE
BluetoothSerial
DNSServer
EEPROM
ESP_I2S
ESP_NOW
ESP_SR
ESPmDNS
Ethernet
FFat
FS
HTTPClient
HTTPUpdate
Insights
LittleFS
NetBIOS
Network
OpenThread
PPP
Preferences
RainMaker
SD_MMC
SD
SimpleBLE
SPIFFS
SPI
Ticker
Update
USB
WebServer
NetworkClientSecure
WiFi
WiFiProv
Wire
)

Expand All @@ -119,26 +106,10 @@ set(ARDUINO_LIBRARY_ArduinoOTA_REQUIRES esp_https_ota)

set(ARDUINO_LIBRARY_AsyncUDP_SRCS libraries/AsyncUDP/src/AsyncUDP.cpp)

set(ARDUINO_LIBRARY_BluetoothSerial_SRCS
libraries/BluetoothSerial/src/BluetoothSerial.cpp
libraries/BluetoothSerial/src/BTAddress.cpp
libraries/BluetoothSerial/src/BTAdvertisedDeviceSet.cpp
libraries/BluetoothSerial/src/BTScanResultsSet.cpp)

set(ARDUINO_LIBRARY_DNSServer_SRCS libraries/DNSServer/src/DNSServer.cpp)

set(ARDUINO_LIBRARY_EEPROM_SRCS libraries/EEPROM/src/EEPROM.cpp)

set(ARDUINO_LIBRARY_ESP_I2S_SRCS libraries/ESP_I2S/src/ESP_I2S.cpp)

set(ARDUINO_LIBRARY_ESP_NOW_SRCS
libraries/ESP_NOW/src/ESP32_NOW.cpp
libraries/ESP_NOW/src/ESP32_NOW_Serial.cpp)

set(ARDUINO_LIBRARY_ESP_SR_SRCS
libraries/ESP_SR/src/ESP_SR.cpp
libraries/ESP_SR/src/esp32-hal-sr.c)

set(ARDUINO_LIBRARY_ESPmDNS_SRCS libraries/ESPmDNS/src/ESPmDNS.cpp)

set(ARDUINO_LIBRARY_Ethernet_SRCS libraries/Ethernet/src/ETH.cpp)
Expand All @@ -153,43 +124,23 @@ set(ARDUINO_LIBRARY_HTTPClient_SRCS libraries/HTTPClient/src/HTTPClient.cpp)

set(ARDUINO_LIBRARY_HTTPUpdate_SRCS libraries/HTTPUpdate/src/HTTPUpdate.cpp)

set(ARDUINO_LIBRARY_Insights_SRCS libraries/Insights/src/Insights.cpp)

set(ARDUINO_LIBRARY_LittleFS_SRCS libraries/LittleFS/src/LittleFS.cpp)

set(ARDUINO_LIBRARY_NetBIOS_SRCS libraries/NetBIOS/src/NetBIOS.cpp)

set(ARDUINO_LIBRARY_OpenThread_SRCS
libraries/OpenThread/src/OThreadCLI.cpp
libraries/OpenThread/src/OThreadCLI_Util.cpp)

set(ARDUINO_LIBRARY_PPP_SRCS
libraries/PPP/src/PPP.cpp
libraries/PPP/src/ppp.c)

set(ARDUINO_LIBRARY_Preferences_SRCS libraries/Preferences/src/Preferences.cpp)

set(ARDUINO_LIBRARY_RainMaker_SRCS
libraries/RainMaker/src/RMaker.cpp
libraries/RainMaker/src/RMakerNode.cpp
libraries/RainMaker/src/RMakerParam.cpp
libraries/RainMaker/src/RMakerDevice.cpp
libraries/RainMaker/src/RMakerType.cpp
libraries/RainMaker/src/RMakerQR.cpp
libraries/RainMaker/src/RMakerUtils.cpp
libraries/RainMaker/src/AppInsights.cpp)

set(ARDUINO_LIBRARY_SD_MMC_SRCS libraries/SD_MMC/src/SD_MMC.cpp)

set(ARDUINO_LIBRARY_SD_SRCS
libraries/SD/src/SD.cpp
libraries/SD/src/sd_diskio.cpp
libraries/SD/src/sd_diskio_crc.c)

set(ARDUINO_LIBRARY_SimpleBLE_SRCS libraries/SimpleBLE/src/SimpleBLE.cpp)

set(ARDUINO_LIBRARY_SPIFFS_SRCS libraries/SPIFFS/src/SPIFFS.cpp)

set(ARDUINO_LIBRARY_SPI_SRCS libraries/SPI/src/SPI.cpp)

set(ARDUINO_LIBRARY_Ticker_SRCS libraries/Ticker/src/Ticker.cpp)
Expand All @@ -214,10 +165,6 @@ set(ARDUINO_LIBRARY_WebServer_SRCS
libraries/WebServer/src/Parsing.cpp
libraries/WebServer/src/detail/mimetable.cpp)

set(ARDUINO_LIBRARY_NetworkClientSecure_SRCS
libraries/NetworkClientSecure/src/ssl_client.cpp
libraries/NetworkClientSecure/src/NetworkClientSecure.cpp)

set(ARDUINO_LIBRARY_Network_SRCS
libraries/Network/src/NetworkInterface.cpp
libraries/Network/src/NetworkEvents.cpp
Expand All @@ -236,43 +183,8 @@ set(ARDUINO_LIBRARY_WiFi_SRCS
libraries/WiFi/src/STA.cpp
libraries/WiFi/src/AP.cpp)

set(ARDUINO_LIBRARY_WiFiProv_SRCS libraries/WiFiProv/src/WiFiProv.cpp)

set(ARDUINO_LIBRARY_Wire_SRCS libraries/Wire/src/Wire.cpp)

set(ARDUINO_LIBRARY_BLE_SRCS
libraries/BLE/src/BLE2901.cpp
libraries/BLE/src/BLE2902.cpp
libraries/BLE/src/BLE2904.cpp
libraries/BLE/src/BLEAddress.cpp
libraries/BLE/src/BLEAdvertisedDevice.cpp
libraries/BLE/src/BLEAdvertising.cpp
libraries/BLE/src/BLEBeacon.cpp
libraries/BLE/src/BLECharacteristic.cpp
libraries/BLE/src/BLECharacteristicMap.cpp
libraries/BLE/src/BLEClient.cpp
libraries/BLE/src/BLEDescriptor.cpp
libraries/BLE/src/BLEDescriptorMap.cpp
libraries/BLE/src/BLEDevice.cpp
libraries/BLE/src/BLEEddystoneTLM.cpp
libraries/BLE/src/BLEEddystoneURL.cpp
libraries/BLE/src/BLEExceptions.cpp
libraries/BLE/src/BLEHIDDevice.cpp
libraries/BLE/src/BLERemoteCharacteristic.cpp
libraries/BLE/src/BLERemoteDescriptor.cpp
libraries/BLE/src/BLERemoteService.cpp
libraries/BLE/src/BLEScan.cpp
libraries/BLE/src/BLESecurity.cpp
libraries/BLE/src/BLEServer.cpp
libraries/BLE/src/BLEService.cpp
libraries/BLE/src/BLEServiceMap.cpp
libraries/BLE/src/BLEUtils.cpp
libraries/BLE/src/BLEUUID.cpp
libraries/BLE/src/BLEValue.cpp
libraries/BLE/src/FreeRTOS.cpp
libraries/BLE/src/GeneralUtils.cpp
)

set(ARDUINO_LIBRARIES_SRCS)
set(ARDUINO_LIBRARIES_REQUIRES)
set(ARDUINO_LIBRARIES_INCLUDEDIRS)
Expand All @@ -293,16 +205,8 @@ endforeach()
set(includedirs variants/${CONFIG_ARDUINO_VARIANT}/ cores/esp32/ ${ARDUINO_LIBRARIES_INCLUDEDIRS})
set(srcs ${CORE_SRCS} ${ARDUINO_LIBRARIES_SRCS})
set(priv_includes cores/esp32/libb64)
set(requires spi_flash esp_partition mbedtls wifi_provisioning wpa_supplicant esp_adc esp_eth http_parser)
set(priv_requires fatfs nvs_flash app_update spiffs bootloader_support bt esp_hid usb esp_psram ${ARDUINO_LIBRARIES_REQUIRES})

if(NOT CONFIG_ARDUINO_SELECTIVE_COMPILATION OR CONFIG_ARDUINO_SELECTIVE_OpenThread)
#if(CONFIG_SOC_IEEE802154_SUPPORTED) # Does not work!
#if(CONFIG_OPENTHREAD_ENABLED) # Does not work!
if(IDF_TARGET STREQUAL "esp32c6" OR IDF_TARGET STREQUAL "esp32h2") # Sadly only this works
list(APPEND requires openthread)
endif()
endif()
set(requires spi_flash esp_partition mbedtls wpa_supplicant esp_adc esp_eth http_parser)
set(priv_requires fatfs nvs_flash app_update bootloader_support bt esp_hid usb esp_psram ${ARDUINO_LIBRARIES_REQUIRES})

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

Expand Down
31 changes: 0 additions & 31 deletions Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,6 @@ config ARDUINO_SELECTIVE_SD_MMC
depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_FS
default y

config ARDUINO_SELECTIVE_SPIFFS
bool "Enable SPIFFS"
depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_FS
default y

config ARDUINO_SELECTIVE_FFat
bool "Enable FFat"
depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_FS
Expand Down Expand Up @@ -355,7 +350,6 @@ config ARDUINO_SELECTIVE_ESPmDNS
config ARDUINO_SELECTIVE_HTTPClient
bool "Enable HTTPClient"
depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_Network
select ARDUINO_SELECTIVE_NetworkClientSecure
default y

config ARDUINO_SELECTIVE_NetBIOS
Expand All @@ -374,29 +368,4 @@ config ARDUINO_SELECTIVE_WiFi
depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_Network
default y

config ARDUINO_SELECTIVE_NetworkClientSecure
bool "Enable NetworkClientSecure"
depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_Network
default y

config ARDUINO_SELECTIVE_WiFiProv
bool "Enable WiFiProv"
depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_Network && ARDUINO_SELECTIVE_WiFi
default y

config ARDUINO_SELECTIVE_BLE
bool "Enable BLE"
depends on ARDUINO_SELECTIVE_COMPILATION
default y

config ARDUINO_SELECTIVE_BluetoothSerial
bool "Enable BluetoothSerial"
depends on ARDUINO_SELECTIVE_COMPILATION
default y

config ARDUINO_SELECTIVE_SimpleBLE
bool "Enable SimpleBLE"
depends on ARDUINO_SELECTIVE_COMPILATION
default y

endmenu
6 changes: 6 additions & 0 deletions cores/esp32/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
#endif
#endif

#if defined __has_include && __has_include("chip-debug-report.h")
#include "chip-debug-report.h"
#endif

#ifndef ARDUINO_LOOP_STACK_SIZE
#ifndef CONFIG_ARDUINO_LOOP_STACK_SIZE
Expand Down Expand Up @@ -49,20 +51,24 @@ void loopTask(void *pvParameters) {
// sets UART0 (default console) RX/TX pins as already configured in boot or as defined in variants/pins_arduino.h
Serial0.setPins(gpioNumberToDigitalPin(SOC_RX0), gpioNumberToDigitalPin(SOC_TX0));
#endif
#if defined __has_include && __has_include("chip-debug-report.h")
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
printBeforeSetupInfo();
#else
if (shouldPrintChipDebugReport()) {
printBeforeSetupInfo();
}
#endif
#endif
setup();
#if defined __has_include && __has_include("chip-debug-report.h")
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
printAfterSetupInfo();
#else
if (shouldPrintChipDebugReport()) {
printAfterSetupInfo();
}
#endif
#endif
for (;;) {
#if CONFIG_FREERTOS_UNICORE
Expand Down
1 change: 0 additions & 1 deletion docs/en/migration_guides/2.x_to_3.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,5 @@ WiFi
Functional changes
^^^^^^^^^^^^^^^^^^

* In Arduino (and other frameworks) the method named ``flush()`` is intended to send out the transmit buffer content. ``WiFiClient`` and ``WiFiUDP`` method ``flush()`` won't clear the receive buffer anymore. A new method called ``clear()`` is now used for that. Currently ``flush()`` does nothing in ``WiFiClient``, ``WiFiClientSecure`` and ``WiFiUDP``.
* ``WiFiServer`` has functions ``accept()`` and ``available()`` with the same functionality. In Arduino, ``available()`` should work differently so it is now deprecated.
* ``WiFiServer`` had unimplemented write functions inherited from ``Print`` class. These are now removed. Also unimplemented method ``stopAll()`` is removed. The methods were unimplemented because ``WiFiServer`` doesn't manage connected ``WiFiClient`` objects for print-to-all-clients functionality.
43 changes: 6 additions & 37 deletions idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,48 +49,17 @@ dependencies:
require: public
espressif/esp_modem:
version: "^1.1.0"
rules:
- if: "target in [esp32, esp32s2, esp32s3, esp32h2]"
espressif/esp-zboss-lib:
version: "^1.0.1"
rules:
- if: "target != esp32c2"
- if: "target in [esp32h2]"
espressif/esp-zigbee-lib:
version: "^1.0.1"
rules:
- if: "target != esp32c2"
- if: "target in [esp32h2]"
espressif/esp-dsp:
version: "^1.3.4"
rules:
- if: "target != esp32c2"
espressif/esp_rainmaker:
version: "^1.0.0"
rules:
- if: "target != esp32c2"
espressif/rmaker_common:
version: "^1.4.3"
rules:
- if: "target != esp32c2"
espressif/esp_insights:
version: "^1.0.1"
rules:
- if: "target != esp32c2"
espressif/qrcode:
version: "^0.1.0~1"
rules:
- if: "target != esp32c2"
espressif/esp-sr:
version: "^1.4.2"
rules:
- if: "target in [esp32s3]"
espressif/libsodium:
version: "^1.0.20~1"
require: public
espressif/esp-modbus:
version: "^1.0.15"
require: public
version: "^1.4.12"
joltwallet/littlefs:
version: "^1.10.2"
chmorgan/esp-libhelix-mp3:
version: "1.0.3"
require: public
examples:
- path: ./idf_component_examples/hello_world
version: "^1.14.1"
5 changes: 5 additions & 0 deletions libraries/Ethernet/src/ETH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
*/

// Disable the automatic pin remapping of the API calls in this file
#if defined __has_include && __has_include("esp_eth_driver.h")

#define ARDUINO_CORE_BUILD

#include "ETH.h"
Expand Down Expand Up @@ -237,6 +239,7 @@ bool ETHClass::begin(eth_phy_type_t type, int32_t phy_addr, int mdc, int mdio, i
case ETH_PHY_TLK110: phy = esp_eth_phy_new_ip101(&phy_config); break;
case ETH_PHY_RTL8201: phy = esp_eth_phy_new_rtl8201(&phy_config); break;
case ETH_PHY_DP83848: phy = esp_eth_phy_new_dp83848(&phy_config); break;
case ETH_PHY_JL1101: phy = esp_eth_phy_new_jl1101(&phy_config); break;
case ETH_PHY_KSZ8041: phy = esp_eth_phy_new_ksz80xx(&phy_config); break;
case ETH_PHY_KSZ8081: phy = esp_eth_phy_new_ksz80xx(&phy_config); break;
default: log_e("Unsupported PHY %d", type); break;
Expand Down Expand Up @@ -1007,3 +1010,5 @@ size_t ETHClass::printDriverInfo(Print &out) const {
}

ETHClass ETH;

#endif /* defined __has_include && __has_include("esp_eth_driver.h") */
3 changes: 3 additions & 0 deletions libraries/Ethernet/src/ETH.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#if defined __has_include && __has_include("esp_eth_driver.h")

#ifndef _ETH_H_
#define _ETH_H_
Expand Down Expand Up @@ -101,6 +102,7 @@ typedef enum {
ETH_PHY_LAN8720,
ETH_PHY_TLK110,
ETH_PHY_RTL8201,
ETH_PHY_JL1101,
ETH_PHY_DP83848,
ETH_PHY_KSZ8041,
ETH_PHY_KSZ8081,
Expand Down Expand Up @@ -223,3 +225,4 @@ class ETHClass : public NetworkInterface {
extern ETHClass ETH;

#endif /* _ETH_H_ */
#endif /* defined __has_include && __has_include("esp_eth_driver.h") */
2 changes: 2 additions & 0 deletions libraries/HTTPClient/src/HTTPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
/// Cookie jar support
#include <time.h>

#define HTTPCLIENT_NOSECURE

#ifdef HTTPCLIENT_1_1_COMPATIBLE
class TransportTraits {
public:
Expand Down
Loading

0 comments on commit 1e526cd

Please sign in to comment.