Skip to content

Commit

Permalink
extend MQTT keepAlive from 30 s to 180 s and timeout from 60 s to 360 s
Browse files Browse the repository at this point in the history
  • Loading branch information
dhzl84 committed Dec 5, 2023
1 parent b051a7a commit e2822f2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion build_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import calendar

YEAR = '2023'
MONTH = '11'
MONTH = '12'
PATCH = '0'

VERSION = ".".join([YEAR,MONTH,PATCH])
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit e2822f2

Please sign in to comment.