Skip to content

Commit 171ab58

Browse files
committed
pioarduino
1 parent ee66525 commit 171ab58

File tree

11 files changed

+13535
-15540
lines changed

11 files changed

+13535
-15540
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
## WIP
5+
## Upcoming [0.5.0] - tbd
66

77
> [!CAUTION]
88
> This update has breaking changes!
@@ -33,13 +33,13 @@ All notable changes to this project will be documented in this file.
3333

3434
### Changed
3535

36-
- Updated platform espressif32 to 6.8.1
3736
- Lightstate example uses simpler, less explicit constructor
3837
- MQTT library updated
3938
- Analytics task was refactored into a loop() function which is called by the ESP32-sveltekit main task.
4039
- Updated PsychicHttp to v1.2.1 incl. patches.
4140
- Updated DaisyUI
4241
- Updated Svelte 5 --> see [Svelte 5 Migration Guide](https://svelte.dev/docs/svelte/v5-migration-guide)
42+
- Changed platform to latest stable pioarduino (at time of writing: Arduino 3.1.3 and IDF 5.3.2.250210). The code remains fully backward compatible with platform espressif32 6.8.1
4343

4444
### Fixed
4545

lib/framework/APSettingsService.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ class APSettings
130130
newSettings.ssidHidden = root["ssid_hidden"] | FACTORY_AP_SSID_HIDDEN;
131131
newSettings.maxClients = root["max_clients"] | FACTORY_AP_MAX_CLIENTS;
132132

133-
JsonUtils::readIP(root, "local_ip", newSettings.localIP, FACTORY_AP_LOCAL_IP);
134-
JsonUtils::readIP(root, "gateway_ip", newSettings.gatewayIP, FACTORY_AP_GATEWAY_IP);
135-
JsonUtils::readIP(root, "subnet_mask", newSettings.subnetMask, FACTORY_AP_SUBNET_MASK);
133+
JsonUtils::readIPStr(root, "local_ip", newSettings.localIP, FACTORY_AP_LOCAL_IP);
134+
JsonUtils::readIPStr(root, "gateway_ip", newSettings.gatewayIP, FACTORY_AP_GATEWAY_IP);
135+
JsonUtils::readIPStr(root, "subnet_mask", newSettings.subnetMask, FACTORY_AP_SUBNET_MASK);
136136

137137
if (newSettings == settings)
138138
{

lib/framework/DownloadFirmwareService.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <DownloadFirmwareService.h>
1515

1616
extern const uint8_t rootca_crt_bundle_start[] asm("_binary_src_certs_x509_crt_bundle_bin_start");
17+
extern const uint8_t rootca_crt_bundle_end[] asm("_binary_src_certs_x509_crt_bundle_bin_end");
1718

1819
static EventSocket *_socket = nullptr;
1920
static int previousProgress = 0;
@@ -54,7 +55,13 @@ void update_finished()
5455
void updateTask(void *param)
5556
{
5657
WiFiClientSecure client;
58+
59+
#if ESP_ARDUINO_VERSION_MAJOR == 3
60+
client.setCACertBundle(rootca_crt_bundle_start, rootca_crt_bundle_end - rootca_crt_bundle_start);
61+
#else
5762
client.setCACertBundle(rootca_crt_bundle_start);
63+
#endif
64+
5865
client.setTimeout(10);
5966

6067
httpUpdate.setFollowRedirects(HTTPC_FORCE_FOLLOW_REDIRECTS);

lib/framework/DownloadFirmwareService.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <PsychicHttp.h>
2323
#include <SecurityManager.h>
2424

25-
#include <HTTPClient.h>
25+
#include <WiFiClientSecure.h>
2626
#include <HTTPUpdate.h>
2727
// #include <SSLCertBundle.h>
2828

lib/framework/JsonUtils.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
class JsonUtils
2323
{
2424
public:
25-
static void readIP(JsonObject &root, const String &key, IPAddress &ip, const String &def)
25+
static void readIPStr(JsonObject &root, const String &key, IPAddress &ip, const String &def)
2626
{
2727
IPAddress defaultIp = {};
2828
if (!defaultIp.fromString(def))
@@ -31,13 +31,15 @@ class JsonUtils
3131
}
3232
readIP(root, key, ip, defaultIp);
3333
}
34+
3435
static void readIP(JsonObject &root, const String &key, IPAddress &ip, const IPAddress &defaultIp = INADDR_NONE)
3536
{
3637
if (!root[key].is<String>() || !ip.fromString(root[key].as<String>()))
3738
{
3839
ip = defaultIp;
3940
}
4041
}
42+
4143
static void writeIP(JsonObject &root, const String &key, const IPAddress &ip)
4244
{
4345
if (IPUtils::isSet(ip))

lib/framework/MqttSettingsService.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,16 @@ String MqttSettingsService::getLastError()
118118

119119
void MqttSettingsService::onMqttConnect(bool sessionPresent)
120120
{
121-
ESP_LOGI("MQTT", "Connected to MQTT: %s", _mqttClient.getMqttConfig()->uri);
121+
122+
#if ESP_IDF_VERSION_MAJOR == 5
123+
String uri = _mqttClient.getMqttConfig()->broker.address.uri;
124+
#else
125+
String uri = _mqttClient.getMqttConfig()->uri;
126+
#endif
127+
128+
ESP_LOGI("MQTT", "Connected to MQTT: %s", uri.c_str());
122129
#ifdef SERIAL_INFO
123-
Serial.printf("Connected to MQTT: %s\n", _mqttClient.getMqttConfig()->uri);
130+
Serial.printf("Connected to MQTT: %s\n", uri.c_str());
124131
#endif
125132
_lastError = "None";
126133
}

lib/framework/NTPSettingsService.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,24 @@ void NTPSettingsService::configureNTP()
7474
}
7575
else
7676
{
77+
78+
#ifdef CONFIG_LWIP_TCPIP_CORE_LOCKING
79+
if (!sys_thread_tcpip(LWIP_CORE_LOCK_QUERY_HOLDER))
80+
{
81+
LOCK_TCPIP_CORE();
82+
}
83+
#endif
84+
7785
setenv("TZ", _state.tzFormat.c_str(), 1);
7886
tzset();
7987
sntp_stop();
88+
89+
#ifdef CONFIG_LWIP_TCPIP_CORE_LOCKING
90+
if (sys_thread_tcpip(LWIP_CORE_LOCK_QUERY_HOLDER))
91+
{
92+
UNLOCK_TCPIP_CORE();
93+
}
94+
#endif
8095
}
8196
}
8297

lib/framework/NTPSettingsService.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
#include <time.h>
2323
#include <lwip/apps/sntp.h>
2424

25+
#ifdef CONFIG_LWIP_TCPIP_CORE_LOCKING
26+
#include "lwip/priv/tcpip_priv.h"
27+
#endif
28+
2529
#ifndef FACTORY_NTP_ENABLED
2630
#define FACTORY_NTP_ENABLED true
2731
#endif

lib/framework/SettingValue.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717

1818
#include <Arduino.h>
1919

20+
#if ESP_ARDUINO_VERSION_MAJOR == 3
21+
#include <esp_mac.h>
22+
#endif
23+
2024
namespace SettingValue
2125
{
2226
String format(String value);

0 commit comments

Comments
 (0)