Fixed ESP8266 build errors

This commit is contained in:
Gunnar Skjold
2026-03-26 14:39:33 +01:00
parent ecd7017ac5
commit 9609e9fb85
2 changed files with 5 additions and 1 deletions

View File

@@ -149,7 +149,7 @@ bool AmsMqttHandler::connect() {
debugger->printf_P(PSTR("Failed to connect to MQTT: %d\n"), mqtt.lastError());
#if defined(ESP8266)
if(mqttSecureClient) {
mqttSecureClient->getLastSSLError((char*) json, BufferSize);
mqttSecureClient->getLastSSLError((char*) json, BUF_SIZE_COMMON);
debugger->println((char*) json);
}
#endif

View File

@@ -555,6 +555,7 @@ void JsonMqttHandler::onMessage(String &topic, String &payload) {
AmsJsonGenerator::generateMonthPlotJson(ds, json, BUF_SIZE_COMMON);
bool ret = mqtt.publish(pubTopic, json);
loop();
#if defined(ESP32)
} else if(strcmp_P(action, PSTR("getconfig")) == 0) {
char pubTopic[192];
snprintf_P(pubTopic, 192, PSTR("%s/config"), mqttConfig.publishTopic);
@@ -564,6 +565,7 @@ void JsonMqttHandler::onMessage(String &topic, String &payload) {
} else if(strcmp_P(action, PSTR("setconfig")) == 0 && obj.containsKey(F("config"))) {
JsonObject configObj = obj[F("config")];
handleConfigMessage(configObj);
#endif
}
}
}
@@ -587,6 +589,7 @@ void JsonMqttHandler::onMessage(String &topic, String &payload) {
}
}
#if defined(ESP32)
void JsonMqttHandler::handleConfigMessage(JsonObject& configObj) {
// General
if(configObj.containsKey(F("g"))) {
@@ -1133,6 +1136,7 @@ void JsonMqttHandler::handleConfigMessage(JsonObject& configObj) {
}
}
}
#endif
void JsonMqttHandler::toJsonIsoTimestamp(time_t t, char* buf, size_t buflen) {
memset(buf, 0, buflen);