Skip to content

Commit 01a5021

Browse files
BrentIOclaude
andcommitted
fix: replace bounded publish() with beginPublish/endPublish in onProgress
mqttClient.publish() silently drops payloads over 192 bytes (256-byte MQTT buffer minus 64 bytes of header/topic overhead). The onProgress JSON with release_url, title, and all state fields exceeds that limit, so the broker never receives percentage or title updates. Closes #693 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7041458 commit 01a5021

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

Controller/Controller.ino

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3724,9 +3724,11 @@ void otaFirmware_checkPending(){
37243724
mqttDoc["title"] = title;
37253725
char topic[MQTT_TOPIC_UPDATE_STATE_PATTERN_LENGTH+1];
37263726
snprintf(topic, sizeof(topic), MQTT_TOPIC_UPDATE_STATE_PATTERN, deviceIdentity.data.uuid);
3727-
char buffer[384];
3728-
serializeJson(mqttDoc, buffer, sizeof(buffer));
3729-
mqttClient.publish(topic, buffer);
3727+
mqttClient.beginPublish(topic, measureJson(mqttDoc), false);
3728+
BufferingPrint bufferedClient(mqttClient, 32);
3729+
serializeJson(mqttDoc, bufferedClient);
3730+
bufferedClient.flush();
3731+
mqttClient.endPublish();
37303732
}
37313733
mqttClient.loop();
37323734
});

0 commit comments

Comments
 (0)