Fix ESP32-P4 unique MQTT Client based on hosted MCU MAC address

This commit is contained in:
Theo Arends 2025-12-15 12:37:12 +01:00
parent c35e374739
commit a922d6609f
4 changed files with 5 additions and 1 deletions

View File

@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file.
- DALI watchdog exception - DALI watchdog exception
- TuyaMCU v1 exception 28 regression from v15.1.0.1 reverted PR24063 (#24220) - TuyaMCU v1 exception 28 regression from v15.1.0.1 reverted PR24063 (#24220)
- ESP8266 TasmotaSerial flush receive buffer on executing `TasmotaSerial.flush();` - ESP8266 TasmotaSerial flush receive buffer on executing `TasmotaSerial.flush();`
- ESP32-P4 unique MQTT Client based on hosted MCU MAC address
### Removed ### Removed

View File

@ -120,5 +120,6 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
### Fixed ### Fixed
- ESP8266 TasmotaSerial flush receive buffer on executing `TasmotaSerial.flush();` - ESP8266 TasmotaSerial flush receive buffer on executing `TasmotaSerial.flush();`
- ESP32-P4 unique MQTT Client based on hosted MCU MAC address
- DALI watchdog exception - DALI watchdog exception
- TuyaMCU v1 exception 28 regression from v15.1.0.1 reverted PR24063 [#24220](https://github.com/arendst/Tasmota/issues/24220) - TuyaMCU v1 exception 28 regression from v15.1.0.1 reverted PR24063 [#24220](https://github.com/arendst/Tasmota/issues/24220)

View File

@ -671,7 +671,6 @@ void setup(void) {
// Github inserts "release" or "commit number" before compiling using sed -i -e 's/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT 85cff52-/g' tasmota_version.h // Github inserts "release" or "commit number" before compiling using sed -i -e 's/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT 85cff52-/g' tasmota_version.h
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) 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)
Format(TasmotaGlobal.mqtt_client, SettingsText(SET_MQTT_CLIENT), sizeof(TasmotaGlobal.mqtt_client));
Format(TasmotaGlobal.mqtt_topic, SettingsText(SET_MQTT_TOPIC), sizeof(TasmotaGlobal.mqtt_topic)); Format(TasmotaGlobal.mqtt_topic, SettingsText(SET_MQTT_TOPIC), sizeof(TasmotaGlobal.mqtt_topic));
if (strchr(SettingsText(SET_HOSTNAME), '%') != nullptr) { if (strchr(SettingsText(SET_HOSTNAME), '%') != nullptr) {
SettingsUpdateText(SET_HOSTNAME, WIFI_HOSTNAME); SettingsUpdateText(SET_HOSTNAME, WIFI_HOSTNAME);

View File

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