From b29432cdbac3c30283f5c4eef94ce0efa15de1dc Mon Sep 17 00:00:00 2001 From: Jakob Gegeniger Date: Sat, 24 Oct 2026 23:23:20 +0200 Subject: [PATCH] tidy up --- core | 2 +- dependencies.lock | 13 +---------- main/Kconfig.projbuild | 28 ---------------------- main/idf_component.yml | 6 ----- main/lightsMain.cpp | 53 +++++++++++------------------------------- sdkconfig | 20 ---------------- 6 files changed, 16 insertions(+), 106 deletions(-) delete mode 100644 main/Kconfig.projbuild delete mode 100644 main/idf_component.yml diff --git a/core b/core index 1c21d08..c80f61a 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 1c21d0840ffdf5cb3f752ce8a7ffcd5f3d060a3f +Subproject commit c80f61a60a1f493cb3f596c9f1ac446d692a04d7 diff --git a/dependencies.lock b/dependencies.lock index 545989d..fa98cc6 100644 --- a/dependencies.lock +++ b/dependencies.lock @@ -1,21 +1,10 @@ dependencies: - frozen-eye/esp_telnet: - component_hash: e00a16d6372fa31df46b32e330847d6e09af2ec184d8c7cac4d183b3daac02e5 - dependencies: - - name: idf - require: private - version: '>=4.0' - source: - registry_url: https://components.espressif.com/ - type: service - version: 0.0.2 idf: source: type: idf version: 5.4.3 direct_dependencies: -- frozen-eye/esp_telnet - idf -manifest_hash: f3dbb2beffe19f6e4fa3818b79ea2bfac679eaaf47effee78f152007a2be54f5 +manifest_hash: f963becbad30dee4a0a46222b7f0ae7dd40100701f7b7147a846011f8dabe9ca target: esp32 version: 2.0.0 diff --git a/main/Kconfig.projbuild b/main/Kconfig.projbuild deleted file mode 100644 index 0be2ccc..0000000 --- a/main/Kconfig.projbuild +++ /dev/null @@ -1,28 +0,0 @@ -menu "Example Configuration" - - config DEVICE_WIFI_SSID - string "Wi-Fi SSID" - default "eth2ap" - help - Set the SSID of Wi-Fi ap interface. - - config DEVICE_WIFI_PASSWORD - string "Wi-Fi Password" - default "12345678" - help - Set the password of Wi-Fi ap interface. - - config DEVICE_WIFI_CHANNEL - int "WiFi channel" - range 1 13 - default 1 - help - Set the channel of Wi-Fi ap. - - config DEVICE_MAX_STA_CONN - int "Maximum STA connections" - default 4 - help - Maximum number of the station that allowed to connect to current Wi-Fi hotspot. - -endmenu diff --git a/main/idf_component.yml b/main/idf_component.yml deleted file mode 100644 index 23052c8..0000000 --- a/main/idf_component.yml +++ /dev/null @@ -1,6 +0,0 @@ -## IDF Component Manager Manifest File -# https://docs.espressif.com/projects/idf-component-manager/en/latest/reference/manifest_file.html -# https://components.espressif.com - -dependencies: - frozen-eye/esp_telnet: "^0.0.2" diff --git a/main/lightsMain.cpp b/main/lightsMain.cpp index 6fcff3d..34e63e8 100644 --- a/main/lightsMain.cpp +++ b/main/lightsMain.cpp @@ -15,7 +15,7 @@ // }, // // LED-Strips: 14 - 22 - 30 -// >> update http://172.16.16.10:8000/LeoLightShow.bin +// >> update http://172.16.16.10:8000/LeoLightShow.bin #include "config.hpp" #include "lighsMain.hpp" @@ -33,16 +33,12 @@ void app_main(void); } struct DeviceState { - Color color{0x80, 0x80, 0x80}; - vector counts; - vector times; -}; -struct MasterRequest { - uint8_t pos; // 0 for none / Valid indexes 1 .. 6 -}; -struct SlaveResponse { - uint8_t pos; // 0 for none / Valid indexes 1 .. 6 + Color color{0x80, 0x80, 0x40}; // Color for the chosen bottle + vector grouping; // LED groups for LED-Strip + vector times; // Step times for effects }; +struct MasterRequest {}; +struct SlaveResponse {}; static fos::Queue commandQ(2); static fos::Queue responseQ(2); @@ -55,7 +51,6 @@ void onCommand(string name, Cli::CArgs args) { ESP_LOGI(TAG, "Invoking: %s", name.c_str()); } - void setLogServerConfig(Cli::CArgs args) { ESP_LOGI(TAG, "on showLogServerConfig:"); auto& store = NvsApi::getInstance(); @@ -80,7 +75,7 @@ void showProcessValues(Cli::CArgs args) { sprintf(buff, "%02x,%02x,%02x", State.color.getRed(), State.color.getGreen(), State.color.getBlue()); std::stringstream ssC; - for (auto& c : State.counts) { + for (auto& c : State.grouping) { ssC << string{c} << ","; } std::stringstream ssT; @@ -92,24 +87,6 @@ void showProcessValues(Cli::CArgs args) { pShell->writeLine(string{" Switch-Times: "} + ssT.str()); } -void setSyslogLevel(Cli::CArgs args) { - if (args.size() != 1) { - pShell->writeLine("Needs SyslogLevel Warning = 4, Notice = 5, Informational = 6, Debug = 7"); - return; - } - - try { - auto lvl = stoi(args[0]); - if (lvl >= (int)Syslog::Severity::Warning && lvl <= (int)Syslog::Severity::Debug) { - Syslog::setSeverity((Syslog::Severity)lvl); - } else { - pShell->writeLine("New level was not accepted"); - } - } catch (const exception& e) { - ESP_LOGI(TAG, "Failed to parse %s", args[0].c_str()); - } -} - /** * @brief Telnet socket via TCP/IP * @@ -126,10 +103,8 @@ static void telnetSocketTask(int addrFamily) { pShell->addBinding( {"setLogserver", "Set log server config ip", [](Cli::CArgs a) { setLogServerConfig(a); }}); - pShell->addBinding( - {"setLogLevel", "Set severity log server", - [](Cli::CArgs a) { setSyslogLevel(a); }}); - + + Syslog::registerCli(*pShell); auto& store = NvsApi::getInstance(); store.registerCli(*pShell); SystemFunctions::registerCli(*pShell); @@ -290,7 +265,7 @@ void LightingTask() { ESP_LOGI(TAG, "Start Lighting"); auto const& colorSource = State.color; - AddressableLeRtz strip(LedPin, AddressableLeRtz::Type::Rgb, LedData.size()/4); + AddressableLeRtz strip(LedPin, AddressableLeRtz::Type::Rgb, LedData.size() / 4); OutputPort relay(RelayPin); relay.write(true); @@ -507,7 +482,7 @@ void onPlaySpitType(string p_PlayerID, string spitTypeId, bool p_PlayerIsRunning auto command = ProvidedSpitActions[spitTypeId]; // ESP_LOGI(TAG, "Player: %s is running: %s Object", p_PlayerID.data(), spitTypeId.c_str()); commandQ.enqueue(make_unique()); - Syslog::logv(Syslog::Severity::Informational, "Got SPIT command for move ot : r%d", command.pos); + Syslog::logv(Syslog::Severity::Informational, "Got SPIT command"); } } @@ -530,9 +505,9 @@ void SpitClientApp() { auto& expected = SpitTypes.Expected; vector ProvidedObj; - ProvidedSpitActions[provided.group] = MasterRequest{.pos = 0}; + ProvidedSpitActions[provided.group] = MasterRequest{}; ProvidedObj.push_back(LocalSpitObj{.iD = provided.group, .groupName = provided.group, .name = provided.group}); - ProvidedSpitActions[provided.startShow] = MasterRequest{.pos = 0}; + ProvidedSpitActions[provided.startShow] = MasterRequest{}; ProvidedObj.push_back(LocalSpitObj{.iD = provided.startShow, .groupName = provided.group, .name = provided.startShow}); ExpectedObjects[expected.showDone] = ""; @@ -628,7 +603,7 @@ void app_main(void) { // ESP_LOGI(TAG, "%s: %s", ConfigKeys.spitServer, store.getValue(ConfigKeys.spitServer).c_str()); ESP_LOGI(TAG, "## Starting : %s : %s", - CONFIG_LWIP_LOCAL_HOSTNAME, VERSION); + CONFIG_LWIP_LOCAL_HOSTNAME, VERSION); while (true) { fos::Task::delayMs(5000); diff --git a/sdkconfig b/sdkconfig index 04ee08d..e72381d 100644 --- a/sdkconfig +++ b/sdkconfig @@ -405,15 +405,6 @@ CONFIG_PARTITION_TABLE_OFFSET=0x8000 CONFIG_PARTITION_TABLE_MD5=y # end of Partition Table -# -# Example Configuration -# -CONFIG_DEVICE_WIFI_SSID="eth2ap" -CONFIG_DEVICE_WIFI_PASSWORD="12345678" -CONFIG_DEVICE_WIFI_CHANNEL=1 -CONFIG_DEVICE_MAX_STA_CONN=4 -# end of Example Configuration - # # Example Ethernet Configuration # @@ -2027,17 +2018,6 @@ CONFIG_LITTLEFS_MALLOC_STRATEGY_DEFAULT=y # CONFIG_LITTLEFS_MALLOC_STRATEGY_INTERNAL is not set CONFIG_LITTLEFS_ASSERTS=y # end of LittleFS - -# -# Telnet Server -# -CONFIG_TELNET_SERVER_DEFAULT_PORT=23 -CONFIG_TELNET_SERVER_MAX_CONNECTIONS=5 -CONFIG_TELNET_SERVER_STACK_SIZE=4096 -CONFIG_TELNET_SERVER_TASK_PRIORITY=24 -CONFIG_TELNET_SERVER_TASK_CORE=0 -CONFIG_TELNET_SERVER_REDIRECT_LOGS=0 -# end of Telnet Server # end of Component config # CONFIG_IDF_EXPERIMENTAL_FEATURES is not set