Arduino Core 3 (#407)
* Add and remove libs and components for Arduino Core 3 * Arduino Core 3 * Add back Solo1 * Change ESP32-S3 to 4MB build * Update README.md * Fix retain and number of retries * Fix rolling log * Fix defaults * Fix BleScanner on Solo1 * Export settings * Import settings * Fix HA Battery voltage * Change submodule * Update espMqttClient and AsyncTCP * Webserial and MQTT/Network reconnecting * Update nuki_ble --------- Co-authored-by: iranl <iranl@github.com>
This commit is contained in:
4
updater/CMakeLists.txt
Normal file
4
updater/CMakeLists.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
cmake_minimum_required(VERSION 3.16.0)
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
list(APPEND EXTRA_COMPONENT_DIRS ../components)
|
||||
project(updater)
|
||||
1
updater/partitions.csv
Normal file
1
updater/partitions.csv
Normal file
@@ -0,0 +1 @@
|
||||
# Espressif ESP32 Partition Table
|
||||
|
44
updater/pio_package.py
Normal file
44
updater/pio_package.py
Normal file
@@ -0,0 +1,44 @@
|
||||
""" PlatformIO POST script execution to copy updater """
|
||||
|
||||
Import("env")
|
||||
import glob
|
||||
import os
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
|
||||
def get_board_name(env):
|
||||
board = env.get('BOARD_MCU')
|
||||
if env.get('BOARD') == 'esp32-solo1':
|
||||
board = env.get('BOARD').replace('-', '')
|
||||
return board
|
||||
|
||||
def create_target_dir(env):
|
||||
board = get_board_name(env)
|
||||
target_dir = env.GetProjectOption("custom_build") + '/' + board
|
||||
if not os.path.exists(target_dir):
|
||||
os.makedirs(target_dir)
|
||||
return target_dir
|
||||
|
||||
def copy_files(source, target, env):
|
||||
file = Path(target[0].get_abspath())
|
||||
target_dir = create_target_dir(env)
|
||||
board = get_board_name(env)
|
||||
|
||||
if "firmware" in file.stem:
|
||||
shutil.copy(file, f"{target_dir}/updater.bin")
|
||||
|
||||
def remove_files(source, target, env):
|
||||
for f in glob.glob("src/*.cpp"):
|
||||
os.remove(f)
|
||||
|
||||
for f in glob.glob("src/*.h"):
|
||||
os.remove(f)
|
||||
|
||||
for f in glob.glob("src/networkDevices/*.cpp"):
|
||||
os.remove(f)
|
||||
|
||||
for f in glob.glob("src/networkDevices/*.h"):
|
||||
os.remove(f)
|
||||
|
||||
env.AddPostAction("$BUILD_DIR/firmware.bin", copy_files)
|
||||
env.AddPostAction("$BUILD_DIR/firmware.bin", remove_files)
|
||||
3
updater/pio_package_pre.py
Normal file
3
updater/pio_package_pre.py
Normal file
@@ -0,0 +1,3 @@
|
||||
import shutil
|
||||
|
||||
shutil.copy("../src/main.cpp", "src/main.cpp")
|
||||
32
updater/pio_package_pre_solo1.py
Normal file
32
updater/pio_package_pre_solo1.py
Normal file
@@ -0,0 +1,32 @@
|
||||
import shutil
|
||||
import os
|
||||
|
||||
if not os.path.exists('src/networkDevices/'):
|
||||
os.mkdir('src/networkDevices')
|
||||
|
||||
shutil.copy("../src/main.cpp", "src/main.cpp")
|
||||
shutil.copy("../src/Config.h", "src/Config.h")
|
||||
shutil.copy("../src/Logger.h", "src/Logger.h")
|
||||
shutil.copy("../src/NukiNetwork.h", "src/NukiNetwork.h")
|
||||
shutil.copy("../src/Ota.h", "src/Ota.h")
|
||||
shutil.copy("../src/PreferencesKeys.h", "src/PreferencesKeys.h")
|
||||
shutil.copy("../src/RestartReason.h", "src/RestartReason.h")
|
||||
shutil.copy("../src/WebCfgServer.h", "src/WebCfgServer.h")
|
||||
shutil.copy("../src/WebCfgServerConstants.h", "src/WebCfgServerConstants.h")
|
||||
|
||||
shutil.copy("../src/Logger.cpp", "src/Logger.cpp")
|
||||
shutil.copy("../src/NukiNetwork.cpp", "src/NukiNetwork.cpp")
|
||||
shutil.copy("../src/Ota.cpp", "src/Ota.cpp")
|
||||
shutil.copy("../src/WebCfgServer.cpp", "src/WebCfgServer.cpp")
|
||||
|
||||
shutil.copy("../src/networkDevices/EthLan8720Device.h", "src/networkDevices/EthLan8720Device.h")
|
||||
shutil.copy("../src/networkDevices/IPConfiguration.h", "src/networkDevices/IPConfiguration.h")
|
||||
shutil.copy("../src/networkDevices/NetworkDevice.h", "src/networkDevices/NetworkDevice.h")
|
||||
shutil.copy("../src/networkDevices/W5500Device.h", "src/networkDevices/W5500Device.h")
|
||||
shutil.copy("../src/networkDevices/WifiDevice.h", "src/networkDevices/WifiDevice.h")
|
||||
|
||||
shutil.copy("../src/networkDevices/EthLan8720Device.cpp", "src/networkDevices/EthLan8720Device.cpp")
|
||||
shutil.copy("../src/networkDevices/IPConfiguration.cpp", "src/networkDevices/IPConfiguration.cpp")
|
||||
shutil.copy("../src/networkDevices/NetworkDevice.cpp", "src/networkDevices/NetworkDevice.cpp")
|
||||
shutil.copy("../src/networkDevices/W5500Device.cpp", "src/networkDevices/W5500Device.cpp")
|
||||
shutil.copy("../src/networkDevices/WifiDevice.cpp", "src/networkDevices/WifiDevice.cpp")
|
||||
85
updater/platformio.ini
Normal file
85
updater/platformio.ini
Normal file
@@ -0,0 +1,85 @@
|
||||
; PlatformIO Project Configuration File
|
||||
;
|
||||
; Build options: build flags, source filter
|
||||
; Upload options: custom upload port, speed and extra flags
|
||||
; Library options: dependencies, extra library storages
|
||||
; Advanced options: extra scripting
|
||||
;
|
||||
; Please visit documentation for the other options and examples
|
||||
; https://docs.platformio.org/page/projectconf.html
|
||||
|
||||
[platformio]
|
||||
default_envs = updater_esp32dev
|
||||
boards_dir = ../boards
|
||||
|
||||
[env]
|
||||
platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.06.11/platform-espressif32.zip
|
||||
platform_packages =
|
||||
framework = arduino, espidf
|
||||
build_type = release
|
||||
custom_build = release
|
||||
board_build.partitions = partitions.csv
|
||||
build_unflags =
|
||||
-Werror=all
|
||||
-Wall
|
||||
build_flags =
|
||||
-fexceptions
|
||||
-DESP_PLATFORM
|
||||
-DESP32
|
||||
-DARDUINO_ARCH_ESP32
|
||||
-DNUKI_HUB_UPDATER
|
||||
-Wno-ignored-qualifiers
|
||||
-Wno-missing-field-initializers
|
||||
-Wno-type-limits
|
||||
-Wno-maybe-uninitialized
|
||||
-Wno-implicit-fallthrough
|
||||
-Wno-unused-result
|
||||
lib_deps =
|
||||
AsyncTCP=symlink://../lib/AsyncTCP
|
||||
Ethernet=symlink://../lib/Ethernet
|
||||
HTTPClient=symlink://../lib/HTTPClient
|
||||
NetworkClientSecure=symlink://../lib/NetworkClientSecure
|
||||
WebServer=symlink://../lib/WebServer
|
||||
WiFiManager=symlink://../lib/WiFiManager
|
||||
|
||||
monitor_speed = 115200
|
||||
monitor_filters =
|
||||
esp32_exception_decoder
|
||||
time
|
||||
|
||||
[env:updater_esp32dev]
|
||||
board = esp32dev
|
||||
extra_scripts =
|
||||
pre:pio_package_pre.py
|
||||
post:pio_package.py
|
||||
|
||||
[env:updater_esp32-c3]
|
||||
extends = env:updater_esp32dev
|
||||
board = esp32-c3-devkitc-02
|
||||
|
||||
[env:updater_esp32-s3]
|
||||
extends = env:updater_esp32dev
|
||||
board = nuki-esp32-s3
|
||||
|
||||
[env:updater_esp32-c6]
|
||||
extends = env:updater_esp32dev
|
||||
board = esp32-c6-devkitm-1
|
||||
|
||||
[env:updater_esp32solo1]
|
||||
platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.10.03/platform-espressif32-2023.10.03.zip
|
||||
framework = arduino
|
||||
board = esp32-solo1
|
||||
extra_scripts =
|
||||
pre:pio_package_pre_solo1.py
|
||||
post:pio_package.py
|
||||
build_flags =
|
||||
${env.build_flags}
|
||||
-DFRAMEWORK_ARDUINO_SOLO1
|
||||
lib_deps =
|
||||
AsyncTCP=symlink://../lib/AsyncTCP
|
||||
Ethernet=symlink://../lib/Ethernet
|
||||
HTTPClient=symlink://../lib/HTTPClient
|
||||
WebServer=symlink://../lib/WebServer
|
||||
WiFiManager=symlink://../lib/WiFiManager
|
||||
lib_ignore =
|
||||
NetworkClientSecure
|
||||
13
updater/sdkconfig.defaults
Normal file
13
updater/sdkconfig.defaults
Normal file
@@ -0,0 +1,13 @@
|
||||
CONFIG_AUTOSTART_ARDUINO=y
|
||||
CONFIG_FREERTOS_HZ=1000
|
||||
CONFIG_MBEDTLS_PSK_MODES=y
|
||||
CONFIG_MBEDTLS_KEY_EXCHANGE_PSK=y
|
||||
CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y
|
||||
CONFIG_COMPILER_OPTIMIZATION_SIZE=y
|
||||
CONFIG_BT_ENABLED=n
|
||||
CONFIG_IEEE802154_ENABLED=n
|
||||
CONFIG_ARDUINO_SELECTIVE_COMPILATION=y
|
||||
CONFIG_ARDUINO_SELECTIVE_HTTPClient=n
|
||||
CONFIG_ARDUINO_SELECTIVE_WebServer=n
|
||||
CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y
|
||||
CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_CMN=y
|
||||
28
updater/src/CMakeLists.txt
Normal file
28
updater/src/CMakeLists.txt
Normal file
@@ -0,0 +1,28 @@
|
||||
list(APPEND app_sources ${CMAKE_SOURCE_DIR}/src/main.cpp)
|
||||
list(APPEND app_sources ../../src/Config.h)
|
||||
list(APPEND app_sources ../../src/Logger.h)
|
||||
list(APPEND app_sources ../../src/NukiNetwork.h)
|
||||
list(APPEND app_sources ../../src/Ota.h)
|
||||
list(APPEND app_sources ../../src/PreferencesKeys.h)
|
||||
list(APPEND app_sources ../../src/RestartReason.h)
|
||||
list(APPEND app_sources ../../src/WebCfgServer.h)
|
||||
list(APPEND app_sources ../../src/WebCfgServerConstants.h)
|
||||
|
||||
list(APPEND app_sources ../../src/Logger.cpp)
|
||||
list(APPEND app_sources ../../src/NukiNetwork.cpp)
|
||||
list(APPEND app_sources ../../src/Ota.cpp)
|
||||
list(APPEND app_sources ../../src/WebCfgServer.cpp)
|
||||
|
||||
list(APPEND app_sources ../../src/networkDevices/EthLan8720Device.h)
|
||||
list(APPEND app_sources ../../src/networkDevices/IPConfiguration.h)
|
||||
list(APPEND app_sources ../../src/networkDevices/NetworkDevice.h)
|
||||
list(APPEND app_sources ../../src/networkDevices/W5500Device.h)
|
||||
list(APPEND app_sources ../../src/networkDevices/WifiDevice.h)
|
||||
|
||||
list(APPEND app_sources ../../src/networkDevices/EthLan8720Device.cpp)
|
||||
list(APPEND app_sources ../../src/networkDevices/IPConfiguration.cpp)
|
||||
list(APPEND app_sources ../../src/networkDevices/NetworkDevice.cpp)
|
||||
list(APPEND app_sources ../../src/networkDevices/W5500Device.cpp)
|
||||
list(APPEND app_sources ../../src/networkDevices/WifiDevice.cpp)
|
||||
|
||||
idf_component_register(SRCS ${app_sources})
|
||||
Reference in New Issue
Block a user