From 370debc0e2f731a457f768bf40832dfc7830409c Mon Sep 17 00:00:00 2001 From: mnowa Date: Mon, 12 Dec 2022 16:13:04 +0100 Subject: [PATCH 1/3] Update xsns_53_sml.ino Maximum bytes count for binary modbus CRC calculation in relation to SML_BSIZ value --- tasmota/tasmota_xsns_sensor/xsns_53_sml.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasmota/tasmota_xsns_sensor/xsns_53_sml.ino b/tasmota/tasmota_xsns_sensor/xsns_53_sml.ino index 2cf934c57..707c9e6b0 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_53_sml.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_53_sml.ino @@ -2376,7 +2376,7 @@ void SML_Decode(uint8_t index) { mp++; } else { uint16_t pos = smltbuf[mindex][2] + 3; - if (pos > 32) pos = 32; + if (pos > (SML_BSIZ-2)) pos = SML_BSIZ-2; uint16_t crc = MBUS_calculateCRC(&smltbuf[mindex][0], pos, 0xFFFF); if (lowByte(crc) != smltbuf[mindex][pos]) goto nextsect; if (highByte(crc) != smltbuf[mindex][pos + 1]) goto nextsect; From 7e27945e5ae8b28d18d075bcfdf7c2609d3a9aae Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Mon, 12 Dec 2022 23:07:14 +0100 Subject: [PATCH 2/3] ESP32 fix ``Ping`` (#17373) --- CHANGELOG.md | 1 + tasmota/tasmota_xdrv_driver/xdrv_38_ping.ino | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 089d76cf6..2596d09a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ All notable changes to this project will be documented in this file. - RCSwitch exception 0/6 on some protocols (#17285) - ESP32 exception 28 when RtcNtpServer is enabled on restart (#17338) - Analog MQ exception 28 on restart (#17271) +- ESP32 fix ``Ping`` ### Removed diff --git a/tasmota/tasmota_xdrv_driver/xdrv_38_ping.ino b/tasmota/tasmota_xdrv_driver/xdrv_38_ping.ino index 25cbce72d..449b4d40e 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_38_ping.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_38_ping.ino @@ -172,7 +172,7 @@ extern "C" { return 0; // don't eat the packet and ignore it } - if (pbuf_header( p, -PBUF_IP_HLEN)==0) { + if (pbuf_header( p, -PBUF_TRANSPORT_HLEN)==0) { struct icmp_echo_hdr *iecho; iecho = (struct icmp_echo_hdr *)p->payload; From f429d41a32b03815d7cf1e1809e95116e2241256 Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Tue, 13 Dec 2022 09:31:43 +0100 Subject: [PATCH 3/3] Fix IPv6 compilation for ESP8266 (#17374) --- tasmota/tasmota_support/support_wifi.ino | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tasmota/tasmota_support/support_wifi.ino b/tasmota/tasmota_support/support_wifi.ino index 5088ab81b..cc03a8fde 100644 --- a/tasmota/tasmota_support/support_wifi.ino +++ b/tasmota/tasmota_support/support_wifi.ino @@ -517,8 +517,14 @@ void WifiDumpAddressesIPv6(void) // Check to see if we have any routable IP address bool WifiHasIP(void) { #ifdef USE_IPV6 +#ifdef ESP32 return !WiFi.localIP().isAny(); +#else // ESP32 + const ip_addr_t &ipaddr = (ip_addr_t)WiFi.localIP(); + return !ip_addr_isany_val(ipaddr); +#endif // ESP32 #else + // IPv4 only return (uint32_t)WiFi.localIP() != 0; #endif // USE_IPV6 } @@ -526,12 +532,13 @@ bool WifiHasIP(void) { void WifiCheckIp(void) { #ifdef USE_IPV6 if (WL_CONNECTED == WiFi.status()) { +#ifdef ESP32 if (!Wifi.ipv6_local_link_called) { WiFi.enableIpV6(); Wifi.ipv6_local_link_called = true; // AddLog(LOG_LEVEL_DEBUG, PSTR("WIF: calling enableIpV6")); } - +#endif } #endif // USE_IPV6