Skip to content

Commit a922d66

Browse files
committed
Fix ESP32-P4 unique MQTT Client based on hosted MCU MAC address
1 parent c35e374 commit a922d66

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file.
1515
- DALI watchdog exception
1616
- TuyaMCU v1 exception 28 regression from v15.1.0.1 reverted PR24063 (#24220)
1717
- ESP8266 TasmotaSerial flush receive buffer on executing `TasmotaSerial.flush();`
18+
- ESP32-P4 unique MQTT Client based on hosted MCU MAC address
1819

1920
### Removed
2021

RELEASENOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,5 +120,6 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
120120

121121
### Fixed
122122
- ESP8266 TasmotaSerial flush receive buffer on executing `TasmotaSerial.flush();`
123+
- ESP32-P4 unique MQTT Client based on hosted MCU MAC address
123124
- DALI watchdog exception
124125
- TuyaMCU v1 exception 28 regression from v15.1.0.1 reverted PR24063 [#24220](https://github.com/arendst/Tasmota/issues/24220)

tasmota/tasmota.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,6 @@ void setup(void) {
671671
// Github inserts "release" or "commit number" before compiling using sed -i -e 's/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT 85cff52-/g' tasmota_version.h
672672
snprintf_P(TasmotaGlobal.image_name, sizeof(TasmotaGlobal.image_name), PSTR("(" STR(TASMOTA_SHA_SHORT) "%s)"), PSTR(CODE_IMAGE_STR)); // Results in (85cff52-tasmota) or (release-tasmota)
673673

674-
Format(TasmotaGlobal.mqtt_client, SettingsText(SET_MQTT_CLIENT), sizeof(TasmotaGlobal.mqtt_client));
675674
Format(TasmotaGlobal.mqtt_topic, SettingsText(SET_MQTT_TOPIC), sizeof(TasmotaGlobal.mqtt_topic));
676675
if (strchr(SettingsText(SET_HOSTNAME), '%') != nullptr) {
677676
SettingsUpdateText(SET_HOSTNAME, WIFI_HOSTNAME);

tasmota/tasmota_xdrv_driver/xdrv_02_9_mqtt.ino

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,6 +1112,9 @@ void MqttConnected(void) {
11121112
}
11131113

11141114
void MqttReconnect(void) {
1115+
if (!strlen(TasmotaGlobal.mqtt_client)) { // Do it here as it needs the MAC address from a possible hosted MCU available after WiFi connection
1116+
Format(TasmotaGlobal.mqtt_client, SettingsText(SET_MQTT_CLIENT), sizeof(TasmotaGlobal.mqtt_client));
1117+
}
11151118
Mqtt.allowed = Settings->flag.mqtt_enabled && (TasmotaGlobal.restart_flag == 0); // SetOption3 - Enable MQTT, and don't connect if restart in process
11161119
if (Mqtt.allowed) {
11171120
#if defined(USE_MQTT_AZURE_DPS_SCOPEID) && defined(USE_MQTT_AZURE_DPS_PRESHAREDKEY)

0 commit comments

Comments
 (0)