This commit is contained in:
2026-10-24 23:23:20 +02:00
parent d45c14f714
commit b29432cdba
6 changed files with 16 additions and 106 deletions
+1 -1
Submodule core updated: 1c21d0840f...c80f61a60a
+1 -12
View File
@@ -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
-28
View File
@@ -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
-6
View File
@@ -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"
+12 -37
View File
@@ -33,16 +33,12 @@ void app_main(void);
}
struct DeviceState {
Color color{0x80, 0x80, 0x80};
vector<uint8_t> counts;
vector<uint8_t> 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<uint8_t> grouping; // LED groups for LED-Strip
vector<uint8_t> times; // Step times for effects
};
struct MasterRequest {};
struct SlaveResponse {};
static fos::Queue<MasterRequest> commandQ(2);
static fos::Queue<SlaveResponse> 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<MasterRequest>());
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<LocalSpitObj> 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);
-20
View File
@@ -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