More debugging
This commit is contained in:
+17
-2
@@ -437,7 +437,7 @@ static void handleRoot() {
|
||||
meterRows += "<div class=tabs><div class=tab-nav>";
|
||||
for (int i = 0; i < meterCount; i++) {
|
||||
String label = strlen(meters[i].name) > 0 ? escHtml(meters[i].name) : "Meter " + String(i);
|
||||
meterRows += "<button class=tab-btn" + String(i == 0 ? " active" : "") + " data-tab=" + String(i) + ">" + label + "</button>";
|
||||
meterRows += "<button type=button class=tab-btn" + String(i == 0 ? " active" : "") + " data-tab=" + String(i) + ">" + label + "</button>";
|
||||
}
|
||||
meterRows += "</div>";
|
||||
}
|
||||
@@ -816,6 +816,11 @@ static void applyFactoryResetIfNeeded(int count) {
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
Serial.println("\n\n=== M1730 boot ===");
|
||||
Serial.printf("[BOOT] chip=%s rev=%d cores=%d cpu=%dMHz flash=%uMB\n",
|
||||
ESP.getChipModel(), ESP.getChipRevision(), ESP.getChipCores(),
|
||||
ESP.getCpuFreqMHz(), ESP.getFlashChipSize() / (1024 * 1024));
|
||||
Serial.printf("[BOOT] free heap=%u sketch=%u / %u\n",
|
||||
ESP.getFreeHeap(), ESP.getSketchSize(), ESP.getFreeSketchSpace());
|
||||
if (!LittleFS.begin(false)) {
|
||||
Serial.println("[FS] mount failed, formatting...");
|
||||
LittleFS.begin(true);
|
||||
@@ -829,6 +834,14 @@ void setup() {
|
||||
loadConfig();
|
||||
hostnameParam.setValue(hostname, sizeof(hostname) - 1);
|
||||
|
||||
for (int i = 0; i < meterCount; i++)
|
||||
Serial.printf("[BOOT] meter[%d] pin=%d name=\"%s\" unit=\"%s\" maxD=%.1f range=[%.1f,%.1f] cur=%.1f\n",
|
||||
i, meters[i].pin, meters[i].name, meters[i].unit,
|
||||
meters[i].maxDuty, meters[i].rangeMin, meters[i].rangeMax, meters[i].currentValue);
|
||||
Serial.printf("[BOOT] mqtt=%d broker=%s:%d prefix=%s\n",
|
||||
mqttCfg.enabled, mqttCfg.host, mqttCfg.port, mqttCfg.prefix);
|
||||
Serial.printf("[BOOT] auth=%d\n", authCfg.enabled);
|
||||
|
||||
int resetCount = incrementResetCount();
|
||||
|
||||
attachMeters();
|
||||
@@ -854,7 +867,8 @@ void setup() {
|
||||
Serial.println("[WIFI] failed, restarting");
|
||||
ESP.restart();
|
||||
}
|
||||
Serial.printf("[WIFI] connected, IP: %s\n", WiFi.localIP().toString().c_str());
|
||||
Serial.printf("[WIFI] connected, IP: %s MAC: %s RSSI: %d\n",
|
||||
WiFi.localIP().toString().c_str(), WiFi.macAddress().c_str(), WiFi.RSSI());
|
||||
|
||||
strlcpy(hostname, hostnameParam.getValue(), sizeof(hostname));
|
||||
saveConfig();
|
||||
@@ -864,6 +878,7 @@ void setup() {
|
||||
|
||||
Serial.printf("[BOOT] ready at http://%s.local or http://%s\n",
|
||||
hostname, WiFi.localIP().toString().c_str());
|
||||
Serial.printf("[BOOT] free heap=%u\n", ESP.getFreeHeap());
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
Reference in New Issue
Block a user