From 9c95ec259028f3998f1d232d43709018edc61e6a Mon Sep 17 00:00:00 2001 From: xyzroe Date: Wed, 12 Jun 2024 01:14:20 +0200 Subject: [PATCH] 20240612 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add 1wire support if 33 pin is free - Fix SLS Zigbee pinout - Fix T-Internet-POE detection (pin 14) - Update cz.json #75 Thanks @leroyloren 🏆 --- src/const/hw.cpp | 4 ++-- src/etc.cpp | 16 ---------------- src/main.cpp | 5 +---- 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/src/const/hw.cpp b/src/const/hw.cpp index 5c3eea1..1d93b53 100644 --- a/src/const/hw.cpp +++ b/src/const/hw.cpp @@ -28,7 +28,7 @@ MistConfig mistConfigs[] = { {.btnPin = 35, .btnPlr = 1, .uartSelPin = 33, .uartSelPlr = 1, .ledModePin = 12, .ledModePlr = 1, .ledPwrPin = 14, .ledPwrPlr = 1}, // 1 {.btnPin = 35, .btnPlr = 1, .uartSelPin = 4, .uartSelPlr = 1, .ledModePin = 12, .ledModePlr = 1, .ledPwrPin = 14, .ledPwrPlr = 1}, // 2 {.btnPin = 33, .btnPlr = 1, .uartSelPin = -1, .uartSelPlr = 0, .ledModePin = -1, .ledModePlr = 0, .ledPwrPin = -1, .ledPwrPlr = 0}, // 3 SLS-classic - {.btnPin = 14, .btnPlr = 1, .uartSelPin = -1, .uartSelPlr = 0, .ledModePin = -1, .ledModePlr = 0, .ledPwrPin = -1, .ledPwrPlr = 0}, // 4 TTGO + {.btnPin = 14, .btnPlr = 1, .uartSelPin = -1, .uartSelPlr = 0, .ledModePin = -1, .ledModePlr = 0, .ledPwrPin = -1, .ledPwrPlr = 0}, // 4 T-Internet-POE }; // Board configurations @@ -38,7 +38,7 @@ BrdConfigStruct brdConfigs[] = { {"UZG-01", .ethConfigIndex = 2, .zbConfigIndex = 0, .mistConfigIndex = 1}, // 1 {"SLZB-06", .ethConfigIndex = 1, .zbConfigIndex = 1, .mistConfigIndex = 2}, // 2 {"WT32-ETH01", .ethConfigIndex = 1, .zbConfigIndex = 1, .mistConfigIndex = 0}, // 3 - {"T-Internet-POE", .ethConfigIndex = 2, .zbConfigIndex = 0, .mistConfigIndex = 4}, // 4 DON'T MOVE + {"T-Internet-POE", .ethConfigIndex = 2, .zbConfigIndex = 0, .mistConfigIndex = 4}, // 4 {"Olimex-ESP32-POE", .ethConfigIndex = 0, .zbConfigIndex = 0, .mistConfigIndex = 0}, // 5 {"China-GW", .ethConfigIndex = 0, .zbConfigIndex = 2, .mistConfigIndex = 0}, // 6 {"TubesZB-eth", .ethConfigIndex = 1, .zbConfigIndex = 1, .mistConfigIndex = 0}, // 7 diff --git a/src/etc.cpp b/src/etc.cpp index 228e2f1..1e41906 100644 --- a/src/etc.cpp +++ b/src/etc.cpp @@ -706,22 +706,6 @@ ThisConfigStruct *findBrdConfig(int searchId = 0) LOGI("Try brd: %d - %s", brdIdx, brdConfigs[brdIdx].board); - /*if (brdIdx == 4) // T-Internet-POE - { - pinMode(ethConfigs[ethIdx].pwrPin, OUTPUT); - delay(50); - digitalWrite(ethConfigs[ethIdx].pwrPin, LOW); - delay(50); - pinMode(ethConfigs[ethIdx].pwrPin, INPUT); - delay(50); - bool pwrPinState = digitalRead(ethConfigs[ethIdx].pwrPin); - if (pwrPinState) - { - LOGW("%s", "Looks like not T-Internet-POE!"); - continue; - } - }*/ - if (ethIdx == -1) { ethOk = true; diff --git a/src/main.cpp b/src/main.cpp index e21b100..c62512c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -589,7 +589,7 @@ void setup() } String cfg = makeJsonConfig(&networkCfg, &vpnCfg, &mqttCfg, &systemCfg); - LOGD("Config:\n%s", cfg.c_str()); + LOGI("Config:\n%s", cfg.c_str()); cfg = makeJsonConfig(NULL, NULL, NULL, NULL, &vars); LOGI("VARS:\n%s", cfg.c_str()); @@ -624,11 +624,8 @@ void setup() setup1wire(check1wire()); - //LOGI("1w = %f", get1wire()); LOGI("done"); - - } WiFiClient client[10];