mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-10 18:24:27 +05:00
feat: migrate to arduino-esp32 core 3.0.1
This commit is contained in:
@@ -147,10 +147,11 @@ namespace NetworkUtils {
|
|||||||
bool resetWifi() {
|
bool resetWifi() {
|
||||||
// set policy manual for work 13 ch
|
// set policy manual for work 13 ch
|
||||||
{
|
{
|
||||||
wifi_country_t country = {"CN", 1, 13, WIFI_COUNTRY_POLICY_MANUAL};
|
|
||||||
#ifdef ARDUINO_ARCH_ESP8266
|
#ifdef ARDUINO_ARCH_ESP8266
|
||||||
|
wifi_country_t country = {"CN", 1, 13, WIFI_COUNTRY_POLICY_AUTO};
|
||||||
wifi_set_country(&country);
|
wifi_set_country(&country);
|
||||||
#elif defined(ARDUINO_ARCH_ESP32)
|
#elif defined(ARDUINO_ARCH_ESP32)
|
||||||
|
const wifi_country_t country = {"CN", 1, 13, CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER, WIFI_COUNTRY_POLICY_AUTO};
|
||||||
esp_wifi_set_country(&country);
|
esp_wifi_set_country(&country);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,12 +17,13 @@ framework = arduino
|
|||||||
lib_deps =
|
lib_deps =
|
||||||
bblanchon/ArduinoJson@^7.0.4
|
bblanchon/ArduinoJson@^7.0.4
|
||||||
;ihormelnyk/OpenTherm Library@^1.1.5
|
;ihormelnyk/OpenTherm Library@^1.1.5
|
||||||
https://github.com/Laxilef/opentherm_library/archive/refs/heads/fix_lambda.zip
|
https://github.com/ihormelnyk/opentherm_library#master
|
||||||
arduino-libraries/ArduinoMqttClient@^0.1.8
|
arduino-libraries/ArduinoMqttClient@^0.1.8
|
||||||
lennarthennigs/ESP Telnet@^2.2
|
lennarthennigs/ESP Telnet@^2.2
|
||||||
gyverlibs/FileData@^1.0.2
|
gyverlibs/FileData@^1.0.2
|
||||||
gyverlibs/GyverPID@^3.3.2
|
gyverlibs/GyverPID@^3.3.2
|
||||||
gyverlibs/GyverBlinker@^1.0
|
gyverlibs/GyverBlinker@^1.0
|
||||||
|
https://github.com/PaulStoffregen/OneWire#master
|
||||||
milesburton/DallasTemperature@^3.11.0
|
milesburton/DallasTemperature@^3.11.0
|
||||||
laxilef/TinyLogger@^1.1.0
|
laxilef/TinyLogger@^1.1.0
|
||||||
build_flags =
|
build_flags =
|
||||||
@@ -67,9 +68,12 @@ build_flags = ${env.build_flags}
|
|||||||
board_build.ldscript = eagle.flash.4m1m.ld
|
board_build.ldscript = eagle.flash.4m1m.ld
|
||||||
|
|
||||||
[esp32_defaults]
|
[esp32_defaults]
|
||||||
platform = espressif32@^6.7
|
;platform = espressif32@^6.7
|
||||||
|
platform = https://github.com/platformio/platform-espressif32.git
|
||||||
platform_packages =
|
platform_packages =
|
||||||
platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32/archive/refs/tags/2.0.17.zip
|
;platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32/archive/refs/tags/2.0.17.zip
|
||||||
|
framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.1
|
||||||
|
framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip
|
||||||
board_build.partitions = esp32_partitions.csv
|
board_build.partitions = esp32_partitions.csv
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${env.lib_deps}
|
${env.lib_deps}
|
||||||
@@ -179,8 +183,7 @@ build_flags =
|
|||||||
|
|
||||||
[env:c3_mini]
|
[env:c3_mini]
|
||||||
platform = ${esp32_defaults.platform}
|
platform = ${esp32_defaults.platform}
|
||||||
platform_packages =
|
platform_packages = ${esp32_defaults.platform_packages}
|
||||||
platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32/archive/refs/tags/2.0.17.zip
|
|
||||||
board = lolin_c3_mini
|
board = lolin_c3_mini
|
||||||
board_build.partitions = ${esp32_defaults.board_build.partitions}
|
board_build.partitions = ${esp32_defaults.board_build.partitions}
|
||||||
lib_deps =
|
lib_deps =
|
||||||
|
|||||||
@@ -40,17 +40,19 @@ protected:
|
|||||||
unsigned long externalPumpStartTime = 0;
|
unsigned long externalPumpStartTime = 0;
|
||||||
bool telnetStarted = false;
|
bool telnetStarted = false;
|
||||||
|
|
||||||
const char* getTaskName() {
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
|
const char* getTaskName() override {
|
||||||
return "Main";
|
return "Main";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*int getTaskCore() {
|
/*BaseType_t getTaskCore() override {
|
||||||
return 1;
|
return 1;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
int getTaskPriority() {
|
int getTaskPriority() override {
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void setup() {}
|
void setup() {}
|
||||||
|
|
||||||
|
|||||||
@@ -81,17 +81,19 @@ protected:
|
|||||||
bool connected = false;
|
bool connected = false;
|
||||||
bool newConnection = false;
|
bool newConnection = false;
|
||||||
|
|
||||||
const char* getTaskName() {
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
|
const char* getTaskName() override {
|
||||||
return "Mqtt";
|
return "Mqtt";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*int getTaskCore() {
|
/*BaseType_t getTaskCore() override {
|
||||||
return 1;
|
return 1;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
int getTaskPriority() {
|
int getTaskPriority() override {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
inline bool isReadyForSend() {
|
inline bool isReadyForSend() {
|
||||||
return millis() - this->connectedTime > this->readyForSendTime;
|
return millis() - this->connectedTime > this->readyForSendTime;
|
||||||
|
|||||||
@@ -33,18 +33,19 @@ protected:
|
|||||||
byte configuredFaultStateGpio = GPIO_IS_NOT_CONFIGURED;
|
byte configuredFaultStateGpio = GPIO_IS_NOT_CONFIGURED;
|
||||||
bool faultState = false;
|
bool faultState = false;
|
||||||
|
|
||||||
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
const char* getTaskName() {
|
const char* getTaskName() override {
|
||||||
return "OpenTherm";
|
return "OpenTherm";
|
||||||
}
|
}
|
||||||
|
|
||||||
int getTaskCore() {
|
BaseType_t getTaskCore() override {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int getTaskPriority() {
|
int getTaskPriority() override {
|
||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
if (settings.system.unitSystem != UnitSystem::METRIC) {
|
if (settings.system.unitSystem != UnitSystem::METRIC) {
|
||||||
|
|||||||
@@ -55,17 +55,19 @@ protected:
|
|||||||
unsigned long webServerChangeState = 0;
|
unsigned long webServerChangeState = 0;
|
||||||
unsigned long dnsServerChangeState = 0;
|
unsigned long dnsServerChangeState = 0;
|
||||||
|
|
||||||
const char* getTaskName() {
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
|
const char* getTaskName() override {
|
||||||
return "Portal";
|
return "Portal";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*int getTaskCore() {
|
/*BaseType_t getTaskCore() override {
|
||||||
return 1;
|
return 1;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
int getTaskPriority() {
|
int getTaskPriority() override {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
this->dnsServer->setTTL(0);
|
this->dnsServer->setTTL(0);
|
||||||
|
|||||||
@@ -14,17 +14,19 @@ protected:
|
|||||||
float prevEtResult = 0;
|
float prevEtResult = 0;
|
||||||
float prevPidResult = 0;
|
float prevPidResult = 0;
|
||||||
|
|
||||||
const char* getTaskName() {
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
|
const char* getTaskName() override {
|
||||||
return "Regulator";
|
return "Regulator";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*int getTaskCore() {
|
/*BaseType_t getTaskCore() override {
|
||||||
return 1;
|
return 1;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
int getTaskPriority() {
|
int getTaskPriority() override {
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
float newTemp = vars.parameters.heatingSetpoint;
|
float newTemp = vars.parameters.heatingSetpoint;
|
||||||
|
|||||||
@@ -43,23 +43,30 @@ protected:
|
|||||||
float filteredIndoorTemp = 0;
|
float filteredIndoorTemp = 0;
|
||||||
bool emptyIndoorTemp = true;
|
bool emptyIndoorTemp = true;
|
||||||
|
|
||||||
#if USE_BLE
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
|
#if USE_BLE
|
||||||
BLEClient* pBleClient = nullptr;
|
BLEClient* pBleClient = nullptr;
|
||||||
bool initBleSensor = false;
|
bool initBleSensor = false;
|
||||||
bool initBleNotify = false;
|
bool initBleNotify = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char* getTaskName() {
|
const char* getTaskName() override {
|
||||||
return "Sensors";
|
return "Sensors";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*int getTaskCore() {
|
BaseType_t getTaskCore() override {
|
||||||
return 1;
|
// https://github.com/h2zero/NimBLE-Arduino/issues/676
|
||||||
}*/
|
#if USE_BLE && defined(CONFIG_BT_NIMBLE_PINNED_TO_CORE)
|
||||||
|
return CONFIG_BT_NIMBLE_PINNED_TO_CORE;
|
||||||
|
#else
|
||||||
|
return tskNO_AFFINITY;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
int getTaskPriority() {
|
int getTaskPriority() override {
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
bool indoorTempUpdated = false;
|
bool indoorTempUpdated = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user