fix(mqtt): restore legacy outbox behavior for QoS0 async publishes

Update the PsychicMqttClient to ensure that QoS0 messages are enqueued with durable outbox storage. This change addresses issues with false-failure semantics in certain connected paths, improving message flow reliability. Additionally, modify platformio.ini to include SSL certificate generation and adjust build flags for reduced verbosity and enhanced functionality.
This commit is contained in:
agessaman committed 2026-04-23 22:48:21 -07:00
1 parent bb67b04ef8
commit 70722a5873
2 files changed
+17 -8

No files matched your search

@@ -519,10 +519,10 @@ int PsychicMqttClient::publish(const char *topic, int qos, bool retain, const ch
if (async)
{
ESP_LOGV(TAG, "Enqueuing message to topic %s with QoS %d", topic, qos);
// QoS0 telemetry is high-rate and does not need durable outbox storage.
// Avoiding store=true reduces small allocation churn in reconnect storms.
// Keep store=true for QoS1/2 so status/control semantics remain durable.
bool store_in_outbox = (qos > 0);
// Hotfix: restore legacy outbox behavior for QoS0 async publishes.
// This avoids false-failure semantics from enqueue(store=false) on some
// connected paths where packet topics stop flowing.
bool store_in_outbox = true;
return esp_mqtt_client_enqueue(_client, topic, payload, length, qos, retain, store_in_outbox);
}
else
+13 -4
View File
@@ -467,6 +467,11 @@ lib_deps =
[env:Heltec_WSL3_repeater_observer_mqtt]
extends = Heltec_lora32_v3
extra_scripts =
${esp32_base.extra_scripts}
pre:scripts/generate_cert_bundle.py
board_ssl_cert_source = adafruit
board_build.embed_files = src/certs/x509_crt_bundle.bin
build_flags =
${Heltec_lora32_v3.build_flags}
-D ADVERT_NAME='"MQTT Observer"'
@@ -478,12 +483,14 @@ build_flags =
-D MAX_MQTT_BROKERS=3
-D MQTT_MAX_PACKET_SIZE=1024
-D MQTT_DEBUG=1
-D MESH_PACKET_LOGGING=1
-D MESH_DEBUG=1
-D MQTT_MEMORY_DEBUG=1
; Keep default observer profile less verbose to reduce runtime contention.
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
-D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y
-D ESP32_CPU_FREQ=160
-D MQTT_WIFI_TX_POWER=WIFI_POWER_19_5dBm
-D MQTT_WIFI_POWER_SAVE_DEFAULT=1
-D MQTT_WIFI_TX_POWER=WIFI_POWER_11dBm
-D WITH_SNMP=1
# -D WIFI_SSID='"ssid"'
# -D WIFI_PWD='"password"'
# -D MQTT_SERVER='"your-mqtt-broker.com"'
@@ -494,6 +501,7 @@ build_src_filter = ${Heltec_lora32_v3.build_src_filter}
+<helpers/bridges/MQTTBridge.cpp>
+<helpers/MQTTMessageBuilder.cpp>
+<helpers/JWTHelper.cpp>
+<helpers/SNMPAgent.cpp>
+<../examples/simple_repeater>
lib_deps =
${Heltec_lora32_v3.lib_deps}
@@ -502,6 +510,7 @@ lib_deps =
bblanchon/ArduinoJson
arduino-libraries/NTPClient
JChristensen/Timezone
0neblock/SNMP_Agent
paulstoffregen/Time@1.6.1
[env:Heltec_v3_kiss_modem]