From d44fc80cd30f0ca68d9b1a2bdf8448d89f978e30 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Tue, 6 Jul 2021 11:28:33 +0200 Subject: [PATCH] Fix exception 28 when unable to send MQTT message Fix exception 28 when unable to send MQTT message and a topic name without a slash '/' (#12555) --- CHANGELOG.md | 2 ++ RELEASENOTES.md | 2 ++ tasmota/xdrv_02_9_mqtt.ino | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e58d2322d..cb75babcb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,8 @@ All notable changes to this project will be documented in this file. - Scripter moving average and sml input validation (#12541) - Zigbee Hue angle encoding (#12545) - AM2320 value reporting (#12552) +- Exception 28 when unable to send MQTT message and a topic name without a slash '/' (#12555) +- Wi-Fi initial setup workaround for 11n only routers (#12566) ## [9.5.0.1] 20210701 ### Added diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 955fe79df..2c7e4034c 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -126,6 +126,8 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo - Scripter and Display MQTT errors due to MQTT_DATA move to String [#12525](https://github.com/arendst/Tasmota/issues/12525) - Scripter moving average and sml input validation [#12541](https://github.com/arendst/Tasmota/issues/12541) - Zigbee Hue angle encoding [#12545](https://github.com/arendst/Tasmota/issues/12545) +- Exception 28 when unable to send MQTT message and a topic name without a slash '/' [#12555](https://github.com/arendst/Tasmota/issues/12555) +- Wi-Fi initial setup workaround for 11n only routers [#12566](https://github.com/arendst/Tasmota/issues/12566) ### Noted - ESP32 single core **tasmota32solo1.bin** binary can only be uploaded using the GUI as OTA upload will trigger the watchdog timer \ No newline at end of file diff --git a/tasmota/xdrv_02_9_mqtt.ino b/tasmota/xdrv_02_9_mqtt.ino index 167fea8a3..bbc37b29e 100644 --- a/tasmota/xdrv_02_9_mqtt.ino +++ b/tasmota/xdrv_02_9_mqtt.ino @@ -640,7 +640,8 @@ void MqttPublishPayload(const char* topic, const char* payload, uint32_t binary_ log_data_topic += topic; // stat/tasmota/STATUS2 } else { log_data_topic = F(D_LOG_RESULT); // RSL: - log_data_topic += strrchr(topic,'/')+1; // STATUS2 + char *command = strrchr(topic, '/'); // If last part of topic it is always the command + log_data_topic += (command == nullptr) ? topic : command +1; // STATUS2 retained = false; // Without MQTT enabled there is no retained message } log_data_topic += F(" = "); // =