Fix mqtt publish length bug

This commit is contained in:
fvanroie 2020-11-20 23:25:47 +01:00
parent a3b358f738
commit bea980056a
2 changed files with 3 additions and 3 deletions

View File

@ -154,8 +154,8 @@ void IRAM_ATTR mqtt_send_state(const __FlashStringHelper * subtopic, const char
// if(mqttIsConnected()) {
char tmp_topic[strlen(mqttNodeTopic) + 20];
size_t len = snprintf_P(tmp_topic, sizeof(tmp_topic), PSTR("%sstate/%s"), mqttNodeTopic, subtopic);
bool res = mqttPublish(tmp_topic, payload, len);
snprintf_P(tmp_topic, sizeof(tmp_topic), PSTR("%sstate/%s"), mqttNodeTopic, subtopic);
bool res = mqttPublish(tmp_topic, payload, strlen(payload));
mqttResult(res, tmp_topic, payload);
// } else {
// return mqtt_log_no_connection();

View File

@ -68,7 +68,7 @@ void tftShowConfig(TFT_eSPI & tft)
Log.verbose(TAG_TFT, F("Transactns : %s"), (tftSetup.trans == 1) ? PSTR("Yes") : PSTR("No"));
Log.verbose(TAG_TFT, F("Interface : %s"), (tftSetup.serial == 1) ? PSTR("SPI") : PSTR("Parallel"));
#if defined(ARDUINO_ARCH_ESP8266)
Log.verbose(TAG_TFT, F("SPI overlap : %s"), (tftSetup.overlap == 1) ? PSTR("Yes") : PSTR("No"));
Log.verbose(TAG_TFT, F("SPI overlap: %s"), (tftSetup.overlap == 1) ? PSTR("Yes") : PSTR("No"));
#endif
if(tftSetup.tft_driver != 0xE9D) // For ePaper displays the size is defined in the sketch