fix(FileManager,Logging): day-rotated SD logs + boot reset-reason reporting
SD logging was a silent no-op on fresh cards: appendLine() opened /logs/vesper.log in FILE_APPEND without ever creating the /logs directory first. FileManager now exposes appendLogLine(), which creates the directory, rotates to YYYY-MM-DD.log files, and prunes oldest files once a 512KB total budget is exceeded. LoggingHandler gains logs.list / logs.download commands (chunked, paginated) so SD logs can be pulled off a device remotely for offline-device troubleshooting. Telemetry now captures esp_reset_reason() at boot and classifies it as a fault (panic/watchdog/brownout) or an expected reset (power-on/software/deep sleep). CommunicationRouter reports it once MQTT connects: faults go to status/alerts, expected resets go to status/info (type: boot_reason). MQTTDriver gained a setOnConnectCallback hook to support this. F-045, F-046, F-048 in the feature catalog.
This commit is contained in:
@@ -238,6 +238,10 @@ void MQTTDriver::onMqttConnect(bool sessionPresent) {
|
||||
|
||||
// 🔥 Start heartbeat timer
|
||||
startHeartbeat();
|
||||
|
||||
if (_onConnectCallback) {
|
||||
_onConnectCallback(sessionPresent);
|
||||
}
|
||||
}
|
||||
|
||||
void MQTTDriver::onMqttDisconnect(AsyncMqttClientDisconnectReason reason) {
|
||||
|
||||
Reference in New Issue
Block a user