From e2822f2192224d5851a4ef921327aaabd76d956e Mon Sep 17 00:00:00 2001 From: dhzl84 Date: Tue, 5 Dec 2023 16:11:35 +0100 Subject: [PATCH] extend MQTT keepAlive from 30 s to 180 s and timeout from 60 s to 360 s --- .github/workflows/main.yml | 2 +- build_number.py | 2 +- src/main.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 49b5607..340ed68 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v1 - uses: actions/setup-python@v1 with: - python-version: '3.8' # Version range or exact version of a Python version to use, using semvers version range syntax. + python-version: '3.12' # Version range or exact version of a Python version to use, using semvers version range syntax. architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified - name: install packages run: | diff --git a/build_number.py b/build_number.py index 554ba3b..d4a2499 100644 --- a/build_number.py +++ b/build_number.py @@ -4,7 +4,7 @@ import calendar YEAR = '2023' -MONTH = '11' +MONTH = '12' PATCH = '0' VERSION = ".".join([YEAR,MONTH,PATCH]) diff --git a/src/main.cpp b/src/main.cpp index c20d702..5de1e0f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -389,7 +389,7 @@ void MQTT_CONNECT(void) { if (WiFi.status() == WL_CONNECTED) { if (!myMqttClient.connected()) { myMqttClient.disconnect(); - myMqttClient.setOptions(30, true, seconds_to_milliseconds(60)); + myMqttClient.setOptions(180, true, seconds_to_milliseconds(360)); myMqttClient.begin(myConfig.mqtt_host, myConfig.mqtt_port, myWiFiClient); myMqttClient.setWill((myMqttHelper.getTopicLastWill()).c_str(), "offline", true, MQTT_QOS); /* broker shall publish 'offline' on ungraceful disconnect >> Last Will */ myMqttClient.onMessage(messageReceived); /* register callback */