mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-15 17:42:12 +00:00
Add hostMetrics user string to config.yaml and trunk
This commit is contained in:
parent
ea7d3cd442
commit
ad6ad03e81
@ -197,6 +197,7 @@ Webserver:
|
|||||||
HostMetrics:
|
HostMetrics:
|
||||||
# ReportInterval: 30 # Interval in minutes between HostMetrics report packets, or 0 for disabled
|
# ReportInterval: 30 # Interval in minutes between HostMetrics report packets, or 0 for disabled
|
||||||
# Channel: 0 # channel to send Host Metrics over. Defaults to the primary channel.
|
# Channel: 0 # channel to send Host Metrics over. Defaults to the primary channel.
|
||||||
|
# UserStringCommand: cat /sys/firmware/devicetree/base/serial-number # Command to execute, to send the results as the userString
|
||||||
|
|
||||||
|
|
||||||
General:
|
General:
|
||||||
|
@ -30,8 +30,8 @@ bool HostMetricsModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp,
|
|||||||
#ifdef DEBUG_PORT
|
#ifdef DEBUG_PORT
|
||||||
const char *sender = getSenderShortName(mp);
|
const char *sender = getSenderShortName(mp);
|
||||||
|
|
||||||
LOG_INFO("(Received Host Metrics from %s): uptime=%u, diskfree=%lu, memory free=%lu, load=%04.2f, %04.2f, %04.2f, %s", sender,
|
LOG_INFO("(Received Host Metrics from %s): uptime=%u, diskfree=%lu, memory free=%lu, load=%04.2f, %04.2f, %04.2f, %s",
|
||||||
t->variant.host_metrics.uptime_seconds, t->variant.host_metrics.diskfree1_bytes,
|
sender, t->variant.host_metrics.uptime_seconds, t->variant.host_metrics.diskfree1_bytes,
|
||||||
t->variant.host_metrics.freemem_bytes, static_cast<float>(t->variant.host_metrics.load1) / 100,
|
t->variant.host_metrics.freemem_bytes, static_cast<float>(t->variant.host_metrics.load1) / 100,
|
||||||
static_cast<float>(t->variant.host_metrics.load5) / 100,
|
static_cast<float>(t->variant.host_metrics.load5) / 100,
|
||||||
static_cast<float>(t->variant.host_metrics.load15) / 100, t->variant.host_metrics.user_string);
|
static_cast<float>(t->variant.host_metrics.load15) / 100, t->variant.host_metrics.user_string);
|
||||||
@ -112,7 +112,6 @@ meshtastic_Telemetry HostMetricsModule::getHostMetrics()
|
|||||||
if (userCommandResult.length() > 1) {
|
if (userCommandResult.length() > 1) {
|
||||||
strncpy(t.variant.host_metrics.user_string, userCommandResult.c_str(), 200);
|
strncpy(t.variant.host_metrics.user_string, userCommandResult.c_str(), 200);
|
||||||
t.variant.host_metrics.has_user_string = true;
|
t.variant.host_metrics.has_user_string = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return t;
|
return t;
|
||||||
|
@ -604,7 +604,6 @@ bool loadConfig(const char *configPath)
|
|||||||
settingsMap[hostMetrics_channel] = (yamlConfig["HostMetrics"]["Channel"]).as<int>(0);
|
settingsMap[hostMetrics_channel] = (yamlConfig["HostMetrics"]["Channel"]).as<int>(0);
|
||||||
settingsMap[hostMetrics_interval] = (yamlConfig["HostMetrics"]["ReportInterval"]).as<int>(0);
|
settingsMap[hostMetrics_interval] = (yamlConfig["HostMetrics"]["ReportInterval"]).as<int>(0);
|
||||||
settingsStrings[hostMetrics_user_command] = (yamlConfig["HostMetrics"]["UserStringCommand"]).as<std::string>("");
|
settingsStrings[hostMetrics_user_command] = (yamlConfig["HostMetrics"]["UserStringCommand"]).as<std::string>("");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (yamlConfig["General"]) {
|
if (yamlConfig["General"]) {
|
||||||
|
Loading…
Reference in New Issue
Block a user