From 4b93362dd76f411262b064dc18f890d69aae8311 Mon Sep 17 00:00:00 2001 From: Christoph Stoiber Date: Thu, 17 Sep 2026 18:07:53 +0200 Subject: [PATCH] Improved for ESP32S3 --- src/scale.cpp | 8 ++++++-- src/wlan.cpp | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/scale.cpp b/src/scale.cpp index f6e08ea..43d9b7b 100644 --- a/src/scale.cpp +++ b/src/scale.cpp @@ -261,8 +261,12 @@ bool deepSearchScale() { // without pull-up resistor (10k) on LOADCELL_DOUT_PIN the hx711 lib functions // are not reliable in detecting a missing chip // these tests work even without pull-up resistor - const uint32_t timeout = 1000; - const int samples = 10; + #if CONFIG_IDF_TARGET_ESP32S3 + const uint32_t timeout = 5000; // 5 seconds timeout for waiting for the chip to respond (Recogignition Problems with ESP32-S3) + #else + const uint32_t timeout = 1000; // 1 second timeout for waiting for the chip to respond + #endif + const int samples = 10; pinMode(LOADCELL_DOUT_PIN, INPUT); pinMode(LOADCELL_SCK_PIN, OUTPUT); diff --git a/src/wlan.cpp b/src/wlan.cpp index 06a8472..0c17a66 100644 --- a/src/wlan.cpp +++ b/src/wlan.cpp @@ -31,8 +31,12 @@ void wifiSettings() { // Maximale Sendeleistung. 17dBm war ein Kompromiss gegen Hitzeprobleme, // führte bei marginalem Empfang aber zu AP-seitigen Auth-/Assoc-Kicks - // (reason=2/4/9/202). Bei Verdacht auf Überhitzung wieder auf 17dBm zurück. + // (reason=2/4/9/202). Bei Verdacht auf Überhitzung wieder auf 17dBm zurück. ESP32-S3 hat Proleme mit 19,5dBm, daher hier 8,5dBm. + #if CONFIG_IDF_TARGET_ESP32S3 + WiFi.setTxPower(WIFI_POWER_8_5dBm); + #else WiFi.setTxPower(WIFI_POWER_19_5dBm); + #endif // Hinweis: Kein esp_wifi_set_rssi_threshold() mehr. // Der vorherige Wert (-80 dBm) löste in Single-AP-Heimnetzen häufige