Skip to content

Commit

Permalink
Merge branch 'development' into prerelease-14.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
arendst committed Jun 2, 2024
2 parents d8c53d4 + 0249f66 commit 2a2e853
Show file tree
Hide file tree
Showing 273 changed files with 9,051 additions and 8,685 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/Tasmota_build_devel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install clang compiler
run: |
sudo apt-get install -f clang
#- name: Install clang compiler
#run: |
#sudo apt-get install -f clang
- name: Make Berry and Tasmota Berry code
run: |
cd lib/libesp32/berry
Expand Down
1 change: 0 additions & 1 deletion BUILDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ Note: the `minimal` variant is not listed as it shouldn't be used outside of the
| USE_WEBCAM | | / - | | | | |
| USE_ETHERNET | | / x | | | | |
| USE_I2S_AUDIO | | / - | | | | |
| USE_TTGO_WATCH | | / - | | | | |
| USE_SONOFF_SPM | | / x | | | | |
| USE_DISPLAY_TM1621_SONOFF | | / x | | | | |
| USE_SHELLY_PRO | | / x | | | | |
Expand Down
73 changes: 73 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,79 @@ All notable changes to this project will be documented in this file.

## [Released]

## [14.1.0] 20240603
- Release Rachel

## [14.0.0.4] 20240603
### Added
- SML FastExit for binary SML parsing (#21497)

### Changed
- TCP bridge increased baudrate selection (#21528)
- Berry coc parser keeps order of variables (#21542)

### Fixed
- uDisplay Parallel display on Core3 (#21529)
- LVGL exception when using tjpegd (#21544)

### Removed
- Deprecated code from drivers, `USE_TTGO_WATCH` and `USE_M5STACK_CORE2` (#21533)

## [14.0.0.3] 20240530
### Changed
- ESP32 Core3 platform update from 2024.05.12 to 2024.05.13 (#21524)

### Fixed
- ESP32 slow response when using UDP as in emulation (#21470)

## [14.0.0.2] 20240529
### Added
- Disabled watchdog for ESP32 and variants (#21509)

### Changed
- Update Telegram CA (Go Daddy Root Certificate Authority - G2)

### Fixed
- Telegram TLS fingerprint, remove CA validation (#21514)
- ESP32 I2S multiple fixes (#21511)

## [14.0.0.1] 20240527
### Added
- Enabled watchdog for ESP32 and variants (#21422)
- Optional command ``WebRun`` (as WebQuery extension) (#21364)
- Support for Knx dimmer and color (#21434)
- Support for Matter 1.3 Water leak detectors (#21456)
- Berry add reuse of methods for interface-like code reuse (#21500)

### Changed
- ESP32 compiler option from `target-align` to `no-target-align` (#21407)
- On universal display remove default backlight power if a PWM channel is used for backlight
- Berry binary compiled with gcc (#21426)
- GPIOViewer from v1.5.2 to v1.5.3 (No functional change)
- Berry allow easy solidification of external Berry (#21430)
- ESP32 I2S audio improvements (#21433)
- Support W5500 SPI ethernet using four SPI GPIOs only without IRQ and RESET
- Berry change internal storage of parent class for methods (#21490)
- ESP32 Core3 platform update from 2024.05.11 to 2024.05.12 (#21493)

### Fixed
- Domoticz re-subscribe on MQTT reconnect. Regression from v13.4.0.3 (#21281)
- Watchdog restart or freeze if ``displaytext`` is more than 128 characters (#21401)
- Avoid connection errors when switching to safeboot to upload OTA firmware (#21428)
- Berry Leds matrix alternate more and error about 'bri' attribute (#21431)
- Wrong timeout in `WebQuery` and `webclient` since Core3 (#21442)
- Webradio crash with invalid url (#21446)
- Zigbee crash when removing `ZbName` (#21449)
- ESP32 BLE fix scanning (#21451)
- I2S APLL not supported on all SOCs (#21483)
- UfsServe watchdog on large folder (#21486)
- Matter auto-fix IPv6 link-local zone id when network reconnects (#21494)
- SML compile error when median-filter is disabled (#21495)
- Hydreon RG15 malformed JSON string (#21508)

### Removed
- Support of old insecure fingerprint algorithm. Deprecated since v8.4.0 (#21417)

## [14.0.0] 20240515
- Release Rodney

Expand Down
170 changes: 40 additions & 130 deletions RELEASENOTES.md

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions include/esp32x_fixes.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,10 @@
#define SPI_MOSI_DLEN_REG(x) SPI_MS_DLEN_REG(x)

#endif // TARGET

// This trick makes sure that 'lto' optimizer does not inline `delay()
// so we can override it with `-Wl,--wrap=delay` linker directive
#ifdef __cplusplus
extern "C"
#endif // _cplusplus
void delay(__UINT32_TYPE__ ms) __attribute__((noinline)) __attribute__ ((noclone));
7 changes: 7 additions & 0 deletions lib/default/WiFiHelper/src/WiFiHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ class WiFiHelper {
// With ESP32 Core3, the WiFi mac address is not valid until the wifi is actually started
// this helper function always provide a valid mac address
static String macAddress(void);

// Auto-fix zone
//
// After a reconnect, the zone id may not be valid anymore
// In such case we detect any "%st<n>" or "%en<n>" zone identifier
// and replace with the current zone id
static void IPv6ZoneAutoFix(IPAddress &addr, const char* aHostname);
};


Expand Down
39 changes: 39 additions & 0 deletions lib/default/WiFiHelper/src/WiFiHelper_ESP32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,44 @@ static void wifi32_dns_found_callback(const char *name, const ip_addr_t *ipaddr,
// AddLog(LOG_LEVEL_DEBUG, "WIF: dns_found=%s", ipaddr ? IPAddress(*ipaddr).toString().c_str() : "<null>");
}

// Auto-fix zone
//
// After a reconnect, the zone id may not be valid anymore
// In such case we detect any "%st<n>" or "%en<n>" zone identifier
// and replace with the current zone id
extern bool WifiGetIPv6LinkLocal(IPAddress *ip);
extern bool EthernetGetIPv6LinkLocal(IPAddress *ip);
void WiFiHelper::IPv6ZoneAutoFix(IPAddress &addr, const char* aHostname) {
#ifdef USE_IPV6
if ((addr.type() == IPv6) && (addr.zone() == 0)) {
// check if hostname contains '%'
const char *zone_identifier = strchr(aHostname, '%');
if (zone_identifier != nullptr) {
uint8_t zone_id = 0;
// check if zone id is valid
if (strncmp(zone_identifier, "%st", 3) == 0) {
IPAddress wifi_link_local;
if (WifiGetIPv6LinkLocal(&wifi_link_local)) {
zone_id = wifi_link_local.zone();
}
} else if (strncmp(zone_identifier, "%en", 3) == 0) {
IPAddress eth_link_local;
if (EthernetGetIPv6LinkLocal(&eth_link_local)) {
zone_id = eth_link_local.zone();
}
}
if (zone_id) {
// convert to ip_addr_t which is currently the only way to change the zone_id
ip_addr_t ip_addr;
addr.to_ip_addr_t(&ip_addr);
ip_addr.u_addr.ip6.zone = zone_id;
addr = IPAddress(&ip_addr);
}
}
}
#endif
}

/**
* Resolve the given hostname to an IP address.
* @param aHostname Name to be resolved
Expand Down Expand Up @@ -281,6 +319,7 @@ int WiFiHelper::hostByName(const char* aHostname, IPAddress& aResult, int32_t ti
if (!ip_addr_isany_val(dns_ipaddr)) {
#ifdef USE_IPV6
aResult.from_ip_addr_t(&dns_ipaddr);
WiFiHelper::IPv6ZoneAutoFix(aResult, aHostname);
#else // USE_IPV6
aResult = ip_addr_get_ip4_u32(&dns_ipaddr);
#endif // USE_IPV6
Expand Down
2 changes: 2 additions & 0 deletions lib/default/WiFiHelper/src/WiFiHelper_ESP8266.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,6 @@ String WiFiHelper::macAddress(void) {
return WiFi.macAddress();
}

void WiFiHelper::IPv6ZoneAutoFix(IPAddress &addr, const char* aHostname) {
}
#endif // ESP8266
10 changes: 4 additions & 6 deletions lib/lib_audio/ESP8266Audio/src/AudioFileSourceICYStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,15 @@ bool AudioFileSourceICYStream::open(const char *url)
{
static const char *hdr[] = { "icy-metaint", "icy-name", "icy-genre", "icy-br" };
pos = 0;
http.begin(client, url);
if (!http.begin(client, url)) {
cb.st(STATUS_HTTPFAIL, PSTR("Can't connect to url"));
return false;
}
http.addHeader("Icy-MetaData", "1");
http.collectHeaders( hdr, 4 );
http.setReuse(true);
http.setFollowRedirects(HTTPC_FORCE_FOLLOW_REDIRECTS);
int code = http.GET();
if (code != HTTP_CODE_OK) {
http.end();
cb.st(STATUS_HTTPFAIL, PSTR("Can't open HTTP request"));
return false;
}
if (http.hasHeader(hdr[0])) {
String ret = http.header(hdr[0]);
icyMetaInt = ret.toInt();
Expand Down
8 changes: 6 additions & 2 deletions lib/lib_audio/ESP8266Audio/src/AudioGeneratorMP3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ bool AudioGeneratorMP3::GetOneSample(int16_t sample[2])
// If we're here, we have one decoded frame and sent 0 or more samples out
if (samplePtr < synth->pcm.length) {
sample[AudioOutput::LEFTCHANNEL ] = synth->pcm.samples[0][samplePtr];
sample[AudioOutput::RIGHTCHANNEL] = synth->pcm.samples[1][samplePtr];
if(lastChannels == 2) {
sample[AudioOutput::RIGHTCHANNEL] = synth->pcm.samples[1][samplePtr];
}
samplePtr++;
} else {
samplePtr = 0;
Expand All @@ -200,7 +202,9 @@ bool AudioGeneratorMP3::GetOneSample(int16_t sample[2])
}
// for IGNORE and CONTINUE, just play what we have now
sample[AudioOutput::LEFTCHANNEL ] = synth->pcm.samples[0][samplePtr];
sample[AudioOutput::RIGHTCHANNEL] = synth->pcm.samples[1][samplePtr];
if(lastChannels == 2) {
sample[AudioOutput::RIGHTCHANNEL] = synth->pcm.samples[1][samplePtr];
}
samplePtr++;
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion lib/lib_audio/ESP8266Audio/src/AudioOutputMixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ bool AudioOutputMixer::loop()
}
}
if (avail) {
int16_t s[2];
int16_t s[2] = {0};
if (leftAccum[readPtr] > 32767) {
s[LEFTCHANNEL] = 32767;
} else if (leftAccum[readPtr] < -32767) {
Expand Down
1 change: 1 addition & 0 deletions lib/lib_display/UDisplay/uDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1289,6 +1289,7 @@ Renderer *uDisplay::Init(void) {
esp_lcd_i80_bus_config_t bus_config = {
.dc_gpio_num = par_rs,
.wr_gpio_num = par_wr,
.clk_src = LCD_CLK_SRC_DEFAULT,
.bus_width = bus_width,
.max_transfer_bytes = 32768
};
Expand Down
57 changes: 0 additions & 57 deletions lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -813,25 +813,6 @@ extern "C" {
// Return 0 on validation success, !0 on validation error
static unsigned pubkeyfingerprint_end_chain(const br_x509_class **ctx) {
br_x509_pubkeyfingerprint_context *xc = (br_x509_pubkeyfingerprint_context *)ctx;
// **** Start patch Castellucci
/*
br_sha1_context sha1_context;
pubkeyfingerprint_pubkey_fingerprint(&sha1_context, xc->ctx.pkey.key.rsa);
br_sha1_out(&sha1_context, xc->pubkey_recv_fingerprint); // copy to fingerprint
if (!xc->fingerprint_all) {
if (0 == memcmp_P(xc->pubkey_recv_fingerprint, xc->fingerprint1, 20)) {
return 0;
}
if (0 == memcmp_P(xc->pubkey_recv_fingerprint, xc->fingerprint2, 20)) {
return 0;
}
return 1; // no match, error
} else {
// Default (no validation at all) or no errors in prior checks = success.
return 0;
}
*/
// set fingerprint status byte to zero
// FIXME: find a better way to pass this information
xc->pubkey_recv_fingerprint[20] = 0;
Expand All @@ -844,45 +825,7 @@ extern "C" {
if (0 == memcmp_P(xc->pubkey_recv_fingerprint, xc->fingerprint2, 20)) {
return 0;
}

#ifndef USE_MQTT_TLS_DROP_OLD_FINGERPRINT
// No match under new algorithm, do some basic checking on the key.
//
// RSA keys normally have an e value of 65537, which is three bytes long.
// Other e values are suspicious, but if the modulus is a standard size
// (multiple of 512 bits/64 bytes), any public exponent up to eight bytes
// long will be allowed.
//
// A legitimate key could possibly be marked as bad by this check, but
// the user would have had to really worked at making a strange key.
if (!(xc->ctx.pkey.key.rsa.elen == 3
&& xc->ctx.pkey.key.rsa.e[0] == 1
&& xc->ctx.pkey.key.rsa.e[1] == 0
&& xc->ctx.pkey.key.rsa.e[2] == 1)) {
if (xc->ctx.pkey.key.rsa.nlen & 63 != 0 || xc->ctx.pkey.key.rsa.elen > 8) {
return 2; // suspicious key, return error
}
}

// try the old algorithm and potentially mark for update
pubkeyfingerprint_pubkey_fingerprint(xc, true);
if (0 == memcmp_P(xc->pubkey_recv_fingerprint, xc->fingerprint1, 20)) {
xc->pubkey_recv_fingerprint[20] |= 1; // mark for update
}
if (0 == memcmp_P(xc->pubkey_recv_fingerprint, xc->fingerprint2, 20)) {
xc->pubkey_recv_fingerprint[20] |= 2; // mark for update
}
if (!xc->pubkey_recv_fingerprint[20]) {
return 1; // not marked for update because no match, error
}

// the old fingerprint format matched, recompute new one for update
pubkeyfingerprint_pubkey_fingerprint(xc, false);

return 0;
#else // USE_TLS_OLD_FINGERPRINT_COMPAT
return 1; // no match, error
#endif // USE_TLS_OLD_FINGERPRINT_COMPAT
} else {
// Default (no validation at all) or no errors in prior checks = success.
return 0;
Expand Down
2 changes: 1 addition & 1 deletion lib/libesp32/ESP-Mail-Client/src/ESP_Mail_TCPClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class ESP_Mail_TCPClient
*/
void setTimeout(uint32_t timeoutSec)
{
_tcp_client->setTimeout(timeoutSec);
_tcp_client->setTimeout(timeoutSec * 1000);
}

/** Set the BearSSL IO buffer size.
Expand Down
4 changes: 2 additions & 2 deletions lib/libesp32/HttpClientLight/src/HttpClientLight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ void HTTPClientLight::setTimeout(uint16_t timeout)
{
_tcpTimeout = timeout;
if(connected()) {
_client->setTimeout((timeout + 500) / 1000);
_client->setTimeout(timeout);
}
}

Expand Down Expand Up @@ -1176,7 +1176,7 @@ bool HTTPClientLight::connect(void)
}

// set Timeout for WiFiClient and for Stream::readBytesUntil() and Stream::readStringUntil()
_client->setTimeout((_tcpTimeout + 500) / 1000);
_client->setTimeout(_tcpTimeout);

log_d(" connected to %s:%u", _host.c_str(), _port);

Expand Down
2 changes: 1 addition & 1 deletion lib/libesp32/HttpClientLight/src/TasUpdater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ size_t TasUpdateClass::writeStream(Stream &data) {
return written;
written += toRead;

delay(1); // Fix solo WDT
yield(); // Ensure WDT does not trigger
}
return written;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/libesp32/berry/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ DEBUG_FLAGS = -O0 -g -DBE_DEBUG
TEST_FLAGS = $(DEBUG_FLAGS) --coverage -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
LIBS = -lm
TARGET = berry
CC = clang # install clang!! gcc seems to produce a defect berry binary
CC = gcc
MKDIR = mkdir
LFLAGS =

Expand Down
3 changes: 3 additions & 0 deletions lib/libesp32/berry/default/be_modtab.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
** https://github.com/Skiars/berry/blob/master/LICENSE
********************************************************************/
#include "berry.h"
#include "../../berry_custom/src/modules.h"

/* this file contains the declaration of the module table. */

Expand Down Expand Up @@ -189,6 +190,7 @@ BERRY_LOCAL const bntvmodule_t* const be_module_table[] = {
&be_native_module(matter),
#endif // USE_MATTER_DEVICE
#endif // TASMOTA
CUSTOM_NATIVE_MODULES
/* user-defined modules register end */
NULL /* do not remove */
};
Expand Down Expand Up @@ -313,6 +315,7 @@ BERRY_LOCAL bclass_array be_class_table = {
#if defined(USE_BERRY_INT64) || defined(USE_MATTER_DEVICE)
&be_native_class(int64),
#endif
CUSTOM_NATIVE_CLASSES
NULL, /* do not remove */
};

Expand Down
Loading

0 comments on commit 2a2e853

Please sign in to comment.